Difference between revisions of "Exim"

From Leaky
Jump to: navigation, search
(Preventing local users from sending email)
 
m
Line 8: Line 8:
  
 
  acl_not_smtp:
 
  acl_not_smtp:
 
+
 
   discard condition = ${if eq {$sender_address}{localuser@wood.bocks.com}{yes}{no}}
 
   discard condition = ${if eq {$sender_address}{localuser@wood.bocks.com}{yes}{no}}
 
           message = $sender_address is not permitted to send messages
 
           message = $sender_address is not permitted to send messages
 
           log_message = $sender_address is not permitted to send messages
 
           log_message = $sender_address is not permitted to send messages
 
+
 
   accept
 
   accept
  

Revision as of 19:39, 22 July 2013

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. ------