LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-17-2012, 06:27 PM   #1
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Rep: Reputation: 7
Thumbs down Sendmail ignoring Mailertable


Hi Friends,

I am running sendmail 8.14 on rhel6. I have 2 mail servers as serv1.home.com and test.home.com. Currently test.home.com is pointing as MX for home.com domain. So what I am trying to do is to route emails arriving at test.home.com server to serv1.home.com using mailertable. I have defined the Feature in sendmail.mc file and compiled the sendmail.cf accordingly, also created mailertable file and generated mailertable.db also. But the sendmail is ignoring the mailertabel and is delivering all the emails sent at @home.com locally to test.home.com using the MX lookup. Logs do not show any error message at all.

Code:
 #cat mailertable
home.com	esmtp:serv1.home.com
Code:
  sendmail.mc

include(/home/rohit/sendmail-8.14.5/cf/m4/cf.m4)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(`mailertable', `hash /etc/mail/mailertable')dnl
MAILER(local)dnl
MAILER(smtp)dnl

So what i could be missing, any help would be greatly appreciated.
 
Old 07-18-2012, 12:01 AM   #2
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 250

Rep: Reputation: 107Reputation: 107
Hi there,

I'm a little rusty on this, but think your problem may be the MX record. See http://www.sendmail.com/sm/open_sour...lertables.html, and try changing your mailertable file to this:
Code:
home.com	esmtp:[serv1.home.com]
I hope this helps :-)
 
Old 07-18-2012, 07:47 AM   #3
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by cliffordw View Post
Hi there,

I'm a little rusty on this, but think your problem may be the MX record. See http://www.sendmail.com/sm/open_sour...lertables.html, and try changing your mailertable file to this:
Code:
home.com	esmtp:[serv1.home.com]
I hope this helps :-)
Hmmm....but no its not working. I already tried this with giving the IP address in [] and even that also didn't worked. any other suggestion.
 
Old 07-18-2012, 09:18 AM   #4
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 250

Rep: Reputation: 107Reputation: 107
Hi again,

A few random thoughts....

If you haven't already done this, how about increasing the syslog level for mail to debug, and checking what the logs say? There may just be a clue in there?

Are you sure the "esmtp" mailer is correct - is it not called just "smtp"?

Are you sure that sendmail is ignoring the mailertable, or could the problem be elsewhere? One way to test this, is to change the mailertable to send the email elsewhere. You can do this either by sending the mail to the "error" mailer, or to a file via a local alias.

To use the "error" mailer, change your mailertable to the following & rehash it:
Code:
home.com	error:nohost Testing whether mailertable function is working
This will fail to deliver the mail, and log an error via syslog instead, with the above error message.

To redirect the mail to a local file, create an alias in /etc/aliases as follows, and run "newaliases":
Code:
testmail: /tmp/badmailfile
Then change your mailertable to this & rehash:
Code:
home.com	local:testmail
This should write the mail to the /tmp/badmailfile file.

Good luck!
 
Old 07-18-2012, 09:41 AM   #5
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
Using the square brackets is going to be important when it does work .

It's been a while since I troubleshot sendmail too: could it be that home.com is in the local-host-names? IIRC any domain listed in that file is treated as local mail, effectively ignoring mailertable. I found a link[1] that supports that theory at least.

Is that the entire sendmail config you posted? And forgive me for asking (as it wasn't explicitly stated) but I take it sendmail was restarted after adding the mailertable feature?

[1] http://www.sendmail.com/sm/open_sour...ple_names.html
 
Old 07-18-2012, 11:05 AM   #6
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by whizzit View Post
Using the square brackets is going to be important when it does work .

It's been a while since I troubleshot sendmail too: could it be that home.com is in the local-host-names? IIRC any domain listed in that file is treated as local mail, effectively ignoring mailertable. I found a link[1] that supports that theory at least.

Is that the entire sendmail config you posted? And forgive me for asking (as it wasn't explicitly stated) but I take it sendmail was restarted after adding the mailertable feature?

[1] http://www.sendmail.com/sm/open_sour...ple_names.html
Hi Whizzit,

yes i did started sendmail after adding mailertable feature. And yes home.com is listed in local-host-names file but i think it should be otherwise test.home.com will not accept mail for home.com domain even if it is listed as MX for home.com.
 
Old 07-18-2012, 11:07 AM   #7
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by cliffordw View Post
Hi again,

A few random thoughts....

If you haven't already done this, how about increasing the syslog level for mail to debug, and checking what the logs say? There may just be a clue in there?

Are you sure the "esmtp" mailer is correct - is it not called just "smtp"?

Are you sure that sendmail is ignoring the mailertable, or could the problem be elsewhere? One way to test this, is to change the mailertable to send the email elsewhere. You can do this either by sending the mail to the "error" mailer, or to a file via a local alias.

To use the "error" mailer, change your mailertable to the following & rehash it:
Code:
home.com	error:nohost Testing whether mailertable function is working
This will fail to deliver the mail, and log an error via syslog instead, with the above error message.

To redirect the mail to a local file, create an alias in /etc/aliases as follows, and run "newaliases":
Code:
testmail: /tmp/badmailfile
Then change your mailertable to this & rehash:
Code:
home.com	local:testmail
This should write the mail to the /tmp/badmailfile file.

Good luck!
Hi cliffordw,

yeah good catch. let me test this and would get back.
 
Old 07-18-2012, 12:04 PM   #8
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Original Poster
Rep: Reputation: 7
Hi cliffordw,

No it is not working, not even the error is being thrown. So i guess mailertable is being ignored..
 
Old 07-18-2012, 12:51 PM   #9
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
Quote:
Originally Posted by Rohit_4739 View Post
Hi Whizzit,

yes i did started sendmail after adding mailertable feature. And yes home.com is listed in local-host-names file but i think it should be otherwise test.home.com will not accept mail for home.com domain even if it is listed as MX for home.com.
I think that's where sendmail's docs can be a little misleading. I thought I learned that local-host-names indicates the domains that *that* host would accept directly - i.e. serve as an endpoint. Technically, test.home.com isn't "accepting" mail for that domain directly; it is intended to forward/relay it on to serv1.home.com. By this reasoning home.com would need to be in local-host-names on serv1.home.com but not test.home.com. I believe you might be missing out on a solution by not trying it.

Anyway, it's easy enough to test with sendmail -bt and then /parse.
 
Old 07-18-2012, 01:39 PM   #10
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by whizzit View Post
I think that's where sendmail's docs can be a little misleading. I thought I learned that local-host-names indicates the domains that *that* host would accept directly - i.e. serve as an endpoint. Technically, test.home.com isn't "accepting" mail for that domain directly; it is intended to forward/relay it on to serv1.home.com. By this reasoning home.com would need to be in local-host-names on serv1.home.com but not test.home.com. I believe you might be missing out on a solution by not trying it.

Anyway, it's easy enough to test with sendmail -bt and then /parse.
hi Whizzit,

I did tried it already before you specified but it didn't work. I agree with whatever you said and idealy thats how exactly it should be.
 
Old 07-19-2012, 08:27 AM   #11
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 224

Original Poster
Rep: Reputation: 7
hello guys,

This has been resolved, what i did was that i remove my domain home.com from local-host-names file, but i am not sure about this because i tried this number of times earlier also.

Anyways thanks a lot for your help and time. I appreciate that.
 
Old 04-30-2013, 11:59 AM   #12
CustomDesigned
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
sendmail-8.14 breaks/changes mailertable

This has bitten me on all the MTAs I've upgraded to 8.14. In the sendmail-8.14.0 release notes, there is the following innocuous seeming "fix":
Quote:
CONFIG: Fix some bugs with mailertables -- for example, if your host name was foo.bar.ray.com and you matched against ".ray.com", the old implementation bound %1 to "bar" instead of "foo.bar". Also, allow "." in the mailertable to match anything -- essentially, take over SMART_HOST. This also moves matching of explicit local host names before the mailertable so they don't have to be special cased in the mailertable data. Reported by Bill Gianopoulos
Note that the change "moves matching of explicit local host name *before* the mailertable". This is why mailertable is ignored for any domain that appears in local-host-names. At least, that is my analysis so far.
 
  


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 - Mailertable configuration orobledillo Linux - Server 1 05-08-2008 10:59 AM
sendmail mailertable nayabingi Linux - Networking 1 06-30-2006 09:09 AM
Sendmail and Mailertable lapthorn Linux - Software 0 02-24-2006 04:40 AM
Sendmail mailertable question connect2world Linux - Networking 1 12-26-2005 08:06 PM
sendmail mailertable RedHat123 Linux - Networking 5 04-09-2005 02:43 PM


All times are GMT -5. The time now is 04:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration