Exim

From Leaky
Revision as of 22:09, 22 July 2013 by Leaky (talk | contribs)
Jump to: navigation, search

To block any outgoing email from a particular local user, you can use the acl_not_smtp to discard or reject messages that aren't sent via SMTP.

Up near the rest of the acl definitions:

acl_not_smtp = acl_not_smtp

And then somewhere in the acl section:

acl_not_smtp:

 discard condition = ${if eq {$sender_address}{localuser@wood.bocks.com}{yes}{no}}
         message = $sender_address is not permitted to send messages
         log_message = $sender_address is not permitted to send messages

 accept

Using deny instead of discard sends a local bounce back to the user containing this message and then their original message.

Subject: Mail failure - rejected by local scanning code

A message that you sent was rejected by the local scanning code that
checks incoming messages on this system. The following error was given:

 localuser@wood.bocks.com is not permitted to send messages

------ This is a copy of your message, including all the headers. ------