Search code examples
emaillimitspam-preventionemail-spamqmail

Outgoing mails limit in Qmail


I was googling and found this link helpful https://serverfault.com/questions/538233/qmail-limit-number-of-emails-sent-by-user-or-domain-per-hour

My OS is Centos with Plesk 11.x + Qmail

    I tried my best to follow given directives in the link e.g.
    1) I installed spamdkye successfully 
    2) Created mkdir -p /home/vpopmail/bin/qmail-antispam
    3) mkdir -p /etc/qmailadmin/qmail-spam/blacklist
    4) crontab -e 
    */5 * * * * /home/vpopmail/bin/qmail-antispam >> /var/log/maillog 2>&1

5) I saved script as qmail-antispam as well as moved as blacklist but on both positions it displays:
Code:
# tail -f /var/log/maillog | grep "qmail-antispam"
/bin/sh: /home/vpopmail/bin/qmail-antispam: is a directory
/bin/sh: /home/vpopmail/bin/qmail-antispam: is a directory
Tue Oct 20 12:55:01 CDT 2015 qmail-antispam : Revisando logs
Tue Oct 20 12:55:01 CDT 2015 qmail-antispam : Fin de revision
Tue Oct 20 13:00:01 CDT 2015 qmail-antispam : Revisando logs
Tue Oct 20 13:00:01 CDT 2015 qmail-antispam : Fin de revision

Questions: Please advise where:
1) where I save this script either in /etc/qmailadmin/qmail-spam/blacklist or /home/vpopmail/bin/qmail-antispam and with which name?

2) MAX_CORREOS=3000 //is that to set maximum limit??
ID_SERVER="ID_SERVER" //May I change this to my server hostname??
[email protected] //Here I set admin email to send report. Is that right??

Please advise

Thanks in anticipation


Solution

  • vi /home/vpopmail/bin/qmail-antispam

    copy & paste the script provided in Link Edit script and change following:

    MAX_CORREOS=100 
    ID_SERVER="my server hostname"
    [email protected]
    
    # chown root /home/vpopmail/bin/qmail-antispam
    # chmod 755 /home/vpopmail/bin/qmail-antispam
    

    and check its working fine:

    # tail -f /var/log/maillog | grep "qmail-antispam"
    Wed Oct 21 19:20:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:25:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:30:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:35:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:40:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:45:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:50:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 19:55:01 CDT 2015 qmail-antispam : Revisando logs
    Wed Oct 21 20:00:01 CDT 2015 qmail-antispam : Revisando logs