mailer-daemon

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
james2607
New user
New user
Posts: 9
Joined: 2016-07-26 09:47

mailer-daemon

Post by james2607 » 2016-07-26 14:00

Hello,
We are currently evaluating Hmailserver and everything is currently running as expected. But we have one question: The non-delivery notifications are sent with from address "mailer-daemon@<Local host name>". For internal usage we would like to have "postmaster@<default domain>". Is there any way to change the from address - maybe via a rule or script?

User avatar
mattg
Moderator
Moderator
Posts: 20222
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: mailer-daemon

Post by mattg » 2016-07-26 14:34

You can catch these with a global rule, and the run a custom function to change the from.

I use FROM contains 'mailer-daemon' to catch them on my system (I send a copy to a specific address)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: mailer-daemon

Post by percepts » 2016-07-26 14:58

+1

except for a very simple action such as only changing the From address you can do it all in the rule without the need for a script function.

You just use the "Set header Value" action and specify "From" and in value put the full email address of what you want it to be.

So you have

criteria:
From / contains / mailer-daemon
X-hMailServer-LoopCount / equals / 1

action:
Set header Value / From / postmaster@domain.com

User avatar
mattg
Moderator
Moderator
Posts: 20222
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: mailer-daemon

Post by mattg » 2016-07-26 15:38

Percepts, that is a great idea.
I've never seen that before
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

james2607
New user
New user
Posts: 9
Joined: 2016-07-26 09:47

Re: mailer-daemon

Post by james2607 » 2016-07-26 16:15

Hi percepts,

Works perfect. Thank you very much for your quick help.

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: mailer-daemon

Post by percepts » 2016-07-26 16:33

mattg wrote:Percepts, that is a great idea.
I've never seen that before
Well yes but it is very dependant on exactly what you want to do and if the rule actions can do it without a script function. And possible conflicts between rules. I also have several rule actions which run functions but always try to avoid using script if I can.

Post Reply