-
Notifications
You must be signed in to change notification settings - Fork 44
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
allmailfrom setting not having the desire effect #72
Comments
I am having a similar problem. I realised that envelope sender change as discussed in #13 and #55 will not do much good if the provider strictly checks username==sender==from, as Migadu does:
I am still not sure what the |
Unfortunately,
Setting the global
in A wrapper script has technically worked, but my SMTP still rejected with Message rejected under suspicion of SPAM, so not an option either. Found this |
It is an issue that deserves fixing directly here, not with a wrapper. Having control over "From" and "Sender" is often needed. Not sure it should be done via But honestly |
Yeah, |
I've tried to check how how It works with nullmailer's sendmail and mail from mailutils. Filepath is hardcoded because I'm not familiar with automake/autoconf generated variables.
|
I just encountered this problem too when trying to use nullmailer with a custom From. Is there any other way (than modifying the source code) to achieve this? do we know if it's a bug or not? or shall I just use another service? |
I think I have figured it out. I have created a patch which replaces
I have created a pull request with my fix. #84 |
Unfortunately setting NULLMAILER_USER and NULLMAILER_HOST doesn't help when the program that creates the email already sets a sender address. nullmailer-inject has the flag "f", which: "Ignore and remove any From header lines and always insert a generated one" As a workaround we can use a wrapper script as suggested in this thread and in https://www.atwillys.de/content/linux/force-nullmailer-to-use-a-fixed-from-address/:
This will append the address from /etc/nullmailer/allmailfrom as a sender address to every sendmail call. After this the "f" flag will kick in, remove the original from header and all occurences of the original from address will be gone. Now every script on your system can create emails with whatever from addresses it wants, as those addresses will all be overwritten. You only have to make sure to always have NULLMAILER_FLAGS=f set. Add |
Well, darn, just hit this on Debian 12 (Bookworm). I quickly fell in love with the simplicity of nullmailer, but my SMTP server (postmark) is pretty strict about the email address in the From line. I need it to be a specific one. |
Same here, Zoho bounces email with |
Same here. this issue was opened in 2020 and there is no fix for this ignored allmailfrom? Anyone another MTA with retry queu and the option to "rewrite" senders / from like postfix canonical or atleast everytime one fixed sender-address? |
Solved: try MSMTP (https://marlam.de/msmtp/). Working like a charme and yes, sender re-writing works with just one line in the cfg-file. Atleast in Debian it is in the rep (apt-get install msmtp msmtp-mta). Good manual (with cfg - examples) and a bunch of options (https://marlam.de/msmtp/msmtp.html) Happy now, everything works! |
A word of warning - while I agree that
This makes msmtp has (what looks like a somewhat flaky implementation of) a queueing system made up from several shell scripts. More on the topic here: https://wiki.archlinux.org/title/Msmtp#Using_msmtp_offline |
Hi, @ msmtp: you are not right! You just have to install the msmtp-mta package and you have a daemon running, listening on on localhost, port 25 (or whatever IP/port you can set in the cfg) -> https://marlam.de/msmtp/msmtp.html#Example-using-msmtpd-as-a-system-service. After fighting 2 hours with nullmailer (unsuccessful) it took me 5 minutes to setup msmtp (working). You can make a different cfg for every user (systemwide/root and/or user cfgs), can use different smarthosts for different emails, have aliases, can rewrite nearly everything. But best of all: 10 lines in the cfg and is running "out of the box". Everybody is free to use whatever he wants / prefers or might be your preference. I just wanted to mention here because several guys have the same problem and it seems that nobody cares about it (mail from). After nullmailer I decided to install postfix. Just local via smarthost is done in 5 minutes too. But didnt want to have the whole postfix just to relay emails. Then I found msmtp, gave a last try before postfix and bingo ;) |
msmtp-mta package will only give you a simple (relay) daemon listening on localhost sending to smarthost - but still no disk-based queue with periodic retries/retransmits. msmtp-mta package (on archlinux) does not have any systemd service/daemon setup included in the package. I do not currently have the problem with the 'allmailfrom'. My smart host is dedicated - so I could just change the rules on the smart host side - if I had the problem. But still it would be nice if the 'allmailfrom' was fixed in nullmailer. With a quite large number of systems (and even more vm's) running - I prefer receiving all emails (eg warnings from disk smart monitoring tools etc etc) - and I do prefer to get them deferred - not loosing them - in the event that the smart host for some reason is down/unavailable. |
Maybe is an arch - problem? Debian does -> msmtpd.service - msmtp daemon Yes, I want or need status / alarm / ... emails from VM too. But once again: maybe better lose one email than no email. And for users who use gmail, hotmail, web.de, etc. as smarthost: how many times this machines are offline? Regarding the queue I didnt have time to check what happens when smarthost is unreachable. But I remember - when I read (overflew ;) the manual the first time, I read something about "DSN configurations / options". But I didnt read at this moment because was not interesting ;) Think that I read also that there is ETRN availlable? Will doublecheck later if I have more time to play around with it. I didnt want to be OT here too. Therefore I just mentioned that there is an alternative availlable. With working rewrite out of the box for whom it is important and doesnt like "quick & dirty hacks". Who ever has other preferences, has to decide himself which "dead is better" ;) |
@walhallaRV the fact that msmtp can run as a daemon does not imply that it can queue failed messages and retry sending them periodically, which is one of the major features of nullmailer.
I am currently using msmtp with its queue scripts, it has been working okay so far (for automated system mail like cron). |
I just answered to UffeJakobsens coment that msmtp "does not have any systemd service/daemon setup included" - but it has. This is no queuing, sure, I know! If nullmail would have worked like expected (and pronounced) - I would have used. I use msmtp too mainly for sending cron / script reports / results. And it works, I get all emails with correct from. |
I want all the emails that Nullmailer sends to come from email address
new@xxxx.xx
so I set this address in my allmailfrom file. The SMTP relay host I am using expects email from this address, but when I send a test message then there is a bounce in the log file and then it's moved to the failed folder, look at the file the first line implies the re-write has worked but the actual from address in the email is still the old one:This is occurring on Nullmailer 2.2 as distributed with Debian 10.
Is there perhaps another setting I need?
The text was updated successfully, but these errors were encountered: