[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

Sendmail - unable to receive email other than localhost

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
shashank3
Asked:
shashank3
  • 11
  • 9
  • 5
1 Solution
 
theruckCommented:
you did not type any errors so it is hard to advice something. i gues you have not set the relay correctly
0
 
shashank3Author Commented:
Where can i check the errors? please let me know.
0
 
GnsCommented:
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
theruckCommented:
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
 
GnsCommented:
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
 
shashank3Author Commented:
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
 
shashank3Author Commented:
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
 
GnsCommented:
Argh, not /var/log/sendmail..... /var/log/maillog .... sorry for that.

-- Glenn
0
 
shashank3Author Commented:
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
 
GnsCommented:
No sendmail in that... is the sendmail process running at all?
ps auxww | grep sendmail
would show it if running.

-- Glenn
0
 
shashank3Author Commented:
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
 
GnsCommented:
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
 
shashank3Author Commented:
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
 
GnsCommented:
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
 
shashank3Author Commented:
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
 
theruckCommented:
try to telnet localhost 25 please
0
 
shashank3Author Commented:
it works. (as mentioned before)
0
 
theruckCommented:
then do a netstat and look if you have port 25 open
if not your sendmail config is wrong
0
 
shashank3Author Commented:
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
 
shashank3Author Commented:
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
 
theruckCommented:
yeah thats it :)
0
 
GnsCommented:
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
 
shashank3Author Commented:
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
 
GnsCommented:
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
 
GnsCommented:
"9 points" -> "0 (zero) points"

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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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