After getting outgoing email to work on my linux box in order to email logs to myself (see  Sendmail1 , Sendmail2, Sendmail3 posts), i decided to try to get incoming email to the linux box to work. FYI This is not my main mail server, i basically use sendmail to send backup log files to other computers..

BTW here’s the OS for my box. it might be a slightly different config on other boxes:

#lsb_release -a

Distributor ID: RedHatEnterpriseES
Description:    Red Hat Enterprise Linux ES release 4 (Nahant Update 4)
Release:        4

I was getting the following error when trying to send an email

Oct 12 09:26:22 mylinuxbox sendmail[3959]: o9CDQM6f003957: to=, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120321, [], dsn=4.0.0, stat=Deferred: Connection refused by

To test locally I used the command:

to test remotely i used the command and it was successful:
telnet 25

220 ESMTP Sendmail 8.13.1/8.13.1; Tue, 12 Oct 2010 10:30:40 -0400

After doing a little research on this i was able to get it to work, by going into the /etc/mail/ file and adding the line (in bold). This allowed sendmail to listen on its ethernet port ( in addition to localhost :

# SMTP daemon options

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

I then restarted sendmail (#service sendmail restart), performed the test again and everything worked correctly locally, however when i try to connect from my computer on port 25 I would get a connection refused.
C:\Users\me>telnet 25
Connecting To…Could not open connection to the host, on port 25: Connect failed

However, I realized that if i tried from my my mail server I could connect with no problems. Then i figured out that i had Mcafee Antivirus on my computer, and sure enough it was blocking me from making remote telnet connections to 25. duh.