We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Limit emails per hour per domain
Re: Limit emails per hour per domain
You are a crack, it indeed work, it wasn't working for me the php scripts earlier as I was testing it with roundcube using the ww-data user, however it indeed blocks or limits connections for the entire account, useful when users are using old wordpress instances, outdated plugins or nulled content.
Good job.
Good job.
Re: Limit emails per hour per domain
One is glad to be of service ;)
This will also helps me, because I have a lot of servers :)
This will also helps me, because I have a lot of servers :)
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Limit emails per hour per domain
dpeca,
Can you please check if I got it correctly ?
What is this line ?? where to put it ?
nano /etc/exim4/exim4.conf.template
# inside the section that says
# Towards the end of the section add the following text
Did I get it all correct ?
Can you please check if I got it correctly ?
What is this line ?? where to put it ?
Code: Select all
acl_not_smtp = acl_not_smtp
# inside the section that says
Code: Select all
begin acl
Code: Select all
# for PHP scripts, limit per Vesta user
acl_not_smtp:
deny message = Web site of $authenticated_id user is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 20 / 1h / $authenticated_id
accept
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Limit emails per hour per domain
thx dpeca
Yes I got it later...!! thanks
Yes I got it later...!! thanks
Re: Limit emails per hour per domain
To Summarize it all, here is what you have to do to get it all working. I had to read both threads until I get it right.
File to edit: /etc/exim4/exim4.conf.template
File to edit: /etc/roundcube/defaults.inc.php
Change the settings in red to match those posted here.
File to edit: /etc/exim4/exim4.conf.template
Find:Before, add:Code: Select all
begin acl
Find:Code: Select all
acl_not_smtp = acl_not_smtp
After, add:Code: Select all
begin acl
Find:Code: Select all
# for PHP scripts, limit per vesta user acl_not_smtp: deny message = Web site of $authenticated_id user is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period ratelimit = 20 / 1h / $authenticated_id accept
After, add:Code: Select all
acl_check_rcpt: accept hosts = :
Code: Select all
# for SMTP authenticated users, limit per email account deny message = Email account $authenticated_id is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period ratelimit = 20 / 1h / $authenticated_id
File to edit: /etc/roundcube/defaults.inc.php
Change the settings in red to match those posted here.
$config['smtp_server'] = 'localhost';
// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 25;
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
Re: Limit emails per hour per domain
Excelent kronz, thank you for summarizing :)
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Limit emails per hour per domain
A small clarification I need... Say I want to create MULTIPLE ACLs for acl_not_smtp:
I would only once define:
correct ??
Then
how do I define Multiple Acls per hour, per minute, per second like this ??
Am I doing it correctly ??
Sorry the Exim documentation is too damn reference only, no real examples to show real syntax. Please help me for this.
I would only once define:
Code: Select all
acl_not_smtp = acl_not_smtp
Then
how do I define Multiple Acls per hour, per minute, per second like this ??
Code: Select all
acl_not_smtp_s:
deny message = Web site of $authenticated_id user is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 20 / 1s / $authenticated_id
accept
Code: Select all
acl_not_smtp:
deny message = Web site of $authenticated_id user is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 200 / 1h / $authenticated_id
accept
Sorry the Exim documentation is too damn reference only, no real examples to show real syntax. Please help me for this.
Re: Limit emails per hour per domain
Only one
and then:
Code: Select all
acl_not_smtp = acl_not_smtp
Code: Select all
acl_not_smtp:
deny message = Web site of $authenticated_id user is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 20 / 1s / $authenticated_id
deny message = Web site of $authenticated_id user is sending too much emails - rate overlimit = $sender_rate / $sender_rate_period
ratelimit = 200 / 1h / $authenticated_id
accept
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: Limit emails per hour per domain
Hey Dpecca,
Thanks a ton ... got the same reference from a friend... Will test it out soon and post results
Thanks a ton ... got the same reference from a friend... Will test it out soon and post results