Re: [exim] Exim run external script

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Always Learning
Data:  
Para: Exim
Asunto: Re: [exim] Exim run external script

On Mon, 2016-05-16 at 18:19 -0300, Jorge wrote:

> With your suggest I have found that the problems is due to my script use
> iptables linux command and it is not posible to use it from exim because I
> need root permissions.


In Linux (Centos 5 & 6), Exim can optionally run a PHP script. In that
PHP script I run this command

exec("sudo -u root -t pts/1 /sbin/iptables -A 2email.".$mm." -j DROP -s
".$ip);


Notes:
    2email = table name
    $mm = current month
    $ip = sender's IP address.


In the /etc/sudoers file I have:-

    exim xxx.xxx.com=/sbin/iptables -A 2email.* -j DROP -s *


Notes:
    'exim' distinguishes this line from lines used for
        other applications, example Apache
    xxx.xxx.com the MTA's host name.
    2email = IPtables table names




--
Regards,

Paul.
England, EU.      England's place is in the European Union.