Re: [exim] Exim run external script

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Always Learning
Datum:  
To: Exim
Betreff: 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.