Page 4 of 5
Re: Limit emails per hour per domain
Posted: Tue Nov 21, 2017 7:07 pm
by joni
Hallo, in Centos 7 what file should be dited instead thi File to edit: /etc/exim4/exim4.conf.template
and are the steps the same?
Re: Limit emails per hour per domain
Posted: Wed Feb 21, 2018 4:31 pm
by dpeca
/etc/exim/exim.conf
Steps are the same.
Re: Limit emails per hour per domain
Posted: Tue Feb 27, 2018 4:14 pm
by ServerHost
How to do to limit by domain, in the same way as it is done in cpanel? This script only limits the per-user and email account. Not limited by domain.
Also it has a problem it limits the emails of the root user and admin.
Re: Limit emails per hour per domain
Posted: Tue Feb 27, 2018 7:08 pm
by DarthVader
File: /etc/exim/exim.conf
Section: acl_check_mail
deny message = "Slowdown"
log_message = "Ratelimit overload"
ratelimit = 60 / 1h / strict / $sender_host_address
Re: Limit emails per hour per domain
Posted: Tue Mar 20, 2018 12:06 pm
by MAN5
1. $sender_address_domain > will limit per domain.
2. $sender_address > Will limit according to the email send authenticated user.
(i.e) if you use sendmailer/PHPmailer - it will take the hosting account name as a sender to count.
If you use SMTP auth (like outlook/thunderbird etc..) - the sender email address as SMTP auth - the email-ID will be counted.
Re: Limit emails per hour per domain
Posted: Tue Jul 10, 2018 2:47 pm
by ServerHost
How to exclude server hostname from limit?
Do not limit e-mails from daemon@hostname, root@hostname, admin@hostname, xxxxxx@hotname
Re: Limit emails per hour per domain
Posted: Tue Jul 10, 2018 2:54 pm
by MAN5
Just a simple sample:
#for PHP scripts, sendmailer, phpmailer, limit per domain
acl_not_smtp:
deny message = $reply_address Sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
senders = !lsearch;/server-path-to-file/exim-whitelist
ratelimit = 60 / 60m / strict / $reply_address
accept
And create a file '/server-path-to-file/exim-whitelist' >>> put your prime emails. (eg)
[email protected],
[email protected]
Re: Limit emails per hour per domain
Posted: Mon Jul 23, 2018 6:29 pm
by ServerHost
MAN5 wrote: ↑Tue Jul 10, 2018 2:54 pm
Just a simple sample:
#for PHP scripts, sendmailer, phpmailer, limit per domain
acl_not_smtp:
deny message = $reply_address Sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
senders = !lsearch;/server-path-to-file/exim-whitelist
ratelimit = 60 / 60m / strict / $reply_address
accept
And create a file '/server-path-to-file/exim-whitelist' >>> put your prime emails. (eg)
[email protected],
[email protected]
Thanks but it did not work.
Re: Limit emails per hour per domain
Posted: Wed Aug 08, 2018 6:19 pm
by alexcy
I believe that this should be implemented in the default Vesta configuration. Maybe more loose limits but it shouldn't be left unlimited. What do you think?
Re: Limit emails per hour per domain
Posted: Sun Aug 16, 2020 11:43 am
by boxygen
Summarizing this Discussion for Emails Limit Per Domain Per Hour
File to edit: /etc/exim4/exim4.conf.template
Find the word
begin acl
put the below code before the above word
put the below code after the word
begin acl
Code: Select all
# for PHP scripts, limit per vesta user
acl_not_smtp:
deny message = The $sender_address_domain domain is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 20 / 1h / $sender_address_domain
accept
Find the word
acl_check_rcpt:
accept hosts = :
put the below code below the above words
Code: Select all
# for SMTP authenticated users, limit per email account
deny message = Email account $sender_address_domain is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 20 / 1h / $sender_address_domain