Originally posted by: SystemAdmin
First of all, you do not need to have sendmail running unless you need to receive mail at the host. Having it run without using it is a security hole that you do not need to open.
Second, since you have not shown any of the commands that you are using, it
is not clear that you are using even the mail -v command correctly.
Third, there is a fairly easy way to test if the mail gateway is even running
an SMTP daemon or is receiving mail. You cannot know that it is actually
forwarding the mail until it is sent.
One way to do this is to actually telnet to the gateway at port 25.
tn <gateway> 25
Trying...
Connected to tesch.dfw.ibm.com.
Escape character is '^T'.
220 tesch.dfw.ibm.com ESMTP Sendmail Tue, 22 Aug 2006 08:55:26 -0500
Then you have a gateway that works.
You can actually send a mail, or just type HELP to learn about the mail server
HELP
214-2.0.0 This is sendmail version AIX5.3/8.11.6p2
214-2.0.0 Topics:
214-2.0.0 HELO EHLO MAIL RCPT DATA
214-2.0.0 RSET NOOP QUIT HELP VRFY
214-2.0.0 EXPN VERB ETRN DSN AUTH
214-2.0.0 STARTTLS
214-2.0.0 For more info use: HELP <topic>.
214-2.0.0 To report bugs in the implementation send email to
214-2.0.0
sendmail-bugs@sendmail.org.
214-2.0.0 For local information send email to Postmaster at your site.
214 2.0.0 End of HELP info
-
Then you can type QUIT to quit, or you can actually send an email this way
quit
221 2.0.0 tesch.dfw.ibm
Once you know the gateway is right, then you can see if the mail was received
by the gateway. In this case I'm sending mail directly to another host in my
same domain. Notice how I am using a full domain name. I shouldn't need to
do this, but it is always good practice and will help you debug.
-
mail -v jwtesch@teschp2.dfw.ibm.com
Subject: What
Now
.
Cc:
jwtesch@teschp2.dfw.ibm.com... Connecting to teschp2.dfw.ibm.com. via esmtp...
220 teschp2.dfw.ibm.com ESMTP Sendmail Tue, 22 Aug 2006 08:43:29 -0500
>>> EHLO tesch.dfw.ibm.com --- if you didn't get this far, you've got problems
250-teschp2.dfw.ibm.com Hello tesch.dfw.ibm.com
http://9.19.51.184, pleased to meet you
250-ENHANCEDSTATUSCODES
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250 HELP
>>> MAIL From:<
jwtesch@tesch.dfw.ibm.com> SIZE=51
250 2.1.0 <
jwtesch@tesch.dfw.ibm.com>... Sender ok
>>> RCPT To:<
jwtesch@teschp2.dfw.ibm.com>
250 2.1.5 <
jwtesch@teschp2.dfw.ibm.com>... Recipient ok
>>> DATA
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 k7MDhTd307418 Message accepted for delivery
jwtesch@teschp2.dfw.ibm.com... Sent (k7MDhTd307418 Message accepted for delivery)
Closing connection to teschp2.dfw.ibm.com.
>>> QUIT
221 2.0.0 teschp2.dfw.ibm.com closing connection
-
That is all there is to it, except to look on the mail server side
and check the message is received.
-
ls -l /var/spool/mail
total 8
-rw-rw---- 1 hock mail 0 Nov 02 2005 hock
-rw-rw---- 1 jwtesch mail 624 Aug 22 08:43 jwtesch
cat -v /var/spool/mail/jwtesch
From
jwtesch@tesch.dfw.ibm.com Tue Aug 22 08:43:29 2006
Received: from tesch.dfw.ibm.com (tesch.dfw.ibm.com
http://9.19.51.184) by teschp2.dfw.ibm.com (AIX5.3/8.11.6p2/8.11.0) with ESMTP id k7MDhTd307418 for <
jwtesch@teschp2.dfw.ibm.com>; Tue, 22 Aug 2006 08:43:29 -0500
Received: (from root@localhost)
by tesch.dfw.ibm.com (tesch5.3/8.11.6p2/8.11.0) id k7MDieJ209034
for
jwtesch@teschp2.dfw.ibm.com; Tue, 22 Aug 2006 08:44:40 -0500
Date: Tue, 22 Aug 2006 08:44:40 -0500
From: John Tesch <
jwtesch@tesch.dfw.ibm.com>
Message-Id: <
200608221344.k7MDieJ209034@tesch.dfw.ibm.com>
To:
jwtesch@teschp2.dfw.ibm.com Subject: What
Now
On the other hand, if I send to a host not running sendmail, I get
root@teschp2 / # mail -v root@fs1
Subject: Try with DS
Gateway
.
Cc:
root@fs1... Connecting to fs1.dfw.ibm.com. via esmtp...
-
just sets there timing out.
Now I set the DS in the /etc/sendmail.cf file to my other AIX host
DSsmtp:tesch.dfw.ibm.com
root@teschp2 / # mail -v
hillery@myplace.ibm.com Subject: Bad
Addr
.
Cc: '
'... User unknown
hillery@myplace.ibm.com... Connecting to tesch.dfw.ibm.com. via smtp...
220 tesch.dfw.ibm.com ESMTP Sendmail Tue, 22 Aug 2006 09:00:47 -0500
>>> EHLO teschp2.dfw.ibm.com
250-tesch.dfw.ibm.com Hello teschp2
http://9.19.51.185, pleased to meet you
250-ENHANCEDSTATUSCODES
250-EXPN
...
250 HELP
>>> MAIL From:<
root@teschp2.dfw.ibm.com> SIZE=53
250 2.1.0 <
root@teschp2.dfw.ibm.com>... Sender ok
>>> RCPT To:<
hillery@myplace.ibm.com>
550 5.7.1 <
hillery@myplace.ibm.com>... Relaying denied
>>> RSET
250 2.0.0 Reset state
[b]/dead.letter... Saved message in /dead.letter[/b]
Closing connection to tesch.dfw.ibm.com.
>>> QUIT
221 2.0.0 tesch.dfw.ibm.com closing connection
-
This is because I've disabled relaying on the DS host (for security
reasons). So that gateway needs turned on if it is going to be an email
gateway. This case, the problem is not on the client but on the
mail gateway.
#AIX-Forum