Re: [exim] How to not allow local mail but allow remote mail

Pàgina inicial
Delete this message
Reply to this message
Autor: Dave Evans
Data:  
A: exim-users
Assumpte: Re: [exim] How to not allow local mail but allow remote mail
On Sat, Jan 23, 2010 at 10:09:50PM -0500, Michael Pelletier wrote:
> Hello,
>
> Yes, I know this is a strange request but I have a special need for a configuration that would deny local-to-loca email while allowing remote email.
>
> In other words:
> user1@localdmain to user2@localdomain would be rejected but
>
> user1@localdomain to user2@localdomain, user1@remotedomain would succeed and
>
> user1@localdoamin to user2@localdomain cc user1@localdomain would succeed
>
> In short as long as a local users were sending email to a remote user it will succeed. Only local to local emails would be rejected.


addresslist local_addresses = ...

then in an appropriate ACL:

  deny
    senders = +local_addresses
    condition = ${if forall{<, $recipients}{match_address{$item}{+local_addresses}}}
    message = Wholly local-to-local mail is not allowed


Defining local_addresses, and picking the appropriate ACL and place to which
to add the above fragment, is left as an exercise for you.

http://www.exim.org/exim-html-current/doc/html/spec_html/ch11.html#SECTexpcond
"forall", "forany".

http://www.exim.org/exim-html-current/doc/html/spec_html/ch11.html#SECTexpvar
"$recipients"

--
Dave Evans
http://djce.org.uk/
http://djce.org.uk/pgpkey