We have two Postfix mailservers in a University environment. There are thousands of servers managed by a dozen different groups, and I do not control all of the hosts. These servers use my mailservers for routing email, either as a Smarthost or using MX records.
Several servers are continuously sending email where the from address is like:
cfengine@host.example.org
These emails are sent to an invalid address, and thus bounce. But since the "From:" address is also invalid, the emails are stuck in an endless bounce loop for several days.
If I list the postfix queue with postqueue -p
shows me hundreds of messages like the following:
ABCD7301713E 3799 Tue Mar 5 05:20:35 MAILER-DAEMON
(delivery temporarily suspended: connect to host.example.org[192.168.100.100]:25: Connection refused)
cfengine@host.example.org
- Using Postfix on the mailservers, is it possible to rewrite either the "From:" address or the "To:" address in these emails? I would like to direct them to the system owners and request that they clean up their systems.
- Can I notify Postmaster about these bounces? Postmaster can then notify the system owners.
Best Answer
Once solution is to notify somebody about the bounces. postmaster is sometimes used for this task. The parameters notify_classes and
bounce_notice_recipient
may allow me to notify the postmaster that bounces are happening.The bounce message may contain the Hostname & IP of the host which is attempting to deliver the email. If not, the administrator can run the
postcat
command on the Message-Id and see the contents of the message (headers and all). From here, we can contact the system owner and ask them to fix the problem on their side.