External an local mailserver -> 550 error

Tagor

Well-Known Member
Mar 6, 2004
193
0
166
External and local mailserver -> 550 error

Hi,

I have a domain which uses a external and local mailserver. This is how my config looks like:
MX 10 some.external.ip.address
MX 20 127.0.0.1

Now I removed this domain from /etc/localdomains and added it to /etc/remotedomains. However now the second MX entry doesn't work. I get the following error:
Could not connect: Got an unknown RCPT TO response: 550-test.dnsstuff.com (test.DNSreport.com) [66.36.241.109]:24027 is currently
550-not permitted to relay through this server.
Perhaps you have not logged
550-into the pop/imap server in the last 30 minutes or do not have SMTP
550 Authentication turned on in your email client.
I think this is because the domain isn't in /etc/localdomains. Is there a way to have e-mail delivered externally and a failover which is locally?
 
Last edited:

elliotcooper

Well-Known Member
PartnerNOC
May 18, 2005
56
0
156
I think that the best thing to do here will be to drop using the IP addresses in the MX records, as you shouldn't be doing that anyway, and create a second A record that resolves to an IP on your server and use that in the failover MX record.

So you should first create two A records like:

mail1.yourdomain.com A some.external.ip.address
mail2.yourdomain.com A IP.that.the.cpanel.account.for.the.domain.is.configured.to.use

Then set the MX records as follows:

yourdomain.com MX 10 mail1.yourdomain.com
yourdomain.com MX 20 mail2.yourdomain.com

If you keep the domain out of the /etc/localdomains then the server will deliver the mail as per the MX records which should end putting it in the local mail box if the primary MX is unreahable.

I haven't tried this so I don't know that it will work but it would be the first thing that I would try.
 

Tagor

Well-Known Member
Mar 6, 2004
193
0
166
I tried that already. It causes two problems. First it doesn't deliver the local e-mail and second it returns the above error.
 

AdminWAY

Member
Feb 15, 2005
5
0
151
Hi,

Have you tried going into WHM, under the Exim Configuration disable the setting "Verify the existence of email senders".
 

elliotcooper

Well-Known Member
PartnerNOC
May 18, 2005
56
0
156
How exactly are you generating the error that you list in your origional post? It looks like you are generating it using the Mail Test on http://www.dnsreport.com/. It look like the dnsreport server is attempting to initiate a connection on port 25 which the server is denying because it uses pop before smtp. You cannot initiate a connection on port 25 unless you have, in the last 30 minutes, logged into a pop account on the server from the same IP. Doing this from dnsreport is not going to give you a valid error report.

Do you get the same error when you attempt to relay mail through the server from an IP that you have used to collect mail from in the last 30 mintues?

What happens if you send a message to one of these problemm addresses from a web mail account?
 
Last edited:

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
You cannot do what you're looking to do there, that's not the function of a backup MX. The MX scores are only a suggestions as to where an email server shoudl attempt to deliver to first if it can get to that server, otherwise it will attempt delivery to the other server.

Most SMTP servers then require you to allow relaying on both MX servers with one setup to actually receive the email. You cann have any MX record set to a local server and not allow relaying on that server for that domain.

What you definitely cannot have is this:

MX 20 127.0.0.1

Since that means that anyone sending email to that domain is being told to deliver email to itself and never send off server.

You need to read up more on what backup MX is for and how it works.
 

Tagor

Well-Known Member
Mar 6, 2004
193
0
166
Sorry, I accidentally wrote '127.0.0.1', actually I use the ip address of the server on that record. Is this correct?

MX 10 some.external.ip.address
MX 20 ip.address.of.server

I guess this will take over the job if the first mail server can't be reached?

By the way for some reason the mail delivery to the external server now works. But I get that error message on DNSstuff. I am wondering if the mail backup server now also works?
 

Tagor

Well-Known Member
Mar 6, 2004
193
0
166
I noticed the following error when someone tried to deliver a message on the backup mailserver:

2006-01-21 00:22:59 H=host86-130-69-48.range86-130.btcentralplus.com (mail-backup.xxx.com) [xx.xxx.xx.xx]:4145 I=[xx.xx.xx.xx]:25 F=<[email protected]> rejected RCPT <[email protected]>: host86-130-69-48.range86-130.btcentralplus.com (mail-backup.xxx.com) [86.130.69.48]:4145 is currently not permitted to relay through this server. Perhaps you have not logged into the pop/imap server in the last 30 minutes or do not have SMTP Authentication turned on in your email client.