nullmailer icon indicating copy to clipboard operation
nullmailer copied to clipboard

How to pass arguments to nullmailer-inject

Open JsBergbau opened this issue 6 years ago • 1 comments

The file adminaddr is used when address ends for example with "@localhost" However if only user specified like cron does like -i -FCronDaemon -B8BITMIME -oem pi nothing is replaced and mail is sent to e.g. [email protected] Luckily google usernames must be at least 6 characters otherwise someone registering [email protected] would get a lot of mails from raspberrypi

I've created a wraper script, because allmailfrom just changed the returnpath header to allmailfrom content, but "From: " header still remained the original From: header. It uses NULLMAILER_USER and NULLMAILER_HOST to replace the from address and replaces any "To: " line without a "@" sign to user given admin, if you're interested see https://github.com/JsBergbau/nullmailer-Rewrite-Wrapper

Problem: To header is rewritten in the mail header is now

Received: from gmail.com (XXXX.dip0.t-ipconnect.de. [X.Y.Z.A])
        by smtp.gmail.com with ESMTPSA id XXXXXX
        for <[email protected]>
(...)
To: [CORRECT To E-Mail Adress]

Nullmailer still seems to use the to address from commandline. In man nullmailer-inject is written -h Use only data from the message header as the recipient addresses. That is exactly what we need here.

So how to pass the -h argument to nullmailer-inject? (without writing another wrapper :-) )

JsBergbau avatar Feb 06 '19 14:02 JsBergbau

Obviously there is no way to pass the -h argument from sendmail. With nullmailer sendmail is just there for programs that expect a sendmail binary, see https://manpages.debian.org/jessie/nullmailer/sendmail.1.en.html So I've updated the Rewrite Wrapper Script to change local user destinations to Admin_Adress https://github.com/JsBergbau/nullmailer-Rewrite-Wrapper

JsBergbau avatar Mar 23 '19 00:03 JsBergbau