?
Solved

Sendmail - unable to receive email other than localhost

Posted on 2005-03-24
25
Medium Priority
?
292 Views
Last Modified: 2010-08-05
hello jlevie,

I've setup sendmail and cyrus as you suggested. however i realized the sending and receiving email from the host works, but i am unable to receive email from outside the host.
I've set hosts in /etc/mail/local-host-names.

Thanks,
Shashank
0
Comment
Question by:shashank3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 9
  • 5
25 Comments
 
LVL 14

Expert Comment

by:theruck
ID: 13626552
you did not type any errors so it is hard to advice something. i gues you have not set the relay correctly
0
 
LVL 2

Author Comment

by:shashank3
ID: 13627027
Where can i check the errors? please let me know.
0
 
LVL 20

Expert Comment

by:Gns
ID: 13629005
Do you have a firewall running on the server? Does it allow incoming port tcp/25?
You can probably test by
telnet <your IP address> 25
if this give a "Connection refused" type error, either sendmail isn't listening on that interface, or you have a local firewall blocking port 25.

-- Glenn
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 14

Expert Comment

by:theruck
ID: 13630011
errors from the mailclient or you can use telnet to test it
it would look like this:

telnet your.ip.com 25
helo x
mail from: your@mail.com
rcpt to: your.ailbox@mailserver.com
DATA
Subject: Test
test ok
.

probably after entering the mail from: command you will get some error
0
 
LVL 20

Expert Comment

by:Gns
ID: 13631655
Errors pertaining to sendmail would probably be in /var/log/sendmail (and you can always look at syslog and messages files too... Firewall type things would perhaps show there too).
How about it.... None of us are Jim, but we've pretty much covered the "first stages of troubleshooting" here;).

-- Glenn
0
 
LVL 2

Author Comment

by:shashank3
ID: 13631686
looks like it is a firewall issue.

on telnet 1.1.1.1 25

i get error "Could not open connection to the host on port 25:
Connect Failed"

while i can send mail from the same machine.

thanks for your help.
0
 
LVL 2

Author Comment

by:shashank3
ID: 13631992
i couldn't able to resolve this issue. firewall on linux box is disabled.

i could 'telnet ip_address 25' from same host, but could not do 'telnet ip_address 25' from other machine on same network. i don't know what's going on.

i couldn't find /var/log/sendmail and /var/log/syslog. In /var/log/messages i couldn't find any relevant error.

please help.

thanks.
0
 
LVL 20

Expert Comment

by:Gns
ID: 13632093
Argh, not /var/log/sendmail..... /var/log/maillog .... sorry for that.

-- Glenn
0
 
LVL 2

Author Comment

by:shashank3
ID: 13632149
No problem.

here is last 50 lines of it. i don't know if it helps. regards.

[root@mail html]# tail -50 /var/log/maillog
Mar 25 09:28:36 mail master[6092]: process 13372 exited, status 0
Mar 25 09:28:42 mail master[6092]: process 14035 exited, status 0
Mar 25 09:28:42 mail master[16971]: about to exec /usr/lib/cyrus-imapd/imapd
Mar 25 09:28:42 mail imap[16971]: executed
Mar 25 09:28:45 mail master[6092]: process 14024 exited, status 0
Mar 25 09:28:45 mail master[16972]: about to exec /usr/lib/cyrus-imapd/imapd
Mar 25 09:28:45 mail imap[16972]: executed
Mar 25 09:28:47 mail master[6092]: process 13684 exited, status 0
Mar 25 09:28:47 mail master[16973]: about to exec /usr/lib/cyrus-imapd/imapd
Mar 25 09:28:47 mail imap[16973]: executed
Mar 25 09:43:47 mail imap[16956]: accepted connection
Mar 25 09:43:47 mail master[17045]: about to exec /usr/lib/cyrus-imapd/imapd
Mar 25 09:43:47 mail imap[16956]: login: localhost.localdomain [127.0.0.1] shashank plaintext User logged in
Mar 25 09:43:47 mail imap[17045]: executed
Mar 25 09:43:47 mail imap[16956]: seen_db: user shashank opened /var/lib/imap/user/s/shashank.seen
Mar 25 09:43:47 mail imap[16956]: open: user shashank opened INBOX
Mar 25 09:43:47 mail imap[16956]: seen_db: user shashank opened /var/lib/imap/user/s/shashank.seen
Mar 25 09:44:47 mail master[6092]: process 16956 exited, status 0
Mar 25 09:50:10 mail pop3[6104]: accepted connection
Mar 25 09:50:10 mail master[17210]: about to exec /usr/lib/cyrus-imapd/pop3d
Mar 25 09:50:10 mail pop3[17210]: executed
Mar 25 09:50:10 mail master[6092]: process 6104 exited, status 0
Mar 25 09:50:43 mail imap[16966]: accepted connection
Mar 25 09:50:43 mail master[17215]: about to exec /usr/lib/cyrus-imapd/imapd
Mar 25 09:50:43 mail imap[17215]: executed
Mar 25 09:51:43 mail master[6092]: process 16966 exited, status 0
Mar 25 09:55:13 mail master[17218]: about to exec /usr/lib/cyrus-imapd/ctl_cyrusdb
Mar 25 09:55:13 mail ctl_cyrusdb[17218]: checkpointing cyrus databases
Mar 25 09:55:13 mail ctl_cyrusdb[17218]: archiving database file: /var/lib/imap/annotations.db
Mar 25 09:55:13 mail ctl_cyrusdb[17218]: archiving log file: /var/lib/imap/db/log.0000000001
Mar 25 09:55:13 mail ctl_cyrusdb[17218]: archiving database file: /var/lib/imap/mailboxes.db
Mar 25 09:55:13 mail ctl_cyrusdb[17218]: archiving log file: /var/lib/imap/db/log.0000000001
Mar 25 09:55:13 mail ctl_cyrusdb[17218]: done checkpointing cyrus databases
Mar 25 09:55:13 mail master[6092]: process 17218 exited, status 0
Mar 25 10:19:27 mail imap[16971]: accepted connection
Mar 25 10:19:27 mail master[17651]: about to exec /usr/lib/cyrus-imapd/imapd
Mar 25 10:19:27 mail imap[16971]: login: localhost.localdomain [127.0.0.1] shashank plaintext User logged in
Mar 25 10:19:27 mail imap[16971]: seen_db: user shashank opened /var/lib/imap/user/s/shashank.seen
Mar 25 10:19:27 mail imap[17651]: executed
Mar 25 10:19:28 mail imap[16971]: open: user shashank opened INBOX
Mar 25 10:19:28 mail imap[16971]: seen_db: user shashank opened /var/lib/imap/user/s/shashank.seen
Mar 25 10:20:28 mail master[6092]: process 16971 exited, status 0
Mar 25 10:25:13 mail master[17659]: about to exec /usr/lib/cyrus-imapd/ctl_cyrusdb
Mar 25 10:25:13 mail ctl_cyrusdb[17659]: checkpointing cyrus databases
Mar 25 10:25:13 mail ctl_cyrusdb[17659]: archiving database file: /var/lib/imap/annotations.db
Mar 25 10:25:13 mail ctl_cyrusdb[17659]: archiving log file: /var/lib/imap/db/log.0000000001
Mar 25 10:25:13 mail ctl_cyrusdb[17659]: archiving database file: /var/lib/imap/mailboxes.db
Mar 25 10:25:13 mail ctl_cyrusdb[17659]: archiving log file: /var/lib/imap/db/log.0000000001
Mar 25 10:25:13 mail ctl_cyrusdb[17659]: done checkpointing cyrus databases
Mar 25 10:25:13 mail master[6092]: process 17659 exited, status 0
[root@mail html]#

0
 
LVL 20

Expert Comment

by:Gns
ID: 13632435
No sendmail in that... is the sendmail process running at all?
ps auxww | grep sendmail
would show it if running.

-- Glenn
0
 
LVL 2

Author Comment

by:shashank3
ID: 13632444
yes sir.

[root@mail html]# ps auxww | grep sendmail
root     10250  0.0  0.3  9796 3292 ?        Ss   Mar23   0:00 sendmail: accepting connections
smmsp    10258  0.0  0.2  6652 2592 ?        Ss   Mar23   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root     17810  0.0  0.0  4944  676 pts/3    S+   11:20   0:00 grep sendmail
[root@mail html]#

0
 
LVL 20

Expert Comment

by:Gns
ID: 13632897
Ok, then use two windows.... One for "tail -f /var/log/maillog", one for telnetting in to it (the one above, of course, that doesn't work).
Anything interresting in the log when you do that?

Also, what does
iptables -L
and perhaps
iptables -t nat -L
show?

-- Glenn
0
 
LVL 2

Author Comment

by:shashank3
ID: 13633004
here are the outputs.
thanks.

*******************************
[root@mail ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[root@mail ~]#

[root@mail ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[root@mail ~]#

***************************************
On "tail -f /var/log/maillog" i did not get any error message when trying to telnet ip_address 25.
when i use same host and telnet and send message, below is the output.

****************************************
[root@mail html]# tail -f /var/log/maillog
Mar 25 11:25:13 mail ctl_cyrusdb[17813]: done checkpointing cyrus databases
Mar 25 11:25:13 mail master[6092]: process 17813 exited, status 0
Mar 25 11:55:13 mail master[17835]: about to exec /usr/lib/cyrus-imapd/ctl_cyrusdb
Mar 25 11:55:13 mail ctl_cyrusdb[17835]: checkpointing cyrus databases
Mar 25 11:55:13 mail ctl_cyrusdb[17835]: archiving database file: /var/lib/imap/annotations.db
Mar 25 11:55:13 mail ctl_cyrusdb[17835]: archiving log file: /var/lib/imap/db/log.0000000001
Mar 25 11:55:13 mail ctl_cyrusdb[17835]: archiving database file: /var/lib/imap/mailboxes.db
Mar 25 11:55:13 mail ctl_cyrusdb[17835]: archiving log file: /var/lib/imap/db/log.0000000001
Mar 25 11:55:13 mail ctl_cyrusdb[17835]: done checkpointing cyrus databases
Mar 25 11:55:13 mail master[6092]: process 17835 exited, status 0

Mar 25 12:08:34 mail sendmail[17861]: j2PK75jY017861: from=your@mail.com, size=26, class=0, nrcpts=1, msgid=<200503252008.j2PK75jY017861@mail.domain.com>, proto=SMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Mar 25 12:08:34 mail lmtpunix[16964]: accepted connection
Mar 25 12:08:34 mail lmtpunix[16964]: lmtp connection preauth'd as postman
Mar 25 12:08:34 mail master[17864]: about to exec /usr/lib/cyrus-imapd/lmtpd
Mar 25 12:08:34 mail lmtpunix[17864]: executed
Mar 25 12:08:34 mail lmtpunix[16964]: IOERROR: fstating sieve script /var/lib/imap/sieve/s/shashank/defaultbc: No such file or directory
Mar 25 12:08:34 mail lmtpunix[16964]: duplicate_check: <200503252008.j2PK75jY017861@mail.domain.com> user.shashank        0
Mar 25 12:08:34 mail lmtpunix[16964]: mystore: starting txn 2147483706
Mar 25 12:08:34 mail lmtpunix[16964]: mystore: committing txn 2147483706
Mar 25 12:08:34 mail lmtpunix[16964]: duplicate_mark: <200503252008.j2PK75jY017861@mail.domain.com> user.shashank        1111781314 10
Mar 25 12:08:34 mail sendmail[17863]: j2PK75jY017861: to=shashank@domain.com, delay=00:00:20, xdelay=00:00:00, mailer=cyrusv2, pri=120026, relay=localhost, dsn=2.0.0, stat=Sent

Mar 25 12:09:34 mail master[6092]: process 16964 exited, status 0

Mar 25 12:13:31 mail pop3[6109]: accepted connection
Mar 25 12:13:31 mail master[17924]: about to exec /usr/lib/cyrus-imapd/pop3d
Mar 25 12:13:31 mail pop3[17924]: executed
Mar 25 12:13:31 mail master[6092]: process 6109 exited, status 0
0
 
LVL 20

Expert Comment

by:Gns
ID: 13633130
Ok.... I'll confess that I don't run cyrus, so the local delivery error there... I don't know that much about, other than it looking a bit fishy (Jim should stop eating Easter eggs and get a look at that.... And hopefully he will. You can perhaps interrest him my mailing his EE page editors address directly .... After all, I suspect you've been following his detailed instructions from the entropyfree page, right?).

I'm still a bit fussy on some details here. Are you getting a "Connection refused" when trying to connect from any other host on your LAN, or are you getting the above lmtp (local delivery protocol more or less) error?

-- Glenn
0
 
LVL 2

Author Comment

by:shashank3
ID: 13633450
Hello Glenn,

I don't know or can't find Jim's EE page editors address. Also i don't know what you meant by his detailed instructions from the entropyfree page.

I'm getting "Connection refused" when trying to connect from any other host on LAN. I don't know if sendmail has a setting which refuses connection from hosts other than localhost.

Thanks,
Shashank
0
 
LVL 14

Expert Comment

by:theruck
ID: 13634008
try to telnet localhost 25 please
0
 
LVL 2

Author Comment

by:shashank3
ID: 13634144
it works. (as mentioned before)
0
 
LVL 14

Accepted Solution

by:
theruck earned 2000 total points
ID: 13634259
then do a netstat and look if you have port 25 open
if not your sendmail config is wrong
0
 
LVL 2

Author Comment

by:shashank3
ID: 13634424
Here is netstat. it looks like it only allows localhost on port 25. how do i rectify it?

also is there any security risks with current open ports?
thanks.

[root@mail ~]# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:32769               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:389                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5801                0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:3306              0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:783               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2000                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:113                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:5335              0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 208.57.79.245:5901          208.57.79.244:1710          ESTABLISHED
tcp        0      0 :::993                      :::*                        LISTEN
tcp        0      0 :::995                      :::*                        LISTEN
tcp        0      0 :::389                      :::*                        LISTEN
tcp        0      0 :::110                      :::*                        LISTEN
tcp        0      0 :::143                      :::*                        LISTEN
tcp        0      0 :::80                       :::*                        LISTEN
tcp        0      0 :::2000                     :::*                        LISTEN
tcp        0      0 :::6001                     :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 :::443                      :::*                        LISTEN
udp        0      0 0.0.0.0:32768               0.0.0.0:*
udp        0      0 0.0.0.0:10080               0.0.0.0:*
udp        0      0 0.0.0.0:5353                0.0.0.0:*
udp        0      0 0.0.0.0:111                 0.0.0.0:*
udp        0      0 0.0.0.0:894                 0.0.0.0:*
Active UNIX domain sockets (servers and established)
0
 
LVL 2

Author Comment

by:shashank3
ID: 13634946
ok. i found the solution on google.
thanks.

Comment the following option in sendmail.cf and restart the sendmail daemon.

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

0
 
LVL 14

Expert Comment

by:theruck
ID: 13635454
yeah thats it :)
0
 
LVL 20

Expert Comment

by:Gns
ID: 13635856
Ah yes. Good that you found it (I think I mentioned the possibility early on:-)...
About Jims address: IIRC every page editor has an address like <EE callsign>@experts-exchange.com ... Jo Jims would perhaps be jlevie@experts-exchange.com.
About the page.... Jim has a webpage on his domain (don't remember the exact address, but it's something like entropyfree.com (that's not it, but.... bad memory patch there:-)), where he has some fairly extensive instructions on how to build a system on cyrus and sendmail (and apache and ...). I thought you'd been following that. Obviously not:-).

Anyway, have the Community support PAQ this.... Although we didn't do more than point you in the right direction(s), there is a clear solution that should be saved for posterity.

-- Glenn
0
 
LVL 2

Author Comment

by:shashank3
ID: 13636461
Yes. thank you. You pointed me in a direction and i searched on google and found answer. like jim's webpage is http://www.entrophy-free.net/ it has good instruction about sendmail and cyrus.

Thank you again.

btw. what does PAQ means.
0
 
LVL 20

Expert Comment

by:Gns
ID: 13636659
Previously Asked Question.... The searcheable database of all questions that have been graded.... And some (quite a few at that) where the asker has found a solution that they are gracious enough to share... So then the question is not deleted, but moved to PAQ, with (and sometimes without... Thats when the asker didn't bother to come back, and several solutions were availbable, but none could be chosen as The Solution) a point refund. Post a question (at the cost of 9 points) in the Community support area refering to this one, asking for a PAQ with refund.

BTW, thanks for sharing Jims address. I think it must be old age setting in (on my part).... memory going in patches:-).

-- Glenn
0
 
LVL 20

Expert Comment

by:Gns
ID: 13636756
"9 points" -> "0 (zero) points"

-- Glenn (a.k.a. Le Grand Typo)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 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