We use the Forward and WebForm modules. In both of those modules, we set the "From" address to our webmaster email which does exist.
We've been getting bounces from aol.com and some other recipients due to an invalid return address/domain may not exist.
When I get the delivery report, it says the sender is apache@***-web01.localdomain where *** is our agency.
That is not the address we have specified. The email address is webmaster@***.***.gov where *** is our agency and state.
I have been doing all kinds of research and I created a module to force the sender. Here's the code (note again that * is our agency):
// If this is an email to the Listserv, then we need to
// strip out the Sender header or else the people will never get
// their subscriptions. There is no way to change how Listserv
// works, so this seems to be the only solution at this time.
function nysopwdd_mail_mail_alter(&$message) {
if (strpos($message['to'], 'LISTSERV.***.***.GOV') !== false) {
unset($message['headers']['Sender']);
unset($message['headers']['Errors-To']);
}else{
// otherwise, explicitly set the from, sender, and errors-to
// to webmaster. I have no idea how else to get these emails
// to resolve properly.
$message['from'] = 'webmaster@***.***.gov';
$message['headers']['Sender'] = 'webmaster@***.***.gov';