?
Solved

Linux sendmail always going localhost?

Posted on 2009-02-13
10
Medium Priority
?
1,582 Views
Last Modified: 2013-12-17
Im running fedora 10.   Dns works fine, but when i run :

i can telnet out of port 25 to any smtp server..so its not a port 25 issue

echo hello |sendmail -v bob@cox.net

or
mail -vv bob@cox.net

THer mail never gets delivered and here is what i get (its as if it trys my own email server, instead of going out to finding cox's).




[root@localhost config]# echo hello |sendmail -v bob@cox.net
bob@cox.net... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.14.3/8.14.3; Fri, 13 Feb 2009 13:25:52 -0600
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=6 AUTH=root@localhost.localdomain
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<bob@cox.net>
>>> DATA
250 2.1.5 <bob@cox.net>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 n1DJPqwp005392 Message accepted for delivery
bob@cox.net... Sent (n1DJPqwp005392 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection

Open in new window

0
Comment
Question by:dough1518
  • 5
  • 5
10 Comments
 
LVL 29

Expert Comment

by:fosiul01
ID: 23636373
HI,
you can tel me dumb but i realy didnot understand whats the problem ??

are you unable to sent email outside  or email is not entering to your server ??
0
 

Author Comment

by:dough1518
ID: 23636380
all im trying to do is send mail out.

this is so a script can send a message via the mail command.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 23636436
1. bob@cox.net is this your server email address or it outside email address ??

check whats log you see in

/var/log/maillog


after sending any email
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dough1518
ID: 23636470
maillog is blank.  

IM ONLY TRYING TO SEND MAIL OUT.

bob@cox.net is who im trying to send mail to.  

my php script uses mail to send the contents of a form out.  that is it
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 23636593
Hi No need to shout!!!

here i am just trying to help you thats all

First of all "maillog is blank " which should not be

The ouput you sent, its looks good, from the output its showing that email is going out

but why your maillog is empty ??

can i see your sendmail configuration file ?
0
 

Author Comment

by:dough1518
ID: 23636642
it keeps trying to route cox.net or ANY DOMAIN into localhost    these logs should be showing something from cox.net right?
xdelay=00:00:01, mailer=relay, pri=38434, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n17621j1003852 Message accepted for delivery)
Feb  7 00:02:02 localhost sendmail[3853]: n17621j1003852: to=<root@localhost.localdomain>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=local, pri=38939, dsn=2.0.0, stat=Sent
Feb  7 04:02:16 localhost sendmail[4874]: n17A2CUO004874: from=root, size=6432, class=0, nrcpts=1, msgid=<200902071002.n17A2CUO004874@localhost.localdomain>, relay=root@localhost
Feb  7 04:02:16 localhost sendmail[5172]: n17A2GZE005172: from=<root@localhost.localdomain>, size=6710, class=0, nrcpts=1, msgid=<200902071002.n17A2CUO004874@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb  7 04:02:16 localhost sendmail[4874]: n17A2CUO004874: to=root, ctladdr=root (0/0), delay=00:00:04, xdelay=00:00:00, mailer=relay, pri=36432, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n17A2GZE005172 Message accepted for delivery)
Feb  7 04:02:16 localhost sendmail[5173]: n17A2GZE005172: to=<root@localhost.localdomain>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=36943, dsn=2.0.0, stat=Sent
Feb  7 20:45:25 localhost sendmail[2193]: alias database /etc/aliases rebuilt by root
Feb  7 20:45:25 localhost sendmail[2193]: /etc/aliases: 76 aliases, longest 10 bytes, 765 bytes total
Feb  7 20:45:25 localhost sendmail[2198]: starting daemon (8.14.3): SMTP+queueing@01:00:00
Feb  7 20:45:25 localhost sm-msp-queue[2206]: starting daemon (8.14.3): queueing@01:00:00
Feb  7 20:49:38 localhost sendmail[2205]: alias database /etc/aliases rebuilt by root
Feb  7 20:49:38 localhost sendmail[2205]: /etc/aliases: 76 aliases, longest 10 bytes, 765 bytes total
Feb  7 20:49:38 localhost sendmail[2210]: starting daemon (8.14.3): SMTP+queueing@01:00:00
Feb  7 20:49:38 localhost sm-msp-queue[2218]: starting daemon (8.14.3): queueing@01:00:00
Feb  7 22:03:21 localhost sendmail[3167]: n1843HVT003167: from=root, size=6432, class=0, nrcpts=1, msgid=<200902080403.n1843HVT003167@localhost.localdomain>, relay=root@localhost
Feb  7 22:03:21 localhost sendmail[3465]: n1843LNR003465: from=<root@localhost.localdomain>, size=6710, class=0, nrcpts=1, msgid=<200902080403.n1843HVT003167@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb  7 22:03:21 localhost sendmail[3167]: n1843HVT003167: to=root, ctladdr=root (0/0), delay=00:00:04, xdelay=00:00:00, mailer=relay, pri=36432, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n1843LNR003465 Message accepted for delivery)
Feb  7 22:03:21 localhost sendmail[3466]: n1843LNR003465: to=<root@localhost.localdomain>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=36943, dsn=2.0.0, stat=Sent
Feb  8 00:02:02 localhost sendmail[4277]: n18621tw004277: from=root, size=8434, class=0, nrcpts=1, msgid=<200902080602.n18621tw004277@localhost.localdomain>, relay=root@localhost
Feb  8 00:02:02 localhost sendmail[4279]: n18622Xt004279: from=<root@localhost.localdomain>, size=8711, class=0, nrcpts=1, msgid=<200902080602.n18621tw004277@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb  8 00:02:02 localhost sendmail[4277]: n18621tw004277: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=38434, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n18622Xt004279 Message accepted for delivery)
Feb  8 00:02:02 localhost sendmail[4280]: n18622Xt004279: to=<root@localhost.localdomain>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=38939, dsn=2.0.0, stat=Sent
Feb  8 04:02:15 localhost sendmail[5528]: n18A2Cao005528: from=root, size=3738, class=0, nrcpts=1, msgid=<200902081002.n18A2Cao005528@localhost.localdomain>, relay=root@localhost
Feb  8 04:02:15 localhost sendmail[5822]: n18A2FEK005822: from=<root@localhost.localdomain>, size=4016, class=0, nrcpts=1, msgid=<200902081002.n18A2Cao005528@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb  8 04:02:15 localhost sendmail[5528]: n18A2Cao005528: to=root, ctladdr=root (0/0), delay=00:00:03, xdelay=00:00:00, mailer=relay, pri=33738, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n18A2FEK005822 Message accepted for delivery)
Feb  8 04:02:15 localhost sendmail[5823]: n18A2FEK005822: to=<root@localhost.localdomain>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=34249, dsn=2.0.0, stat=Sent

Open in new window

0
 
LVL 29

Accepted Solution

by:
fosiul01 earned 2000 total points
ID: 23636769
Ok all the log you sent all its trying to sent email to localhost.

but i want to see log when its showing email outside


Open 2 window, in one windows execute this command

tail -f /var/log/maillog   : this command will show realtime log

and from another window, execute this command

cat /etc/hosts | mail -s "test" bob@cox.net   : its sent /etc/hosts file to your bob@cox.net

now you will have to show me the log for sending email to bob@cox.net

does it make sense  ??

0
 

Author Comment

by:dough1518
ID: 23638887
ok thanks,  any ideas now?

Feb 13 20:19:48 localhost sendmail[11991]: n1E2JkIl011991: to=bob@cox.net, ctladdr=admin (500/500), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30004, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n1E2JmRi011992 Message accepted for delivery)

Open in new window

0
 

Author Comment

by:dough1518
ID: 23639017
figured out the issue is due to:

ctladdr=<admin@localhost.localdomain>

all my email servers are rejecting the test emails due to that.

how do i change that?

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 23639851
Hi sorry due to night didnot able to reply

whats in your /etc/hosts file

and what is your mx record??
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question