# Sendmail Problems



## DazedAndConfuse (Apr 21, 2003)

Help!  Ever since the sendmail update a while ago I have been having issues with sendmail.  Recently however things have taken a turn for the worse.  I cannot get any mail to the outside world.  Listed below is a typical 'bounce' that I get.

Can anybody help me to work out what is happening here, and fix the problem?  I am really desperate now.

DC.

From: Mail Delivery Subsystem <MAILER-DAEMON>
Date: Thu Apr 17, 2003  11:18:31  PM Canada/Eastern
To: <dconroy@david-conroys-computer.local>
Subject: Warning: could not send message for past 4 hours
Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost) by dconroy.com (8.12.9/8.12.6) id h3I34kc3024342; Thu, 17 Apr 2003 23:18:31 -0400 (EDT)
Message-Id: <200304180318.h3I34kc3024342@dconroy.com>
Mime-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status; boundary="h3I34kc3024342.1050635911/dconroy.com"
Auto-Submitted: auto-generated (warning-timeout)

    **********************************************
    **      THIS IS A WARNING MESSAGE ONLY      **
    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **
    **********************************************

The original message was received at Thu, 17 Apr 2003 18:43:15 -0400 (EDT)
from localhost [127.0.0.1]

   ----- Transcript of session follows -----
<dconroy123@yahoo.com>... Deferred: Operation timed out with mx4.mail.yahoo.com.
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old
Reporting-MTA: dns; dconroy.com
Arrival-Date: Thu, 17 Apr 2003 18:43:15 -0400 (EDT)

Final-Recipient: RFC822; dconroy123@yahoo.com
Action: delayed
Status: 4.4.1
Remote-MTA: DNS; mx4.mail.yahoo.com
Last-Attempt-Date: Thu, 17 Apr 2003 23:18:31 -0400 (EDT)
Will-Retry-Until: Tue, 22 Apr 2003 18:43:15 -0400 (EDT)

From: David Conroy <dconroy@david-conroys-computer.local>
Date: Thu Apr 17, 2003  6:43:15  PM Canada/Eastern
To: dconroy123@yahoo.com
Subject: No2


dfg


----------



## btoneill (Apr 21, 2003)

That email is just saying that it's trying to deliever mail to a user @yahoo.com, but it's having issues. What is being listed in the sendmail log file on it's attempts to send the mail? Also try doing 'echo testing | /usr/sbin/sendmail -v username@yahoo.com' and see what type of output you get.

Brian


----------



## DazedAndConfuse (Apr 21, 2003)

For the original message the logs give

Apr 21 22:40:38 David-Conroys-Computer sendmail[26576]: h3LNHo5o024120: to=dconroy123@yahoo.com, ctladdr=<dconroy@david-conroys-computer.local> (501/20), delay=03:22:48, xdelay=00:00:00, mailer=esmtp, pri=390622, relay=mx4.mail.yahoo.com., dsn=4.0.0, stat=Deferred: Operation timed out with mx4.mail.yahoo.com.

and the output from your test command

[David-Conroys-Computer:~] dconroy% echo testing | /usr/sbin/sendmail -v dconroy123@yahoo.com
dconroy123@yahoo.com... Connecting to localhost via relay...
220 dconroy.com ESMTP Sendmail 8.12.9/8.12.6; Mon, 21 Apr 2003 23:04:43 -0400 (EDT)
>>> EHLO david-conroys-computer.local
250-dconroy.com Hello dconroy.com [192.168.1.100], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<dconroy@david-conroys-computer.local> SIZE=8
250 2.1.0 <dconroy@david-conroys-computer.local>... Sender ok
>>> RCPT To:<dconroy123@yahoo.com>
>>> DATA
250 2.1.5 <dconroy123@yahoo.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 h3M34h8L027042 Message accepted for delivery
dconroy123@yahoo.com... Sent (h3M34h8L027042 Message accepted for delivery)
Closing connection to localhost
>>> QUIT
221 2.0.0 dconroy.com closing connection
[David-Conroys-Computer:~] dconroy%

With a corresponding log entry of

Apr 21 23:04:43 David-Conroys-Computer sendmail[27042]: h3M34h8L027042: from=<dconroy@david-conroys-computer.local>, size=330, class=0, nrcpts=1, msgid=<200304220304.h3M34hRI027041@david-conroys-computer.local>, proto=ESMTP, daemon=MTA, relay=dconroy.com [192.168.1.100]
Apr 21 23:04:43 David-Conroys-Computer sendmail[27041]: h3M34hRI027041: to=dconroy123@yahoo.com, ctladdr=dconroy (501/20), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30008, relay=localhost [192.168.1.100], dsn=2.0.0, stat=Sent (h3M34h8L027042 Message accepted for delivery)

and for completeness

[David-Conroys-Computer:~] dconroy% mailq
                /var/spool/mqueue (4 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
h3M34h8L027042*       8 Mon Apr 21 23:04 <dconroy@david-conroys-computer.local>
                                         <dconroy123@yahoo.com>
h3M0Su8L025150       95 Mon Apr 21 20:28 <dconroy@dconroy.com>
                 (Deferred: Operation timed out with mx4.mail.yahoo.com.)
dconroy123@yahoo.com 


Now I know that it just look like the problem is with Yahoo, but this is the same for any address I send to.  Those same addresses work fine from another server.  I'm really at a loss here.


----------



## rhg (Apr 22, 2003)

If this has ever worked before then you not only updated the sendmail software but changed your mail configuration in addition.

You try to send your mail with a local From address directly to a yahoo address.
>>> MAIL From:<dconroy@david-conroys-computer.local> SIZE=8

Yahoo will defer this because it cannot reverse-resolve your From address. This is common behavior and not specific to Yahoo.

First, it is necessary that you use an official From address, i.e. one that can be reverse-resolved. If someone tries to send mail to dconroy@david-conroys-computer.local from outside it certainly won't arrive ever. So use an address which can be reached from outside.

Second, since your mail relay dconroy.com [192.168.1.100] itself does not appear to have an official address, Yahoo will not accept any mail from it. This happens to prevent their mail hubs from being abused by spammers and is also common behavior. Your mail must originate from an official mail server (tech slang: the originating address must resolve to a MX domain name service record).

Usually, the SMTP mail server of your provider meets this criteria. So the usual way is to pass your mail to the SMTP server of you provider which in turn delivers it to the final recipient.


----------



## DazedAndConfuse (Apr 22, 2003)

Here's where I don't understand things.  Prior to the update I had things working.  In the M4 configuration file for sendmail.cf I have the line

define(`confDOMAIN_NAME', `dconroy.com')

This changed the hostname to dconroy.com, which DOES resolve.  This doesn't seem to be working anymore.  Additionally, both Yahoo, and my work address previously accepted mail from unresolvable domains before.

Things that appear to be different.  I'm pretty sure that only one sendmail daemon used to be started.  Since the update two are started, one of which used submit.cf instead of sendmail.cf.  I don't know what the difference between these is.


----------



## rhg (Apr 23, 2003)

Newer sendmail versions indeed have 2 daemons running, one which handles incoming mail and the other which runs the queue.

However, have you checked in sendmail.cf if your M4 configuration has been applied? If not, it might be necessary to re-create your sendmail.cf. I'm not sure about confDOMAIN_NAME but it might have changed, too. You might want to grep for confDOMAIN_NAME in the M4 files to see if this option is still covered.


----------



## DazedAndConfuse (May 12, 2003)

So I bit the bullet, and bought the Sendmail book.

After extensively modifying the configuration files for both the MSA and the MTA everything looks good.  Except messages still bounce.

$j now returns the domain name from outside the firewall.  All messages are masqueraded as from the correct domain.   Even the message ID now has the correct  domain tagged on the end.  No change.

I've tried eveything that I can think of.  Still no joy.


----------



## Darkshadow (May 12, 2003)

You need to edit submit.cf as well.  It has the same options that sendmail.cf has, but has a few of the options selected differently.  So you can't just copy the sendmail.cf to submit.cf, for example.


----------



## DazedAndConfuse (May 13, 2003)

Darkshadow,

I have already edited submit.cf.  I had to do that to get the message ID to contain my domain name instead of my local machine name.  I believe that eveything else is taken care of by the MTA, i.e via sendmail.cf.  This does all the message header, and envelope masquerading.

I think I should use verbose mode to 'listen in' on the SMTP conversation between my MTA and the remote one.  If I add the -v flag to the daemon whould the output show up in the mail log?  On the console?

When I get home I'll post the bounced mail.  Perhaps someone will spot something that I've missed.

Thanks,

DC


----------



## Darkshadow (May 13, 2003)

Probably would show up in the mail log.

You could do what I did.  I got really annoyed having two sendmails running, so I opted to edit the sendmail.cf so that it both sends & receives mail.  Then I edited /System/Library/StartupItems/Sendmail/Sendmail to stop the second daemon from being started (put a # sign in front of it).

Mail works fine for me now.   Having two config files to mess with is just a big pain in the butt.


----------

