• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1604
  • Last Modified:

Linux sendmail always going localhost?

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
dough1518
Asked:
dough1518
  • 5
  • 5
1 Solution
 
fosiul01Commented:
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
 
dough1518Author Commented:
all im trying to do is send mail out.

this is so a script can send a message via the mail command.
0
 
fosiul01Commented:
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
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
dough1518Author Commented:
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
 
fosiul01Commented:
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
 
dough1518Author Commented:
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
 
fosiul01Commented:
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
 
dough1518Author Commented:
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
 
dough1518Author Commented:
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
 
fosiul01Commented:
Hi sorry due to night didnot able to reply

whats in your /etc/hosts file

and what is your mx record??
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now