LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-20-2009, 02:05 PM   #1
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Rep: Reputation: 0
[Sendmail] Email Bounce. (żBad Hostname?)


Hi.
Im running Sendmail under a CentOS 5.2 (Final).
The machine has the hostname: MyMachineHostname.com.mx
However the domain name is not registered.

All the EMails (Logwatchs, Crons, etc) were working fine till some days ago.
I dont know what could change but now to my Email is arriving a Bounce.
I've checked the server and try to send an EMail with:
# echo testing | mail -s "This is just a test" root
However, # mailq is showing:
8 Thu Aug 20 12:27 <root@MyMachineHostname.com.mx>
(Deferred: Connection refused by MyMachineHostname.com.mx.com.mx.)<root@MyMachineHostname.com.mx>

(See that is showing .com.mx.com.mx, not .com.mx).
Flushing the queue...
# sendmail -v -d8.20 -q
dns_getcanonname(MyMachineHostname.com.mx, trymx=1)
dns_getcanonname: trying MyMachineHostname.com.mx. (AAAA)
NO: errno=0, h_errno=1
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx (AAAA)
NO: errno=0, h_errno=4
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx (A)
YES
dns_getcanonname: MyMachineHostname.com.mx.com.mx
getmxrr(MyMachineHostname.com.mx.com.mx., droplocalhost=1)
getmxrr: res_search(MyMachineHostname.com.mx.com.mx.) failed (errno=0, h_errno=4)
dns_getcanonname(MyMachineHostname.com.mx.com.mx., trymx=0)
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx. (AAAA)
NO: errno=0, h_errno=4
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx. (A)
YES
dns_getcanonname: MyMachineHostname.com.mx.com.mx
<root@MyMachineHostname.com.mx>... Connecting to MyMachineHostname.com.mx.com.mx. via esmtp...
<root@MyMachineHostname.com.mx>... Deferred: Connection refused by MyMachineHostname.com.mx.com.mx.



I cant find where the problem is...
# hostname
crossmediabby.com.mx
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=MyMachineHostname.com.mx

Any ideas?

Thanks in advance.
Bye.

PD: Sorry for my poor English.
 
Old 08-20-2009, 02:58 PM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by IPAddress View Post
Hi.
Im running Sendmail under a CentOS 5.2 (Final).
The machine has the hostname: MyMachineHostname.com.mx
However the domain name is not registered.

All the EMails (Logwatchs, Crons, etc) were working fine till some days ago.
I dont know what could change but now to my Email is arriving a Bounce.
I've checked the server and try to send an EMail with:
# echo testing | mail -s "This is just a test" root
However, # mailq is showing:
8 Thu Aug 20 12:27 <root@MyMachineHostname.com.mx>
(Deferred: Connection refused by MyMachineHostname.com.mx.com.mx.)<root@MyMachineHostname.com.mx>

(See that is showing .com.mx.com.mx, not .com.mx).
Flushing the queue...
# sendmail -v -d8.20 -q
dns_getcanonname(MyMachineHostname.com.mx, trymx=1)
dns_getcanonname: trying MyMachineHostname.com.mx. (AAAA)
NO: errno=0, h_errno=1
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx (AAAA)
NO: errno=0, h_errno=4
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx (A)
YES
dns_getcanonname: MyMachineHostname.com.mx.com.mx
getmxrr(MyMachineHostname.com.mx.com.mx., droplocalhost=1)
getmxrr: res_search(MyMachineHostname.com.mx.com.mx.) failed (errno=0, h_errno=4)
dns_getcanonname(MyMachineHostname.com.mx.com.mx., trymx=0)
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx. (AAAA)
NO: errno=0, h_errno=4
dns_getcanonname: trying MyMachineHostname.com.mx.com.mx. (A)
YES
dns_getcanonname: MyMachineHostname.com.mx.com.mx
<root@MyMachineHostname.com.mx>... Connecting to MyMachineHostname.com.mx.com.mx. via esmtp...
<root@MyMachineHostname.com.mx>... Deferred: Connection refused by MyMachineHostname.com.mx.com.mx.



I cant find where the problem is...
# hostname
crossmediabby.com.mx
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=MyMachineHostname.com.mx

Any ideas?

Thanks in advance.
Bye.

PD: Sorry for my poor English.
looks like dns error.

paste output of

Code:
dig mx MyMachineHostname.com.mx

here

Last edited by centosboy; 08-20-2009 at 02:58 PM. Reason: spellcheck
 
Old 08-24-2009, 08:05 AM   #3
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Hi.
The thing is that it cant be a DNS error. Its pointless to put the output of the command "dig mx MyMachineHostname.com.mx", cause like i said before, the domain "MyMachineHostname.com.mx" its not mine. My hostnames machine is "MyMachineHostname.com.mx".

I think the problem could be at some sendmail configuration.
Running command: # echo testing | mail -s "This is just a test" root

# tail -f /var/log/maillog
--------------------------------------------------------------------
MyMachineHostname sendmail[6579]: n7OD51X0006579: from=root, size=367, class=0, nrcpts=1, msgid=<200908241305.n7OD51X0006579@MyMachineHostname.com.mx>, relay=root@localhost
MyMachineHostname sendmail[6580]: n7OD51MQ006580: from=<root@MyMachineHostname.com.mx>, size=642, class=0, nrcpts=1, msgid=<200908241305.n7OD51X0006579@MyMachineHostname.com.mx>, proto=ESMTP, daemon=MTA, relay=MyMachineHostname.com.mx [127.0.0.1]
MyMachineHostname sendmail[6579]: n7OD51X0006579: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30367, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n7OD51MQ006580 Message accepted for delivery)
MyMachineHostname sendmail[6582]: n7OD51MQ006580: to=<root@MyMachineHostname.com.mx>, delay=00:00:02, xdelay=00:00:01, mailer=esmtp, pri=120642, relay=MyMachineHostname.com.mx.com.mx. [64.40.103.249], dsn=4.0.0, stat=Deferred: Connection refused by MyMachineHostname.com.mx.com.mx.
--------------------------------------------------------------------

As you can see in the last line of the log, for some reason its changing from "MyMachineHostname.com.mx" to "MyMachineHostname.com.mx.com.mx". Any ideas why this could be happening?

Thanks for your help!

Bye.
 
Old 08-24-2009, 02:32 PM   #4
s-tanner
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 3
Looks like its trying to relay your mail to MyMachineHostname.com.mx.com.mx. Do you have a Smart Host (DS) configured in Sendmail?
 
Old 08-25-2009, 02:40 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by IPAddress View Post
Hi.
The thing is that it cant be a DNS error. Its pointless to put the output of the command "dig mx MyMachineHostname.com.mx", cause like i said before, the domain "MyMachineHostname.com.mx" its not mine. My hostnames machine is "MyMachineHostname.com.mx".

I think the problem could be at some sendmail configuration.
Running command: # echo testing | mail -s "This is just a test" root

# tail -f /var/log/maillog
--------------------------------------------------------------------
MyMachineHostname sendmail[6579]: n7OD51X0006579: from=root, size=367, class=0, nrcpts=1, msgid=<200908241305.n7OD51X0006579@MyMachineHostname.com.mx>, relay=root@localhost
MyMachineHostname sendmail[6580]: n7OD51MQ006580: from=<root@MyMachineHostname.com.mx>, size=642, class=0, nrcpts=1, msgid=<200908241305.n7OD51X0006579@MyMachineHostname.com.mx>, proto=ESMTP, daemon=MTA, relay=MyMachineHostname.com.mx [127.0.0.1]
MyMachineHostname sendmail[6579]: n7OD51X0006579: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30367, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n7OD51MQ006580 Message accepted for delivery)
MyMachineHostname sendmail[6582]: n7OD51MQ006580: to=<root@MyMachineHostname.com.mx>, delay=00:00:02, xdelay=00:00:01, mailer=esmtp, pri=120642, relay=MyMachineHostname.com.mx.com.mx. [64.40.103.249], dsn=4.0.0, stat=Deferred: Connection refused by MyMachineHostname.com.mx.com.mx.
--------------------------------------------------------------------

As you can see in the last line of the log, for some reason its changing from "MyMachineHostname.com.mx" to "MyMachineHostname.com.mx.com.mx". Any ideas why this could be happening?

Thanks for your help!

Bye.

the only time i have ever seen this is with incorrect dns entries missing the full stop "." at the end of a record.
Still paste the output of dig mx machinename.mx.com as it will give me a clearer view of the picture
 
Old 08-25-2009, 06:47 AM   #6
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by s-tanner View Post
Looks like its trying to relay your mail to MyMachineHostname.com.mx.com.mx. Do you have a Smart Host (DS) configured in Sendmail?
No, i dont.

Quote:
Originally Posted by centosboy View Post
the only time i have ever seen this is with incorrect dns entries missing the full stop "." at the end of a record.
Still paste the output of dig mx machinename.mx.com as it will give me a clearer view of the picture
# dig mx MyMachineHostname.com.mx
--------------------------------------------------
;; QUESTION SECTION:
;MyMachineHostname.com.mx. IN MX

;; AUTHORITY SECTION:
com.mx. 1778 IN SOA m.mx-ns.mx. hostmaster.nic.mx. 75375 3600 900 604800 1800
--------------------------------------------------

# cat /etc/hosts
--------------------------------------------------
127.0.0.1 MyMachineHostname.com.mx localhost.localdomain localhost
www.xxx.yyy.zzz MyMachineHostname.com.mx
aaa.bbb.ccc.ddd MyMachineHostname.com.mx
::1 localhost6.localdomain6 localhost6
--------------------------------------------------
(www.xxx.yyy.zzz = My Server Private IP)
(aaa.bbb.ccc.ddd = My Server Public IP)



Any ideas where could be the problem?
Im really confused with this.



More Info: Sendmail is having some troubles by resolving the addresses...
# /usr/sbin/sendmail -bv -v -oL98 root@MyMachineHostname.com.mx
--------------------------------------------------
root@MyMachineHostname.com.mx... deliverable: mailer esmtp, host MyMachineHostname.com.mx.com.mx., user root@MyMachineHostname.com.mx.com.mx
--------------------------------------------------

Last edited by IPAddress; 08-25-2009 at 07:09 AM.
 
Old 08-27-2009, 08:38 AM   #7
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Hi!
Sorry to bother again but im still having this problem.
Any ideas?

Thanks!
 
Old 08-28-2009, 12:21 AM   #8
s-tanner
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 3
What does your /etc/resolv.conf look like?
 
Old 08-28-2009, 02:52 AM   #9
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by IPAddress View Post
Hi!
Sorry to bother again but im still having this problem.
Any ideas?

Thanks!
run

Code:
nslookup -type=A mymachinename.com.mx

then

Code:
nslookup -type=A mymachinename.com.mx 4.2.2.2

do you get the same result?
 
Old 08-28-2009, 06:33 AM   #10
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Original Poster
Rep: Reputation: 0
# cat /etc/resolv.conf
--------------------------------------------------
nameserver 200.69.128.1
nameserver 4.2.2.2
nameserver 208.67.222.222
nameserver 208.67.220.220
--------------------------------------------------

# nslookup -type=A MyMachineHostname.com.mx
--------------------------------------------------
Server: 200.69.128.1
Address: 200.69.128.1#53
** server can't find MyMachineHostname.com.mx: NXDOMAIN
--------------------------------------------------


# nslookup -type=A MyMachineHostname.com.mx 4.2.2.2
--------------------------------------------------
Server: 4.2.2.2
Address: 4.2.2.2#53
** server can't find MyMachineHostname.com.mx: NXDOMAIN
--------------------------------------------------
 
Old 08-28-2009, 01:55 PM   #11
s-tanner
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 3
How about the output from these commands:

Code:
grep ^hosts /etc/nsswitch.conf
and this:

Code:
sendmail -bt
/mx MyMachineHostname.com.mx
/try esmtp root@MyMachineHostname.com.mx
/quit
And finally:

Code:
grep ^DS /etc/mail/sendmail.cf
 
Old 08-31-2009, 06:32 AM   #12
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by s-tanner View Post
How about the output from these commands:

Code:
grep ^hosts /etc/nsswitch.conf
and this:

Code:
sendmail -bt
/mx MyMachineHostname.com.mx
/try esmtp root@MyMachineHostname.com.mx
/quit
And finally:

Code:
grep ^DS /etc/mail/sendmail.cf

# grep ^hosts /etc/nsswitch.conf
Code:
 hosts:      files dns


# sendmail -bt
Code:
 ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> /mx MyMachineHostname.com.mx
getmxrr(MyMachineHostname.com.mx) returns 1 value(s):
        MyMachineHostname.com.mx.com.mx.
> /try esmtp root@MyMachineHostname.com.mx
Trying envelope recipient address root@MyMachineHostname.com.mx for mailer esmtp
canonify           input: root @ MyMachineHostname . com . mx
Canonify2          input: root < @ MyMachineHostname . com . mx >
Canonify2        returns: root < @ MyMachineHostname . com . mx . com . mx . >
canonify         returns: root < @ MyMachineHostname . com . mx . com . mx . >
2                  input: root < @ MyMachineHostname . com . mx . com . mx . >
2                returns: root < @ MyMachineHostname . com . mx . com . mx . >
EnvToSMTP          input: root < @ MyMachineHostname . com . mx . com . mx . >
PseudoToReal       input: root < @ MyMachineHostname . com . mx . com . mx . >
PseudoToReal     returns: root < @ MyMachineHostname . com . mx . com . mx . >
MasqSMTP           input: root < @ MyMachineHostname . com . mx . com . mx . >
MasqSMTP         returns: root < @ MyMachineHostname . com . mx . com . mx . >
EnvToSMTP        returns: root < @ MyMachineHostname . com . mx . com . mx . >
final              input: root < @ MyMachineHostname . com . mx . com . mx . >
final            returns: root @ MyMachineHostname . com . mx . com . mx
Rcode = 0, addr = root@MyMachineHostname.com.mx.com.mx
> /quit


# grep ^DS /etc/mail/sendmail.cf
Code:
 DS
 
Old 09-01-2009, 01:53 AM   #13
s-tanner
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 3
I've been doing some reading and it appears that DNS has top priority and the /etc/hosts file is only used if dns fails, regardless of the nsswitch.conf file (see this or this for more details)

I'm guessing that MyMachineHostname.com.mx worked in the past because no matching A or MX records existed. Now that one of the canonical names exists (MyMachineHostname.com.mx.com.mx), the dns_getcanonname succeeds and doesn't check the hosts files. Once again, this is only a guess.

If this is whats happening, there's a few ways to fix it:

Use ResolverOptions to disable the domain path search

Use sendmails mailertable to ignore dns lookups for a domain

Use virtusertable and use_cw_file to specify alternate domain names


Hope something here can help....
 
Old 09-01-2009, 09:18 AM   #14
IPAddress
LQ Newbie
 
Registered: Apr 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by s-tanner View Post
I've been doing some reading and it appears that DNS has top priority and the /etc/hosts file is only used if dns fails, regardless of the nsswitch.conf file (see this or this for more details)

I'm guessing that MyMachineHostname.com.mx worked in the past because no matching A or MX records existed. Now that one of the canonical names exists (MyMachineHostname.com.mx.com.mx), the dns_getcanonname succeeds and doesn't check the hosts files. Once again, this is only a guess.

If this is whats happening, there's a few ways to fix it:

Use ResolverOptions to disable the domain path search

Use sendmails mailertable to ignore dns lookups for a domain

Use virtusertable and use_cw_file to specify alternate domain names


Hope something here can help....
Exactly as you told me.
I follow these page: http://www.megalinux.net/sendmail-co...ard-dns-entry/

And now its working again!
Thanks for all your help.

Bye!
 
  


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
Vacation + Sendmail + Cyrus - Strange bounce error Sheridan Linux - Server 1 09-07-2010 03:28 PM
custom bounce message with Sendmail shinepuppy Linux - Server 2 07-26-2007 09:12 PM
Bounce back email with a message? tauras911 Linux - Newbie 3 02-10-2005 03:44 PM
Copies of bounce messages in sendmail ejacobs Linux - Software 0 06-29-2004 03:53 PM
Sendmail Bounce Development echid Programming 0 11-18-2003 02:35 PM


All times are GMT -5. The time now is 11:05 PM.

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