[exim-dev] [Bug 838] Could perl be used for routers and ACLs…

Góra strony
Delete this message
Reply to this message
Autor: Martin Nicholas
Data:  
Dla: exim-dev
Stare tematy: [exim-dev] [Bug 838] New: Could perl be used for routers and ACLs.
Temat: [exim-dev] [Bug 838] Could perl be used for routers and ACLs.
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=838




--- Comment #2 from Martin Nicholas <reply-2009@???> 2009-05-30 18:35:41 ---
I'm thinking of replacing the ACLs and router string with perl scripts and
hooks to the Exim library:

deny message       = Restricted characters in address
     domains       = +local_domains
     local_parts   = ^[.] : ^.*[@%!/|]


In Perl:

my %local_domains = ('exim.org' => 1, 'bugs.exim.org' => 1);

sub acl_check_rcpt {
    if ($Exim::local_part =~ m/^(\.|\.*[@%!/|])/o and
        exists $local_domains{$Exim::domain}) {
                Exim::acl_deny('Restricted characters in address'); return}
}


This example looks bulkier in Perl than exim ACL code, but add in some
conditional string expansions and ACLs can become horribly difficult to
understand and write, or is that just me? ;-)


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email