Sorry if this sounds dumb, but I am still unsure about the right way to add domains.
Let's say I am running MailScanner on my VPS. There is an external domain called www.example.com whose emails I want MailScanner to scan and then relay to the mailboxes physically hosted on the external server.
Exactly how should step 2 of the exim smart router configuration on /etc/staticroutes on my VPS look like? Should it be:
Should I put the IP address of my VPS or my mailserver hostname or the IP address of the external domain?example.com: what should come here?![]()
after the domain is the IP or FQDN of the destination server (where mailbox delivery occurs)
I'm trying to set up the basic remote_smtp_smart but seem to be hitting a little snag. Firstly, I've had to remove the domain from /etc/localdomains otherwise it checks the local user list.
I'm seeing messages staying in the queue on the server with this:
LOG: MAIN
lowest numbered MX record points to local host: influ.co.uk
LOG: MAIN
== beddo@influ.co.uk R=lookuphost defer (-1): lowest numbered MX record points to local host
LOG: MAIN
Frozen
The "static_route:" stuff is before lookuphost in the routers configuration so it looks to me like it is just being completely ignored
This is in routers
This is in transports:Code:static_route: driver = manualroute condition = "${perl{checkspam}}" route_data = ${lookup{$domain}lsearch{/etc/staticroutes}} transport = remote_smtp_smart
Anyone got any ideas what I'm missing?Code:remote_smtp_smart: driver = smtp port = 25 hosts = ${lookup{$domain}lsearch{/etc/staticroutes}} hosts_override
Thanks. I put the IP of the server where the mailboxes are physically hosted and finally got the VPS to scan the messages sent from the email account on the external domain. this works fine.
However, there is a problem with emails sent to the accounts on the external domain. The mails bounce back from the server doing the mail processing with the following message:
This seems to suggest that if I were to try the same thing for real life clients, the system would fail as their mailservers would also be probably configured to disallow relaying. Is there any way to resolve this?Mail Delivery System <Mailer-Daemon@host.mailprocessingdomain.com>
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
testaccount@externaldomain.com
SMTP error from remote mail server after RCPT TO:<testaccount@externaldomain.com>:
host IP ADDRESS: 550-host.mailprocessingdomain.com is currently not permitted to relay 550-through this server. Perhaps you have not logged into the pop/imap server
550-in the last 30 minutes or do not have SMTP Authentication turned on in your
550 email client.
To sum up:
1.) The MX record of the external domain points to my VPS's mailserver
2.) I have created an /etc/staticroutes file on my VPs with the following entry:
externaldomainname: IP address of server on which the domain is hosted
3.) I have configured exim smart routing on my VPS and added the external domain to /etc/localdomains
Any help would be appreciated.
Thanks. Well, the domain is in the /etc/localdomains file of the VPS running MailScanner that's actually meant to scan the emails and then relay them to the server on which that external domain is physically hosted.
However, I removed it from /etc/localdomains of the VPS physically hosting the domain because I had MailScanner installed on it as well and it was scanning the emails on this domain, completely defeating the purpose of having it scanned externally. Instead, I put in in the /etc/remotedomains file to tell Exim to ignore processing it.
From what I have seen, the issue is that the receiving server (where the domain and mailboxes are physically hosted) does not allow the processing server to relay to it after scanning. In sum, it seems to mean that I will have the same problem with clients who approach me only for scanning their emails.
Yet, this seems strange because I myself use MXLogic's Email Defense spam filtering service on one of my domains and all I had to do was to point that domain's MX records to those servers. I am sure this is possible, I am just missing something crucial.![]()
the domain needs to be in /etc/localdomains on both servers, on the destination box just set the domains scanning off in the mailscanner rules, the error its throwing is cannot relay to non-local domain (because on the destination server the domain is in /etc/remotedomains it will only relay to it for authenticated users - you have simply created a routing loop - hence why it doesnt work)
Thank you. I will test this out. I think this is going to work.
You're a gemIt works, finally, although I should remember to remove the domain from MailScanner's virus and spam scanning rules- the domain gets added to this list automatically when the MailScanner cronjob runs.
Seen as noone appears to have been able to get much from my little problem, I've had a bit more of a look. It seems like the messages are getting passed through the directors first where it hits localuser: before going to the routers.
This seems to me like basically the router needs rewriting to be a director that can be put in earlier in the food chain - at least for my server though I'm not sure on the syntax for that so could anyone help out?
If anyone else comes across the same problem, it turned out to be permissions. I'd given permissions but it wasn't in the right group.
/etc/staticroutes needs to be root:mail 660 otherwise it just fails silently with no errors logged. There are also quite a few sections under routers where you can put the router code, I'd put it right at the top but it needed to be further down in the first bit of routers generated from old directors.
Works fine now.