title | description |
---|---|
Configuration |
Learn how to configure the Lando Mailpit service. |
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.22
mailFrom:
- appserver
maxMessages: 500
port: 1025
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
mailpit
binary as asendmail
replacement at/helpers/mailpit
- Configure environment variables (
MAIL_HOST
andMAIL_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.22
mailFrom:
- phpapp
phpapp:
type: php
The maximum number of messages to store before truncating. Must be at least 1.
services:
mailpit:
type: mailpit:1.22
maxMessages: 1000 # Store up to 1000 messages
The SMTP port to use for sending mail to Mailpit. Must be between 1 and 65535.
services:
mailpit:
type: mailpit:1.22
port: 2525 # Use custom SMTP port
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.22
portforward: true