Closed jesucarr closed 8 years ago
Will all of your users be using the same provider? e.g. smtp.myprovider.com from your example.
Oh - and this would only be handling outbound mail mail - right? e.g. your users would be using Haraka as their outgoing SMTP server, you wouldn't want it to also act as an MX for any of your domains.
Exactly. Same provider for all, just different username/password, and only outgoing SMTP.
You'd have to customize auth_proxy a bit - something like this (untested): https://gist.github.com/smfreegard/42ecb455dcd61f8e6bb9
Then you'd need a plugin like this to override the MX and to set the same AUTH user and password: https://gist.github.com/smfreegard/aeb9e218d7f6106bab1d
You'd put both those plugins in /path/where/you/installed/Haraka/plugins, then add them both to /path/to/where/you/installed/haraka/config/plugins (you can remove everything else from this file)
Then do: echo smtp.myprovider.com > /path/to/where/you/installed/Haraka/config/proxy_host
Start-up Haraka and try it. If it works, it will authenticate you against smtp.myprovider.com and if successful, will allow you to send a mail at which point it will accept the mail and then deliver it to smtp.myprovider.com using the same credentials.
If it doesn't work - then you get to debug it and work out why it doesn't work ;-)
Thanks a lot for your help. It works perfectly.
I think this can be useful for others, so I created a plugin with your solution and sent a PR: https://github.com/haraka/Haraka/pull/1326
Hope makes sense
I'd like to authenticate and send emails using my SMTP provider but using my Haraka installation as SMTP server. So for example one of my users have this login details:
host: smtp.myprovider.com port: 25 user: mylongkey password: mylongkey TLS: yes
Now I want to be able to change it to:
host: smtp.myharakainstall.com port: 25 user: mylongkey password: mylongkey TLS: yes
I had a look to the auth_proxy plugin, but apparently it needs the user in user@domain format, but my user is a long key.
I also had a look to the smtp_proxy plugin, but apparently I need to specify the login details, but I need to use whatever login details the user is using.
So basically I use my own host name, and the rest is authenticated and sent to my provider.
Is this possible with Haraka?