Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion Debian/Ubuntu
  • Search

Limit emails per hour per domain

Debian/Ubuntu related topics
Post Reply
  • Print view
Advanced search
41 posts
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
mike08
Posts: 160
Joined: Sat Jun 20, 2015 7:12 am

Os: Debian 6x
Web: apache + nginx
Limit emails per hour per domain
  • Quote

Post by mike08 » Thu Sep 08, 2016 9:03 pm

Hi there,

So, I'm having an issue while applying the answer from this post viewtopic.php?t=8246

Once I restart exim I get the following message:
[....] Stopping MTA for restart:2016-09-08 14:51:29 Exim configuration error in line 338 of /var/lib/exim4/config.autogenerated.tmp:
option "acl_not_smtp" unknown
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
/var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated

I'm running vesta v16, Debian 7 64 bits and exim4.80

I have added those values above the rewrite section
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Limit emails per hour per domain
  • Quote

Post by skurudo » Fri Sep 09, 2016 1:00 pm

Code: Select all

begin acl

        acl_check_rcpt:
                deny message = Sender rate SMTP overlimit - $sender_rate / $sender_rate_period
                ratelimit = 100 / 1h / leaky

                accept  hosts = net-lsearch;/etc/exim/whitelist
and this?
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Limit emails per hour per domain
  • Quote

Post by dpeca » Fri Sep 09, 2016 2:29 pm

This works for me:
(I bolded the things that I added in config file)

######################################################################
# ACL CONFIGURATION #
# Specifies access control lists for incoming SMTP mail #
######################################################################

acl_not_smtp = acl_not_smtp

begin acl

....
......
......
....

acl_not_smtp:
deny message = Sender rate overlimit - $sender_rate / $sender_rate_period
ratelimit = 3 / 1h / leaky
accept


But the problem is - this is not limit per account but per server?
I tried to send from different emails - and limit is counted for all email account together - not separated per email account.
Or Exim recognize me as the same user via my IP address?
I'll check...
Edit: Nope.
It's a limit for whole server.
Top

mike08
Posts: 160
Joined: Sat Jun 20, 2015 7:12 am

Os: Debian 6x
Web: apache + nginx
Re: Limit emails per hour per domain
  • Quote

Post by mike08 » Fri Sep 09, 2016 3:20 pm

What if it is tested with?

Code: Select all

acl_not_smtp:
deny message = Sender rate overlimit - $sender_rate / $sender_rate_period
ratelimit = 3 / 1h / per_rcpt / leaky
accept
Not yet at home so I can't test it.
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Limit emails per hour per domain
  • Quote

Post by dpeca » Fri Sep 09, 2016 3:57 pm

The same thing.

2016-09-09 17:47:39 1biO1j-0006Sn-3y F=<[email protected]> rejected by non-SMTP ACL: Sender rate overlimit - 3.0 / 1h
2016-09-09 17:47:39 1biO1j-0006Sp-50 F=<> rejected by non-SMTP ACL: Sender rate overlimit - 3.0 / 1h
2016-09-09 17:47:39 1biO1j-0006Sp-50 Error while reading message with no usable sender address (R=1biO1j-0006Sn-3y): rejected by non-SMTP ACL: Sender rate overlimit - 3.0 / 1h
2016-09-09 17:47:39 1biO1j-0006Sn-3y Child mail process returned status 1


This is OK, because it's the first email account, sent 2 emails, he could not sent third email.

2016-09-09 17:48:41 1biO2j-0006TC-B8 F=<[email protected]> rejected by non-SMTP ACL: Sender rate overlimit - 2.9 / 1h
2016-09-09 17:48:41 1biO2j-0006TE-C7 F=<> rejected by non-SMTP ACL: Sender rate overlimit - 2.9 / 1h
2016-09-09 17:48:41 1biO2j-0006TE-C7 Error while reading message with no usable sender address (R=1biO2j-0006TC-B8): rejected by non-SMTP ACL: Sender rate overlimit - 2.9 / 1h
2016-09-09 17:48:41 1biO2j-0006TC-B8 Child mail process returned status 1


But this is another domain, another email account... that didn't sent emails, but limit see it as the same thing.
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Limit emails per hour per domain
  • Quote

Post by dpeca » Fri Sep 09, 2016 4:45 pm

This:

Code: Select all

  ratelimit = 2 / 1h / $sender_address
Works.

But I wonder is it possible for spammer just to change email in From: field and continue to send spam?

Edit: yep :(

Any idea what is a variable for authenticated username?
Something from here - http://www.exim.org/exim-html-current/d ... SECTexpvar ?
Top

mike08
Posts: 160
Joined: Sat Jun 20, 2015 7:12 am

Os: Debian 6x
Web: apache + nginx
Re: Limit emails per hour per domain
  • Quote

Post by mike08 » Fri Sep 09, 2016 6:50 pm

Just found this:

Code: Select all

acl_not_smtp:
deny authenticated = *
ratelimit = 300 / 1h / strict / ${authenticated_id}_minute
message = Sending rate exceeded, $sender_rate/$sender_rate_period \
(max $sender_rate_limit/$sender_rate_period)
logwrite = :main,reject: \
Rate exceeded: $sender_rate/$sender_rate_period \
(max $sender_rate_limit) $message_id \
$sender_address ($sender_host_name[$sender_host_address]) \
-> $local_part@$domain
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Limit emails per hour per domain
  • Quote

Post by dpeca » Fri Sep 09, 2016 6:52 pm

and is it working?
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Limit emails per hour per domain
  • Quote

Post by dpeca » Fri Sep 09, 2016 7:03 pm

On my server ${authenticated_id} has 'admin' value, even I didn't logged as admin.
And that value is the same for all email accounts, so it's not working.
Top

mike08
Posts: 160
Joined: Sat Jun 20, 2015 7:12 am

Os: Debian 6x
Web: apache + nginx
Re: Limit emails per hour per domain
  • Quote

Post by mike08 » Fri Sep 09, 2016 7:13 pm

Yeah, it isnt working for me either, all messages are being rejected.
Top


Post Reply
  • Print view

41 posts
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next

Return to “Debian/Ubuntu”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password