LinuxQuestions.org
Review your favorite Linux distribution.
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-26-2010, 04:16 AM   #1
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Rep: Reputation: 0
smtp problem in sendmail


Hi everyone,

I tried to use "mail" command to send email. It does not work(I've not received any email.
I checked if the sendmail is working, I typed ps -aux | grep sendmail

root 835 0.0 0.7 5004 1836 ? S Mar25 0:00 sendmail: accepti

Also, I can't restart sendmail, it's freezing...(see below)

[root@pe-web init.d]# sendmail restart
restart... User unknown

Also, I tried this
[root@pe-web /root]# telnet localhost 25
Trying 127.0.0.1...
Connected to pe-we....


Please help.....
 
Old 03-26-2010, 04:30 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,885

Rep: Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608
Quote:
Also, I can't restart sendmail, it's freezing...(see below)

[root@pe-web init.d]# sendmail restart
restart... User unknown
If you want to restart sendmail you have to run:
Code:
service sendmail restart
or
Code:
/etc/init.d/sendmail restart
depending on distro
You have to check the logs (/var/log/maillog) to see what happens to your emails

Regards
 
Old 03-26-2010, 04:32 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by linuxcoo View Post
Hi everyone,

I tried to use "mail" command to send email. It does not work(I've not received any email.
I checked if the sendmail is working, I typed ps -aux | grep sendmail

root 835 0.0 0.7 5004 1836 ? S Mar25 0:00 sendmail: accepti

Also, I can't restart sendmail, it's freezing...(see below)

[root@pe-web init.d]# sendmail restart
restart... User unknown

Also, I tried this
[root@pe-web /root]# telnet localhost 25
Trying 127.0.0.1...
Connected to pe-we....


Please help.....
debug like this.


first

Code:
tail -f /var/log/maillog | grep user@host &
then

Code:
mail -v user@host
this should throw up something in the maillog. paste here.
it doesnt look like you have any need to restart sendmail right now. it is running fine...but in case you do want to, the command is

Code:
service sendmail restart
 
Old 03-26-2010, 04:55 AM   #4
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by centosboy View Post
debug like this.


first

Code:
tail -f /var/log/maillog | grep user@host &
then

Code:
mail -v user@host
this should throw up something in the maillog. paste here.
it doesnt look like you have any need to restart sendmail right now. it is running fine...but in case you do want to, the command is

Code:
service sendmail restart
Thank you...I can restart sendmail by using service restart sendmail

Here is the log...Thank you so much...

Mar 21 05:00:01 pe-web sendmail[29834]: o2KL01g29834: from=root, size=327, class=0, nrcpts=1, msgid=<201003202100.o2KL01g29834@pe-web.org>, relay=root@localhost
Mar 21 05:00:01 pe-web sendmail[29834]: o2KL01g29834: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 22 05:00:00 pe-web sendmail[7234]: o2LL00d07234: from=root, size=327, class=0, nrcpts=1, msgid=<201003212100.o2LL00d07234@pe-web.org>, relay=root@localhost
Mar 22 05:00:00 pe-web sendmail[7234]: o2LL00d07234: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 23 05:00:00 pe-web sendmail[675]: o2ML00D00675: from=root, size=327, class=0, nrcpts=1, msgid=<201003222100.o2ML00D00675@pe-web.org>, relay=root@localhost
Mar 23 05:00:00 pe-web sendmail[675]: o2ML00D00675: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 24 05:00:01 pe-web sendmail[30858]: o2NL00H30858: from=root, size=327, class=0, nrcpts=1, msgid=<201003232100.o2NL00H30858@pe-web.org>, relay=root@localhost
Mar 24 05:00:01 pe-web sendmail[30858]: o2NL00H30858: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 24 15:21:58 pe-web sendmail[7419]: o2O7LwN07419: from=nobody, size=370, class=0, nrcpts=1, msgid=<201003240721.o2O7LwN07419@pe-web.org>, relay=nobody@localhost
Mar 24 15:22:03 pe-web sendmail[7421]: o2O7LwN07419: to=test <123@yahoo.com>, ctladdr=nobody (99/99), delay=00:00:05, xdelay=00:00:05, mailer=esmtp, pri=30370, relay=c.mx.mail.yahoo.com. [206.190.54.127], dsn=5.0.0, stat=Service unavailable
Mar 24 15:22:03 pe-web sendmail[7421]: o2O7LwN07419: o2O7M3M07421: DSN: Service unavailable
Mar 24 15:22:03 pe-web sendmail[7421]: o2O7M3M07421: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30470, dsn=2.0.0, stat=Sent
Mar 25 05:00:00 pe-web sendmail[16003]: o2OL00O16003: from=root, size=327, class=0, nrcpts=1, msgid=<201003242100.o2OL00O16003@pe-web.org>, relay=root@localhost
Mar 25 05:00:00 pe-web sendmail[16003]: o2OL00O16003: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 25 10:00:49 pe-web sendmail[825]: alias database /etc/aliases rebuilt by root
Mar 25 10:00:49 pe-web sendmail[825]: /etc/aliases: 40 aliases, longest 10 bytes, 395 bytes total
Mar 25 10:00:49 pe-web sendmail[835]: starting daemon (8.11.2): SMTP+queueing@01:00:00
 
Old 03-28-2010, 05:59 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
It looks like yahoo are not accepting mail from your server. CAn you try a test to another email address? Hotmail or Google? It might be a good idea to configure your mail server so that the from email address is routeable. A lot of mail servers would reject email if this is not the case. Somebody@localhost is not a valid email address.

Last edited by centosboy; 03-28-2010 at 06:05 AM.
 
Old 03-28-2010, 07:01 AM   #6
barshani
LQ Newbie
 
Registered: Sep 2004
Location: Trivandrum
Distribution: Redhat
Posts: 18

Rep: Reputation: 3
1. check. is it possible to send mail locally by

# mail -v user@loaclhost

2. then check the log /var/log/maillog for delivery success or not.

3. If it is ok. then u need to check with /etc/hosts, /etc/hosts.allow, hosts.deny
 
Old 03-28-2010, 09:33 PM   #7
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by barshani View Post
1. check. is it possible to send mail locally by

# mail -v user@loaclhost

2. then check the log /var/log/maillog for delivery success or not.

3. If it is ok. then u need to check with /etc/hosts, /etc/hosts.allow, hosts.deny
After I enter subject: testing....it has no response....
please help

[root@pe-web /root]# mail -v smmsp@localhost
Subject: testing
 
Old 03-28-2010, 09:49 PM   #8
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by barshani View Post
1. check. is it possible to send mail locally by

# mail -v user@loaclhost

2. then check the log /var/log/maillog for delivery success or not.

3. If it is ok. then u need to check with /etc/hosts, /etc/hosts.allow, hosts.deny
here is the maillog info. after I tried the above command. Thank you Please help...

Mar 28 05:00:00 pe-web sendmail[24512]: o2RL00424512: from=root, size=327, class=0, nrcpts=1, msgid=<201003272100.o2RL00424512@pe-web.org>, relay=root@localhost
Mar 28 05:00:00 pe-web sendmail[24512]: o2RL00424512: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 29 05:00:00 pe-web sendmail[6198]: o2SL00V06198: from=root, size=327, class=0, nrcpts=1, msgid=<201003282100.o2SL00V06198@pe-web.org>, relay=root@localhost
Mar 29 05:00:00 pe-web sendmail[6198]: o2SL00V06198: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
 
Old 03-28-2010, 10:42 PM   #9
brian2009
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 1
Can you post the output of:

#chkconfig --list | grep sendmail

and

#service sendmail status

Thank you
 
Old 03-29-2010, 05:18 AM   #10
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
NOt sure what Brian or barshani are trying to say, but your sendmail is up and running fine. Your mail server must answer with a proper dns name for a start. You can add this in /etc/hosts. Must be resolvable in dns
 
Old 03-29-2010, 08:18 AM   #11
barshani
LQ Newbie
 
Registered: Sep 2004
Location: Trivandrum
Distribution: Redhat
Posts: 18

Rep: Reputation: 3
mail -v user@localhost
Subject: test --> (Press Enter)
. --> (Press .)
Cc: --> (Press Enter)
Null message body; hope that's ok
 
Old 03-30-2010, 02:22 AM   #12
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Original Poster
Rep: Reputation: 0
I found anohter post which is similar as my case. Finally, he made a port redirection from 25 to 26 and worked. Therefore, I did the same thing yesterday.

iptables -A INPUT -p tcp --dport 26 -j ACCEPT
iptables -A PREROUTING -t nat -p tcp --dport 26 -j REDIRECT --to-port 25

After I applied the iptables, it still doesn't work for me. Here is my maillog.Please help...Thank you

Mar 28 05:00:00 pe-web sendmail[24512]: o2RL00424512: from=root, size=327, class=0, nrcpts=1, msgid=<201003272100.o2RL00424512@pe-web.org>, relay=root@localhost
Mar 28 05:00:00 pe-web sendmail[24512]: o2RL00424512: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 29 05:00:00 pe-web sendmail[6198]: o2SL00V06198: from=root, size=327, class=0, nrcpts=1, msgid=<201003282100.o2SL00V06198@pe-web.org>, relay=root@localhost
Mar 29 05:00:00 pe-web sendmail[6198]: o2SL00V06198: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
Mar 29 10:32:05 pe-web sendmail[10887]: o2T2W5w10887: ruleset=check_relay, arg1=pe-web.org, arg2=127.0.0.1, relay=pe-web.org [127.0.0.1], reject=550 5.7.1 Access denied
Mar 29 11:32:05 pe-web sendmail[10887]: o2T2W5w10887: timeout waiting for input from pe-web.org during server cmd read
Mar 29 11:32:05 pe-web sendmail[10887]: NOQUEUE: pe-web.org [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar 29 14:37:06 pe-web sendmail[689]: alias database /etc/aliases rebuilt by root
Mar 29 14:37:06 pe-web sendmail[689]: /etc/aliases: 40 aliases, longest 10 bytes, 395 bytes total
Mar 29 14:37:06 pe-web sendmail[699]: starting daemon (8.11.2): SMTP+queueing@01:00:00
Mar 29 14:45:10 pe-web sendmail[1021]: o2T6jAw01021: from=nobody, size=343, class=0, nrcpts=1, msgid=<201003290645.o2T6jAw01021@pe-web.org>, relay=nobody@localhost
Mar 29 14:45:11 pe-web sendmail[1023]: o2T6jAw01021: to=peweb@cuhk.edu.hk, ctladdr=nobody (99/99), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=30343, relay=cwemgw2.itsc.cuhk.edu.hk. [137.xxx.xxx.29], dsn=2.0.0, stat=Sent (ok: Message 145665710 accepted)
Mar 29 15:02:29 pe-web sendmail[1281]: o2T72TJ01281: from=root, size=49, class=0, nrcpts=1, msgid=<201003290702.o2T72TJ01281@pe-web.org>, relay=root@localhost
Mar 29 15:02:29 pe-web sendmail[1283]: o2T72TJ01281: to=cchance@cuhk.edu.hk, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30049, relay=cwemgw2.itsc.cuhk.edu.hk. [137.xxx.xxx.29], dsn=2.0.0, stat=Sent (ok: Message 145667296 accepted)
Mar 29 23:19:29 pe-web sendmail[11433]: o2TFJTh11433: from=nobody, size=371, class=0, nrcpts=1, msgid=<201003291519.o2TFJTh11433@pe-web.org>, relay=nobody@localhost
Mar 29 23:19:30 pe-web sendmail[11435]: o2TFJTh11433: to=moon <pemoon-2005@163.com>, ctladdr=nobody (99/99), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=30371, relay=mxnew-a.163.com. [220.xxx.xxx.43], dsn=2.0.0, stat=Sent (Mail OK queued as mx3,NcCowKD7j9TUw7BLZFloAQ--.852S2 1269875669)
Mar 30 05:00:01 pe-web sendmail[15635]: o2TL00R15635: from=root, size=327, class=0, nrcpts=1, msgid=<201003292100.o2TL00R15635@pe-web.org>, relay=root@localhost
Mar 30 05:00:01 pe-web sendmail[15635]: o2TL00R15635: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=local, pri=30327, dsn=2.0.0, stat=Sent
 
Old 03-30-2010, 02:32 AM   #13
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by brian2009 View Post
Can you post the output of:

#chkconfig --list | grep sendmail

and

#service sendmail status

Thank you

[root@pe-web /root]# chkconfig --list | grep sendmail
sendmail 0ff 1ff 2-5n 6ff
 
Old 03-30-2010, 02:34 AM   #14
linuxcoo
LQ Newbie
 
Registered: Mar 2010
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by brian2009 View Post
Can you post the output of:

#chkconfig --list | grep sendmail

and

#service sendmail status

Thank you

[root@pe-web /root]# service sendmail status
sendmail (pid 699) is running...

Thank you
 
Old 03-31-2010, 06:04 AM   #15
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by linuxcoo View Post
[root@pe-web /root]# service sendmail status
sendmail (pid 699) is running...

Thank you
i would reverse the firewall change you made. why did you make that?>>
Your mailserver appears to be working correctly.
All i can see is that some mail servers will not allow you to send mail to them because of RFC 821/822 (mailserver configuration).
thats all.
IF you are still having problems, you may have to pm me as this seems to be going a bit off track..

Last edited by centosboy; 03-31-2010 at 06:06 AM.
 
  


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
[SOLVED] Problem with SMTP AUTH in Sendmail mail4vijay Linux - General 1 01-18-2010 12:22 AM
SMTP problem with sendmail veyron Linux - Server 2 07-12-2009 08:29 AM
Sendmail SMTP Client problem when no Internet. vedang Linux - Enterprise 0 02-27-2007 12:46 AM
sendmail smtp problem nithin_bhaskar Linux - Networking 1 07-10-2004 07:07 AM
Sendmail smtp problem fuelinjection Linux - General 4 07-06-2004 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:55 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