Re: [exim] Block all emails from a domain EXCEPT to certain …

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Heiko Schlittermann
日付:  
To: exim-users
題目: Re: [exim] Block all emails from a domain EXCEPT to certain users
Will Smith <will@???> (Di 06 Mai 2014 17:06:46 CEST):
> I thought this would be easier than it is, but I am nervous to pull the
> trigger.
>
> I want to block one entire domain from sending my domain emails, except to
> certain users. For instance, I want to black @senderdomain.net, except when
> the recipient email is will@??? and william@???.
>
> I found a post in the old mailing lists, that said I would need to do
> something like this:
>
> echo 'senderdomain.net: !will : !william : *' >
> /etc/exim4/reject_senderdomain
>
> And then add in my rcpt acl:
> deny recipients = @@lsearch;/etc/exim4/reject_senderdomain
> message = Please redirect all emails to will or william.
>
> So, my question. Will that work for what I want to do?


Probably not.

It will split the current recipient into $local_part and $domain. Then it
will search for $domain in the reject_senderdomain file, but $domain
contains *your* domain, not the senders domain. If you turn this into
deny senders = @@lsearch… it will find the domain of the sender, but
then Exim will compare the $sender_address_local_part with the data
looked up. (If I remember well how @@ works.)

In your recipient acl I'd to something like this:

    acl_check_recipient:


        …
        deny    message        = please send your message to Will
                sender_domains = senderdomain.net
                !local_parts   = will : william



    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: 7CBF764A -
 gnupg fingerprint: 9288 F17D BBF9 9625 5ABC  285C 26A9 687E 7CBF 764A -
(gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B)-