Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass arguments to nullmailer-inject #59

Open
JsBergbau opened this issue Feb 6, 2019 · 1 comment
Open

How to pass arguments to nullmailer-inject #59

JsBergbau opened this issue Feb 6, 2019 · 1 comment

Comments

@JsBergbau
Copy link

JsBergbau commented Feb 6, 2019

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant