Allows you to search a variety of questions and answers
Original URL: http://www.farhad.ca/2006/07/27/how-...sages-in-exim/
Problem: When a mail server accepts a message and later decides that it can’t deliver the message, it is required to send back a bounce email to the sender of the original message. These bounce emails are often misdirected.
For many MTAs there are solutions, so here is my solution for exim:
Solution: This solution uses filtering to discard bounced back emails. So your exim should have a central filter. Such filter can be configured in exim.conf configuration file like this:
system_filter = /etc/antivirus.exim
Where antivirus.exim is the filter file, Format of this file described in exim documentation:
http://www.exim.org/exim-html-4.62/doc/html/filter.html
Most CPanel boxes have this filter already set and working. Usually default filter file has these lines at the beginning
Code:
if not first_delivery then finish endif
That means rest of the filter conditions will be ignored if that’s not the first delivery. To make sure you should put the bounce filter before those conditions or filter may not work properly.
Now the bounce conditions itself. Here is the code:
Code:
if $sender_address is "" then if ${lookup{${extract{2}{@}{$recipients}}}lsearch{/etc/localdomains}{yes}{no}} is "no" then noerror fail text "Delayed bounce message ignored" seen finish endif endif
Save and then run these commands:
/scripts/restartsrv exim
/scripts/restartsrv spamd
This will discard any delayed bounce message. If you want to receive a copy of the discarded message (just to make sure it works) use this code:
Code:
if $sender_address is "" then if ${lookup{${extract{2}{@}{$recipients}}}lsearch{/etc/localdomains}{yes}{no}} is “no” then headers add “Old-Subject: $h_subject:” headers remove “Subject” headers add “Subject: [Delayed Bounce]$h_old-subject:” headers remove “Old-Subject” deliver “[email protected]” fail text “Delayed bounce message ignored” seen finish endif endif
Save and then run these commands:
/scripts/restartsrv exim
/scripts/restartsrv spamd
Make sure to replace the [email protected] with your email address.
I have been using AYK for about 2 years now and they are always on top of any issues I have. They have gone over and beyond helping me with any problems that come up with the server and they have never said "no" to any of my requests. I would definitely recommend them to anyone looking for a reliable server company.
I very seldom contact support, but if I do, the response is always prompt and issues are always resolved.
You can trust your business with AYKsolutions After a horrible experience with my prior host that left me with over 14 hours of downtime, AYKSolutions came in, took care of the transfer completely and made my life easier. When they say their servers are semi-managed, it means they take care of more then most managed server hosting companies. Average ticket response time? 2-5 minutes. One time i n the middle of the night it took 30 minutes. Problems that I create are fixed immediately and they take care of their customers. Artyom is the owner, who is somehow capable of not sleeping. He's always there to take care of everything with a personal touch. 3 AM on a Saturday? Not an issue for AYKSolutions. Trust me, I'm very thorough in researching a company. When it comes to business, you can never be too careful. I trust my business with AYKSolutions