1826843 Members
4341 Online
109704 Solutions
New Discussion

MX server

 
SOLVED
Go to solution
Kamenko
New Member

MX server

I'm trying to set-up my Linux server to be backup MX for my domain. I have entered records in my NS as follow:

domain.com preference = 100, mail exchanger = mail.domain.com
domain.com preference = 200, mail exchanger = mail.domain.com
domain.com preference = 300, mail exchanger = mail2.mylinuxserver.com
mail.domain.com internet address =x.x.x.x
mail.domain.com internet address =x.x.x.x
mail.mylinuxserver.com internet address = x.x.x.x

When primary mail server mail.domain.com is down, my linux server is supposed to pick messages and keep them and deliver them to my primary mail server mail.domain.com once it's up and running again, but instead senders receive bounce-back message from my linux server:

----- The following addresses had permanent fatal errors -----

(reason: system config error)

----- Transcript of session follows -----
553 5.3.5 mail.mylinuxserver.com. config error: mail loops back to me (MX problem?)
554 5.3.5 ... Local configuration error

What am I doing wrong?
Thanks in advance
10 REPLIES 10
Gilles Salvin
Frequent Advisor

Re: MX server

Hello
may be just a syntax error , you specify
domain.com preference = 300, mail exchanger = mail2.mylinuxserver.com
and after
mail.mylinuxserver.com internet address = x.x.x.x
it must be mail2.mylinuxserver.com internet address = x.x.x.x
What could I say ?
U.SivaKumar_2
Honored Contributor

Re: MX server

hi,
In the primary DNS server of your domain , configure as follows:-
yourdomain.com MX 100 mail.yourdomain.com
yourdomain.com MX 200 mail2.yourdomain.com

regards,
U.SivaKumar
Innovations are made when conventions are broken
U.SivaKumar_2
Honored Contributor

Re: MX server

hi,
put this line FEATURE(`use_cw_file')dnl in
sendmail.mc of both the servers.
#m4 sendmail.mc > /etc/sendmail.cf

In the file /etc/sendmail.cw add your domain name, your machine name and all of its aliases and restart the sendmail service.

regards,
U.SivaKumar




Innovations are made when conventions are broken
Kamenko
New Member

Re: MX server

mail2.mylinuxserver.com was my typo in the previous message. It is mail.mylinuxserver.com.
Msquared
Occasional Advisor

Re: MX server

You do not want to add the domain name to the sendmail.cw for both mail servers. You only add that to the PRIMARY mailserver. If you add that to the secondary mailserver, the secondary mailserver will accept mail and deliver to its own mailboxes, rather than forward it to the primary mailserver.

To make your secondary mailserver handle mail for your domain, and to forward it on to the primary mailserver, you need to add this line to /etc/mail/access on your secondary mailserver:

domain.com RELAY

That tells Sendmail that it is allowed to relay mail for domain.com and forward it on to the primary mailserver. Do not add domain.com to sendmail.cw on the secondary.
Kamenko
New Member

Re: MX server

Thanks,
I made changes. How do I check if it works without bringing main mail server down?
U.SivaKumar_2
Honored Contributor

Re: MX server

hi,
To test relaying without putting down primary server do this on the secondary mail server.
In one of the console screen ( ctrl + Alt+ F3 )
#tail -f /var/log/mail.log
On some other screen
#telnet backupmail.exampleyourdomain.com 25
ESTMP sendmail 8.11.1
>HELO test
>MAIL FROM:sivakr@rediffmail.com
sender OK..
>RCPT TO:you@yourdomain.com
recipient ok...
>DATA
testmail
testmail
. ( end the meessge with a dot . )
OK
QUIT

Now see the screen where you are tailing the
mail.log online.
it should give log messages that it is trying the delivery to the primary server. And
RECEIVED OK message should come.
again
#mailq
should show mail queue empty. And now check the user mail box in the primary server for that test mail. you@yourdomain.com


regards,
U.SivaKumar
Innovations are made when conventions are broken
Kamenko
New Member

Re: MX server

May 17 10:00:38 cobalt sendmail[6359]: g4HDwBQ06359: from=sivakr@rediffmail.com, size=25, class=0, nrcpts=1, msgid=<200205171359.g4HDwBQ06359@cobalt.xxx.net>, proto=SMTP, daemon=MTA, relay=cobalt.xxx.net [xxx.xxx.xxx.xxx]

May 17 10:00:38 cobalt sendmail[6481]: g4HDwBQ06359: to=user@xxx.org, delay=00:00:58, xdelay=00:00:00, mailer=esmtp, pri=30025, relay=mail.yyy.org. [yyy.yyy.yyy.yyy], dsn=2.0.0, stat=Sent (Ok)

Note:
cobalt.xxx.net is the secondary mail server;
mail.yyy.org is my primary mail server
and I got the test e-mail in my inbox.

It works fine while primary mail server is up. As soon as I disconect it doesn't work. Senders getting bounced messages.
Here is the maillog:

May 17 10:32:13 cobalt sendmail[7886]: g4HEWCQ07886: from=, size=1477, class=0, nrcpts=1, msgid=<000e01c1fdb0$d115e8f0$3c01a8c0@userr>, proto=ESMTP, daemon=MTA, relay=out019pub.verizon.net [206.46.170.98]
May 17 10:32:13 cobalt sendmail[7895]: g4HEWCQ07886: SYSERR(root): mail2.xxx.org. config error: mail loops back to me (MX problem?)
May 17 10:32:13 cobalt sendmail[7895]: g4HEWCQ07886: to=, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=31477, relay=mail2.xxx.org. [206.67.58.201], dsn=5.3.5, stat=Local configuration error
May 17 10:32:13 cobalt sendmail[7895]: g4HEWCQ07886: g4HEWDQ07895: DSN: Local configuration error
May 17 10:32:14 cobalt sendmail[7895]: g4HEWDQ07895: to=, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=61577, relay=relay.verizon.net. [206.46.170.12], dsn=2.0.0, stat=Sent (Message received: 20020517143907.LONF17892.mta012.verizon.net@cobalt.xxx.net)
May 17 10:32:14 ucscobalt sendmail[7895]: g4HEWDQ07895: to=admin, delay=00:00:01, xdelay=00:00:00, mailer=local, pri=61577, dsn=2.0.0, stat=Sent


U.SivaKumar_2
Honored Contributor
Solution

Re: MX server

hi,
have you used alias CNAME in the MX records ?,
if yes change it to real name of the secondary
host.

Also try adding your domains name to Cw macro in /etc/sendmail.cf file of primary mail server and secondary mail server and restart sendmail.
eg:-
Cw xxx.com yyy.net

try again and get back with results.

regards,

U.SivaKumar
Innovations are made when conventions are broken
Kamenko
New Member

Re: MX server

Server its self had different name so I changed it into name I have in DNS settings with my domain host and I applied all what you told me to and it finally worked. Thanks a lot.