Index | Thread | Search

From:
Walter Alejandro Iglesias <wai@roquesor.com>
Subject:
Re: smtpd(8) should add missing date and message id headers also on port 465
To:
tech@openbsd.org
Date:
Tue, 10 Sep 2024 12:07:36 +0200

Download raw body.

Thread
On Tue, Sep 10, 2024 at 01:10:39AM +0200, Christian Schulte wrote:
> On 09.09.24 11:54, Walter Alejandro Iglesias wrote:
> > 
> > Anyway, my slightly related question was: how did you managed to include
> > a In-Reply-To header using a plain smtpd(8) command ('sendmail -t').
> > 
> 
> By copying the message id from the archive into vi(1) and writing it by
> hand. sendmail(8) adds missing message-id and date headers.

You helped me to find something curious.

First of all, the message you sent with the sendmail command, besides
In-Reply-To and References (which are not added by opensmtpd) shows a
Message-ID which is also not generated by opensmtpd:

  Message-ID: <29b681b5a4b153c2@x500.schulte.it>

This tells me that you pasted more than one header in the file.

After some testing I found out the following.  Using this command:

  $ sendmail -f user user < file

Where 'file' contains some headers separated by a blank line from the
body, if you add In-Reply-To or References to 'file', they are
recognized as such as long as they are accompanied by other headers
among those recognized by opensmtpd.  For example, if the content of
file is:

  ------------8<-------------
  To: root
  In-Reply-To: <string>

  Body of the message.
  ----------------------------

opensmtpd correctly adds In-Reply-To as a header.  But if you do this:

  ---------------------------
  In-Reply-To: <string>
  References: <string>

  Body of the message.
  ----------------------------

opensmtpd will add those headers as part of the body.  Curiously, even
unimportant headers like User-Agent are recognized as such.  This works:

  ---------------------------
  User-Agent: Whatever

  Body of the message.
  ----------------------------

Try it yourself.


> 
> -- 
> Christian
> 
> 

-- 
Walter