Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request - Auto forwarding of all emails to an SMTP server #37

Open
jstockho opened this issue Feb 20, 2015 · 1 comment
Open

Comments

@jstockho
Copy link

I would love to have an option to have all emails forwarded to an SMTP server. I was thinking of something like using command-line options as such:

Mailhog -outgoing-smtp smtpServer -auto-forward TestServer

This would require the contents of smtpServer to look something like:
{
"TestServer": {
"Name": "TestServer",
"Save": true,
"Email": "[email protected]",
"Host": "webmail.emailAddr.com",
"Port": "25",
"Username": "",
"Password": "",
"Mechanism": "PLAIN"
}
}

The auto-forward would require a server from the provided config. You could require that there be an email address provided in the server given to the auto-forward option, and default save to true. If you want to go crazy, you could use the recipient of the email sent to mailhog and if there's a server in the config that matches that address, it would automatically forward there. In this case you could eliminate the server name from the auto-forward argument and just default to the first server in the list if the email address doesn't match any of them.

My use case is that I have several environments I want to run automation against, so I want mailhog to run on each box and keep emails in memory. This eliminates the need for a central mail server or running heavy mail servers on each box. However, I want to keep a longer-lasting record so we can look back at emails from a central place that users can access via Thunderbird or SquirrelMail, as we have many different levels of user. If that server is down, our automation can at least run and pass. Right now we're tied to the central server, which gives us a single point of failure, so using mailhog as a pass-through with a local copy would solve our problems.

@ian-kent
Copy link
Member

I like it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants