Configuration
Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means we highly recommend scanning the services documentation to get a good handle on how the magicks work.
Also note that options, in addition to the build steps and overrides that are available to every service, are shown below:
services:
mailpit:
type: mailpit:1.27
mailFrom:
- appserver
maxMessages: 500
port: 1025Configuration Options
mailFrom
The mailFrom config key lets you specify which services should be configured to send mail through Mailpit. While this configuration is optional, it enables automatic setup of mail sending capabilities in the specified services.
When services are listed under mailFrom, Lando will:
- Install the
mailpitbinary as asendmailreplacement at/helpers/mailpit - Configure environment variables (
MAIL_HOSTandMAIL_PORT) for SMTP access - For PHP services, configure php.ini to use the Mailpit sendmail binary, enabling PHP's built-in
mail()function to automatically route through Mailpit
If you have an appserver service in your application, it will be automatically added to mailFrom by default. You can discover available services by running lando info.
Example configuration with explicit mail service setup:
services:
mailpit:
type: mailpit:1.27
mailFrom:
- phpapp
phpapp:
type: phpmaxMessages
The maximum number of messages to store before truncating. Must be at least 1.
services:
mailpit:
type: mailpit:1.27
maxMessages: 1000 # Store up to 1000 messagesport
The SMTP port to use for sending mail to Mailpit. Must be between 1 and 65535.
services:
mailpit:
type: mailpit:1.27
port: 2525 # Use custom SMTP portPort Forwarding
portforward
This option is inherited from the lando base service. It allows external access to the service by mapping a port on your host's localhost. For more details, refer to the Lando documentation on external access.
services:
mailpit:
type: mailpit:1.27
portforward: true