Chris Green wrote:
> I am trying to debug it by connecting directly to port 25 on localhost
> using telnet and composing mail that way.

I highly recommend "swaks" the Swiss Army Knife SMTP, the all-purpose
SMTP transaction tester utility program for generating test emails
using SMTP transactions.  For example:

    swaks --to u...@example.com --server test-server.example.net

Here is an example run here to show how it operates.  To demonstrate
how easy it makes manual "telnet port 25 debugging".

    rwp@havoc:~$ swaks --to b...@proulx.com --from b...@proulx.com --server 
localhost
    === Trying localhost:25...
    === Connected to localhost.
    <-  220 havoc.proulx.com ESMTP Postfix (Debian/GNU)
     -> EHLO havoc.proulx.com
    <-  250-havoc.proulx.com
    <-  250-PIPELINING
    <-  250-SIZE 104857600
    <-  250-ETRN
    <-  250-STARTTLS
    <-  250-ENHANCEDSTATUSCODES
    <-  250-8BITMIME
    <-  250-SMTPUTF8
    <-  250 CHUNKING
     -> MAIL FROM:<b...@proulx.com>
    <-  250 2.1.0 Ok
     -> RCPT TO:<b...@proulx.com>
    <-  250 2.1.5 Ok
     -> DATA
    <-  354 End data with <CR><LF>.<CR><LF>
     -> Date: Sun, 16 May 2021 13:48:10 -0600
     -> To: b...@proulx.com
     -> From: b...@proulx.com
     -> Subject: test Sun, 16 May 2021 13:48:10 -0600
     -> Message-Id: <20210516134810.013...@havoc.proulx.com>
     -> X-Mailer: swaks v20181104.0 jetmore.org/john/code/swaks/
     -> 
     -> This is a test mailing
     -> 
     -> 
     -> .
    <-  250 2.0.0 Ok: queued as EB48316A
     -> QUIT
    <-  221 2.0.0 Bye
    === Connection closed with remote host.

It reported the queue id in the transaction log.  Let's look for it.
(I am going to redact just one little string pattern to avoid more
noise to my logs from abusers scraping and trying.  But I don't think
it detracts from the otherwise real example use of it.)

    rwp@havoc:~$ grep EB48316A /var/log/mail.log
    May 16 13:48:10 havoc postfix/smtpd[13034]: EB48316A: 
client=localhost[127.0.0.1]
    May 16 13:48:10 havoc postfix/cleanup[13037]: EB48316A: 
message-id=<20210516134810.013...@havoc.proulx.com>
    May 16 13:48:11 havoc postfix/qmgr[28771]: EB48316A: 
from=<b...@proulx.com>, size=478, nrcpt=1 (queue active)
    May 16 13:48:11 havoc postfix/local[26122]: EB48316A: 
to=<[[redacted]].proulx.com>, orig_to=<b...@proulx.com>, relay=local, 
delay=0.26, delays=0.16/0/0/0.1, dsn=2.0.0, status=sent (delivered to command: 
IFS=' ';exec /usr/bin/procmail || exit 75 #rwp)
    May 16 13:48:11 havoc postfix/qmgr[28771]: EB48316A: removed

In the above, and in your logs, the "status=sent" follows the tracing
trail of where the message went.  It did not disappear.  It was
delivered.  And in your log your messages were the same.  Those
messages were relayed as described by Bill in his response.  I just
wanted to say that swaks is much easier and less error prone for
injecting test message probes than typing the protocol transaction in
manually from the keyboard.

Bob

Reply via email to