Koozali.org: home of the SME Server
Contribs.org Forums => Koozali SME Server 10.x => Topic started by: holck on November 26, 2022, 04:43:46 PM
-
As mentioned here https://forums.koozali.org/index.php/topic,54914.0.html, some email providers lately have been blocking emails from my server, because of problems with reverse dns for my ip address.
So I decided to subscribe to mailersend.com, and set up my own server to use this, using smtp-auth-proxy. And this works ... mostly.
mailersend.com won't allow me to deliver DMARC reports to other mail providers, because mailersend.com blocks email with *.xml.gz attachments.
Also, it seems a bit foolish to use mailersend.com for emails to e.g. google.com, as Google happily accepts emails directly from my server. So I've experimented a bit with the contents of /var/qmail/control/smtproutes.
My idea is to use something like this:
csjdanmark.dk:localhost:26
jubii.dk:localhost:26
mail.dk:localhost:26
pc.dk:localhost:26
privat.dk:localhost:26
stofanet.dk:localhost:26
webspeed.dk:localhost:26
yahoo.dk:localhost:26
youmail.dk:localhost:26
:localhost
Hoping that this would make qmail use mailersend.com for outgoing emails to a few, specific domains. And for all other domains just send the emails directly.
But apparently this leads to some sort of mail loop, where qmail continuously tries to send the emails in the queue.
Any suggestions?
Answering my own question - all it required was to delete the last line in /var/qmail/control/smtproutes. With this contents, emails to a few, specific domains are forwarded to the external smtp-server, everything else is sent directly to the receiver.
csjdanmark.dk:localhost:26
jubii.dk:localhost:26
mail.dk:localhost:26
pc.dk:localhost:26
privat.dk:localhost:26
stofanet.dk:localhost:26
webspeed.dk:localhost:26
yahoo.dk:localhost:26
youmail.dk:localhost:26
-
Can you add that somewhere on the wiki please?
-
I'm sorry, but I don't know where in the wiki the info could it in, and I don't think I have access to update the wiki.
But here's a small summary:
If you want to use an external mail server to deliver mails to some domains, but use the built-in mail server for delivering mails to all other domains, you should:
1: In server manager choose "E-mail" under menu heading "Configuration"
2: Fill out the entries under "SMTP server": Address of the external mail server, and - if needed - the user id and password to use for getting access to the external mail server
3: If you need to use a special port (e.g. 587) on the external mail server:
/sbin/e-smith/db configuration setprop smtpauthproxy PeerPort 587
4: It may be advisable to also do
/sbin/e-smith/db configuration setprop smtpauthproxy Debug enabled
This will show the communication with the external mail server, helping solve potential problems regarding login etc.
5: Create a custom-template for /var/qmail/control/smtproutes, e.g. the file /etc/e-smith/templates-custom/var/qmail/control/smtproutes/01custom with a content like this:
onedomain.com:localhost:26
anotherdomain.org:localhost:26
with one line for each domain, for which you want to use the external mail server
6: signal-event email-update
-
You are a member of the Wiki & Docs team.
Login with your forum login.
Ask us questiond on Rocket in the SME-Documentation channel.