Install mailcatcher. Configure server to send ALL mail to mailcatcher so nothing escapes.
See the full Salt Formulas installation and usage instructions
Install mailcatcher and start the service.
Install mailcatcher and its dependencies.
Configure PHP to use mailcatcher.
Start the service (after stopping any other mail service).
All pillar values are optional, though you likely want to make sure we're catching mail from all the places you may be sending it.
mailcatcher:
php_integration: True
The pillar setting above will update php.ini such that PHP uses mailcatcher to send mail.
mailcatcher:
apache_integration: True
php_integration: True
The pillar setting above will update php.ini such that PHP uses mailcatcher to send mail, and it will restart Apache so the changes take effect.
mailcatcher:
nginx_integration: True
php_integration: True
The pillar setting above will update php.ini such that PHP uses mailcatcher to send mail, and it will restart Nginx so the changes take effect.
Mailcatcher cannot run if Sendmail or exim is running. Thus it will STOP and DISABLE the existing sendmail service.
The name of the service is defined in the map.jinja, we guess it is exim4
on modern
systems but who knows what yours is.
mailcatcher:
lookup:
smtp_service: custom_service_name
If you don't have any existing SMTP service running on your machine and you don't want us to constantly check that said non-existing service is dead, you can set a pillar like
mailcatcher:
smtp_service: False