On Wed, Aug 10, 2022 at 07:51:52PM +0200, witcher wrote: > I'm wondering whether there is an option for sendmail to read the > "From:" field from a mbox file to fill the envelope sender address > (like you otherwise would with the `-f` command line flag).
There isn't. > It doesn't seem to be documented (and thus probably not available) in > the man page for sendmail, but it seems like it would be a popular > feature, so I thought I'd ask. In the Postfix queue file the envelope sender record needs to appear before any recipient records. This would require the command-line envelope recipients and (with '-t') any header recipients that appear before "To:", "Cc:", "Bcc:", "Resent-To:", "Resent-Cc:", "Resent-Bcc:", to be buffered and emitted only after "From:" is seen. A fatal error would have to result if there is no "From:" (or "Resent-From:") header. There's already some code to buffer "header" recipients for '-t' support, but deferring the sender is a bit more complicated, and perhaps there are additional barriers beyond the obvious ones. Though it does not look too difficult at first blush. As to popularity, I use "mutt", which already supports setting the envelope sender based on the "From:" header, passing the desired envelope sender to sendmail(1). I do think this feature rather belongs in the MUA. -- Viktor.