Sendmail Issue.

Hi Gurus,

I have been tampering around with sendmail for the past one week and seem to make little progress. Given below is an abstract of the issue.

I have a Fedora 12 server(A VM on vitual Box bridged with a Windows XP host) which has to act as a SMTP server and have accordingly put up the loopback address[127.0.0.1] as SMTP relay.[I have also started the sendmail service.]

[root@localhost ~]# grep -i MTA /etc/mail/submit.cf
#D{sendmailMTACluster}$m
D{MTAHost}[127.0.0.1]
O DaemonPortOptions=Name=NoMTA, Addr=127.0.0.1, M=E
R$* < @ $+ > $*         $#relay $@ ${MTAHost} $: $1 < @ $2 > $3
R$+ :: $+               $#relay $@ ${MTAHost} $: $1 :: $2
R$*                     $#relay $@ ${MTAHost} $: $1 < @ $j >

The server is in my office LAN.

When i send a mail the output is as below:

[root@localhost ~]# mail -v tohariganesh@gmail.com
Subject: Test 300
EOT
Null message body; hope that's ok
tohariganesh@gmail.com... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.14.4/8.14.4; Tue, 3 Aug 2010 20:10:19 +0530
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=231
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<tohariganesh@gmail.com>
>>> DATA
250 2.1.5 <tohariganesh@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o73EeJes001317 Message accepted for delivery
tohariganesh@gmail.com... Sent (o73EeJes001317 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection

The /var/spool/mqueue show the mail as delivered and queued.

-rw-------. 1 root smmsp    2 2010-08-03 20:10 dfo73EeJes001317
-rw-------. 1 root smmsp 1131 2010-08-03 20:10 qfo73EeJes001317
[root@localhost mqueue]#

But i am not receiving the emails in my inbox.[Have checked spam/junk also]

I checked in google and was asked to put the below entries in sendmail.mc and compile the macro again.

define(`RELAY_MAILER_ARGS', `TCP $h 2525')
define(`ESMTP_MAILER_ARGS', `TCP $h 2525')

The above entry has also not solved the issue.

Please let me know what the issue could be.Any help is greatly appreciated.

Thanks
HG

---------- Post updated at 05:02 PM ---------- Previous update was at 02:51 PM ----------

Gurus

I need to add this also:
If i view the contents of queued file,i get the error "MDeferred: Connection refused by alt4.gmail-smtp-in.l.google.com."

Why is gmail refusing to accept?

[root@localhost mqueue]# cat qfo73EeJes001317
V8
T1280846420
K1280851305
N3
P300494
I253/0/470
MDeferred: Connection refused by alt4.gmail-smtp-in.l.google.com.
Fbs
$_localhost [127.0.0.1]
$rESMTP
$slocalhost.localdomain
${daemon_flags}
${if_addr}127.0.0.1
S<root@localhost.localdomain>
MDeferred: Connection refused by alt4.gmail-smtp-in.l.google.com.
rRFC822; tohariganesh@gmail.com
RPFD:<tohariganesh@gmail.com>
H?P?Return-Path: <g>
H??Received: from localhost.localdomain (localhost [127.0.0.1])
        by localhost.localdomain (8.14.4/8.14.4) with ESMTP id o73EeJes001317
        for <tohariganesh@gmail.com>; Tue, 3 Aug 2010 20:10:20 +0530
H?x?Full-Name: root
H??Received: (from root@localhost)
        by localhost.localdomain (8.14.4/8.14.4/Submit) id o73EeJb8001315
        for tohariganesh@gmail.com; Tue, 3 Aug 2010 20:10:19 +0530
H??From: root <root@localhost.localdomain>
H??Message-Id: <201008031440.o73EeJb8001315@localhost.localdomain>
H??Date: Tue, 03 Aug 2010 20:10:19 +0530
H??To: tohariganesh@gmail.com
H??Subject: Test 300
H??User-Agent: Heirloom mailx 12.4 7/29/08
H??MIME-Version: 1.0
H??Content-Type: text/plain; charset=us-ascii
H??Content-Transfer-Encoding: quoted-printable
.

Thanks
HG

Are you married to sendmail? I'd seriously suggest Postfix for several reasons including Postfix's better privilege segmentation as well as the easier to use config files.

Mark,

I understand that postfix is a better tool. But since i have prior knowledge(whatever little) of sendmail and since i am on the brink of getting it configured,i thought i would go ahead with it. Once the sendmail issue is resolved,i will start looking at postfix.

Meanwhile i request sendmail experts to chip in.

HG

Do you have SMART_HOST defined? And an access database containing your username and password?

Google is not going to accept input from you as an an SMTP server. You have to use SMART_HOST.

The file /usr/share/doc/sendmail-8.*.*/README.cf has some info.

Do you have a reverse DNS configured, many recipients will reject email if the sender's IP address does not resolve to the email domain.

Gurus

I have neither of these configured(Reverse DNS and SMART_HOST)...Infact the machine i am working on is a standalone server not in any domain.

Suppose that i configure both,will smtp-gmail start accepting my mails? If so what is the security that smtp-gmail server has against spammers.How exactly are the smtp servers protected against spammers if all it requires is a SMART_HOST and reverse DNS lookup.

Am asking this to understand the E-Mail setup. I read in howstuffworks.com and got a little understanding...But this thing perplexes me..

Thanks
HG

It perplexes me too.

Defining SMART_HOST and creating an access database allows sendmail to authenticate each email you send with your account username and password, just like any individual user, though it does it automatically.

BTW, here's a blog that talks about setting up sendmail to send mail.

Hi ken,

Thanks for the blog.
I would like to know what exactly do you mean by a Valid Email Address.
Is root@localhost or root@<hostname> or root@<fqdn> a valid E-Mail Address?
If only root@fqdn works...then can i just give a dummy domainname to the standalone server?

Are my mails getting rejected by smtp-google server because of above extensions?

Thanks
HG

Who said Valid Email Address? Where?

But yes, I think both the to and from email addresses must be reachable from outside your network. Though that probably is not sufficient.

Another thing I thought of is Sender Policy Framework (SPF). For example, if you have the dig command look at the TXT record returned by these commands:

dig txt google.com
dig txt bluehost.com

Your domain may need an SPF TXT record in DNS.

But if your IP address is in a range owned by an ISP like Verizon or Comcast, I still don't think Google will ever except SMTP traffic from you unless you authenticate the connection with a username and password. That's what the SMART_HOST option and access database do.