LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-03-2011, 10:56 AM   #1
lrtward
Member
 
Registered: Feb 2011
Distribution: CentOS, Ubuntu
Posts: 97

Rep: Reputation: 9
sendmail ignoring MX records; only uses smart relay


This is a new installation of CentOS 5.5
It is a web server that only needs to send out messages.
Some messages go to faculty and staff at domain.edu.
Other messages go to students at sub.domain.edu.

The mail server (Exchange) at domain.edu is my smart relay.
It rejects all mail not to user@domain.edu addresses.
Consequently, my web server cannot send messages to student@sub.domain.edu.

This problem also happens when sending to other domains such as gmail.com

/var/log/maillog:
Code:
Mar  3 10:42:30 webserver sendmail[17342]: p23FgUHB017342: from=<root@webserver.domain.edu>, size=320, class=0, nrcpts=1, msgid=<201103031542.p23FgSnA017341@webserver.domain.edu>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Mar  3 10:42:30 webserver sendmail[17341]: p23FgSnA017341: to=student@sub.domain.edu, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p23FgUHB017342 Message accepted for delivery)
Mar  3 10:42:30 webserver sendmail[17344]: STARTTLS=client, relay=smartrelay.domain.edu., version=TLSv1/SSLv3, verify=FAIL, cipher=AES128-SHA, bits=128/128
Mar  3 10:42:35 webserver sendmail[17344]: p23FgUHB017342: to=<student@sub.domain.edu>, ctladdr=<root@webserver.domain.edu> (0/0), delay=00:00:05, xdelay=00:00:05, mailer=relay, pri=120320, relay=smartrelay.domain.edu. [10.102.14.27], dsn=5.7.1, stat=User unknown
My web server can see the MX record for sub.domain.edu:
Code:
# dig -t mx sub.domain.edu

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_5.3 <<>> -t mx sub.domain.edu
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44489
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2

;; QUESTION SECTION:
;sub.domain.edu.             IN      MX

;; ANSWER SECTION:
sub.domain.edu.      3600    IN      MX      0 1198448495.mail.outlook.com.

;; ADDITIONAL SECTION:
1198448495.mail.outlook.com. 300 IN     A       65.54.188.78
1198448495.mail.outlook.com. 300 IN     A       65.54.188.109
One last thing:
Code:
# echo '3,0 student@sub.domain.edu' | sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> canonify           input: student @ sub . domain . edu
Canonify2          input: student < @ sub . domain . edu >
Canonify2        returns: student < @ sub . domain . edu . >
canonify         returns: student < @ sub . domain . edu . >
parse              input: student < @ sub . domain . edu . >
Parse0             input: student < @ sub . domain . edu . >
Parse0           returns: student < @ sub . domain . edu . >
ParseLocal         input: student < @ sub . domain . edu . >
ParseLocal       returns: student < @ sub . domain . edu . >
Parse1             input: student < @ sub . domain . edu . >
Mailertable        input: < sub . domain . edu > student < @ sub . domain . edu . >
Mailertable        input: sub . < domain . edu > student < @ sub . domain . edu . >
Mailertable        input: sub . glenville . < edu > student < @ sub . domain . edu . >
Mailertable      returns: student < @ sub . domain . edu . >
Mailertable      returns: student < @ sub . domain . edu . >
Mailertable      returns: student < @ sub . domain . edu . >
MailerToTriple     input: < smartrelay . domain . edu > student < @ sub . domain . edu . >
MailerToTriple   returns: $# relay $@ smartrelay . domain . edu $: student < @ sub . glenville . edu . >
Parse1           returns: $# relay $@ smartrelay . domain . edu $: student < @ sub . glenville . edu . >
parse            returns: $# relay $@ smartrelay . domain . edu $: student < @ sub . glenville . edu . >
Why is sendmail ignoring MX records and sending all mail to the smart relay host? How can I troubleshoot this?
 
Old 03-03-2011, 11:18 AM   #2
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

you should check the following:

Does a smart relay configuration allow relay to other domains/hosts without using smart relay? How should you sendmail know for which hosts to use smart relay and for which not?
 
Old 03-03-2011, 11:24 AM   #3
lrtward
Member
 
Registered: Feb 2011
Distribution: CentOS, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 9
Hmm... maybe I have a huge misconception then. I thought that sendmail only used the smart relay IF it could not directly route the message itself.

I will test this out. Thanks for the idea.
 
Old 03-03-2011, 11:28 AM   #4
lrtward
Member
 
Registered: Feb 2011
Distribution: CentOS, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 9
Boy, do I feel dumb! Yes that's what's happening.

I removed the smart relay entry and now my emails go directly to the destination host... where the connection is promptly refused

But I know why that is. This is a new test server, no external IP, no PTR records, not visible at all to the outside world. I'd refuse me, too, come to think of it. That I can work on.

Thanks for pointing out the embarrassingly obvious; much appreciated!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SENDMAIL]relay only to auth users if FROM: user@mydom and no relay for staff@mydom damien235 Linux - Server 0 02-23-2011 09:35 AM
Sendmail ignoring NIS aliases flgal3 Linux - Enterprise 3 01-08-2010 09:04 AM
Dedicated Server ignoring MX records for internal mail davecox Linux - Server 7 06-25-2009 11:49 AM
Sendmail recently ignoring Access.db jd6strings Linux - Server 1 08-16-2006 08:45 PM
relay mail to sendmail relay server??? lemay_jeff Linux - Newbie 0 07-06-2004 05:54 PM


All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration