My activities New request

contact atmail support

PH: +61 (7) 5357-6605

support@atmail.com

Follow

Stopping Users from Spamming with your Atmail Server

Stewart -

PROBLEM
I want to limit the number of emails that are allowed to be sent per hour.

ENVIRONMENT

  • On-Premise Server + WebMail Installations: Version 6.0 > Current Version

CAUSE
When an email is sent, this method uses the Atmail MySQL DB to check if a user has sent more than 100 emails in the last hour.  If the 100 email limit has been exceeded, the email will not send.

RESOLUTION

  1. Firstly, open up /usr/local/atmail/mailserver/configure with your favourite text editor.
  2. Find where in the file MySQL queries are stored (you can usually search for MYSQL_*) and add the following line:
    MYSQL_SENDLIMIT = select count(id) from Log_SendMail where LogDate > DATE_SUB(NOW(), INTERVAL 60 MINUTE) AND Account = '${sender_address}';
  3. Now find the access control list (search "begin acl") and add the following lines:
    deny   condition = ${if > {${lookup mysql{MYSQL_SENDLIMIT}}}{100}}
    #If you want to include mail relay IP's, comment out the following line
    hosts = !+relay_from_hosts
    message = MAXIMUM SEND QUOTA EXCEEDED
  4. Save change and restart Atmail.
    % /etc/init.d/atmailserver restart
Have more questions? Submit a request

Comments