0

i want to use systemfilter to ignore emails from and to a specific domain with the following rule:

if ("$message_body:, $h_to:, $h_reply_to:, $sender_address" contains "example.com") then fail endif

But the problematic side of this kind of filtering is that it makes delivery failure to the sender which we don't wish for.

We don't wish to disable bounce messages globally so is it possible to Simply drop any message detected by our rule insteal of FAIL and delivery failure?

Please kindly give me an advise. Kind Regards

Armin
  • 25
  • Is there a reason for this over SMTP Reject, just curious (reject, so you would not be generating a NDR, the server communicating with you would.)

    Since this doesn't answer your question, and I am not an exim expert, https://www.tekovic.com/exim-acl-for-blocking-certain-senders

    – Jacob Evans Sep 21 '15 at 19:55

2 Answers2

3

You can 'save' it to /dev/null. No additional processing is done after this as Exim treats it to be a Significant Delivery.

if ("$message_body:, $h_to:, $h_reply_to:, $sender_address" contains "example.com") then save /dev/null endif

The manual contains more information

It is probably also worth bringing up RFC 5321

"As discussed in Section 7.8 and Section 7.9 below, dropping mail without notification of the sender is permitted in practice. However, it is extremely dangerous and violates a long tradition and community expectations that mail is either delivered or returned. If silent message-dropping is misused, it could easily undermine confidence in the reliability of the Internet's mail systems. So silent dropping of messages should be considered only in those cases where there is very high confidence that the messages are seriously fraudulent or otherwise inappropriate."

damolp
  • 331
  • Dear damolp, Thank you for your response. What about this: then seen finish endif – Armin Sep 20 '15 at 18:52
  • i used your suggestion. It doesn't drop the message and the message still remains in queue for being send out of the server. As i realized the save command is for saving a COPY of the message and the main message still remains in queue for processing – Armin Sep 21 '15 at 11:45
  • +1 for the RFC 5321 quote, which made me reconsider this option. – Skippy le Grand Gourou Jun 13 '18 at 09:51
0

The most accurate answer which will drop the email and not processing it anymore for letting go outside or coming inside is: if ("$message_body:, $h_to:, $h_reply_to:, $sender_address" contains "example.com") then save /dev/null finish endif

or

if ("$message_body:, $h_to:, $h_reply_to:, $sender_address" contains "example.com") then seen finish endif

Armin
  • 25