Hourly/daily limit for SMTP

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Hello,

i can limit number of e-mails sent per domain or per cpanel account if im not wrong
there are people who use SMTP to send out e-mail. Is the hourly limit valid also for SMTP?
If not, how to limit amount of e-mail sent out via SMTP?

Thank You
 

24x7ss

Well-Known Member
Sep 30, 2014
272
17
68
India
cPanel Access Level
Root Administrator
Twitter

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Was not answer to my question. I was already aware about domain/account based mail limitting. Here im asking about SMTP only.

Regarding mentioned "SMTP restrictions" feature, i think (per its description) this feature just stop people using external mailserver, not mine mailserver. My aim is to limit MY own mailserver abuse. So this is also not related feature i think.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
  • Like
Reactions: postcd

ebizindia

Well-Known Member
Oct 13, 2005
105
4
168
Kolkata, India
cPanel Access Level
Root Administrator
I am also interested in this question. Here is a scenario:

The account of the user [email protected] gets hacked. The account starts sending 1000s of emails. Now if I can restrict this user to 100 emails per hour (or any arbitrary limit), we can control spam burst to a great extent.

I can understand this is not possible through Cpanel currently. can some other solution be worked out? I want to limit emails by 'From user' or 'Auth by' id, not IP or the entire domain.

Thanks!
 
  • Like
Reactions: postcd

postcd

Well-Known Member
Oct 22, 2010
717
19
68
@cPanelMichael, thanks for the link, but i can't find "smtp" phrasse on that page. My question was about SMTP and its limits. On that page is mentioned email/mail, but not sure if WHM authors mean also SMTP, please kindly respond accordingly or read my first post. Hope you can answer if SMTP is also limitted when i limit mail per account or per domain. Or how to limit it.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
I can understand this is not possible through Cpanel currently. can some other solution be worked out? I want to limit emails by 'From user' or 'Auth by' id, not IP or the entire domain.
It's possible, per the instructions at:

How to Prevent Spam with Mail Limiting Features - cPanel Knowledge Base - cPanel Documentation

thanks for the link, but i can't find "smtp" phrasse on that page.
Yes, these options apply to outgoing emails, sent via the SMTP protocol.

Thank you.
 
  • Like
Reactions: postcd

postcd

Well-Known Member
Oct 22, 2010
717
19
68
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463

garconcn

Well-Known Member
Oct 29, 2009
159
14
68
We are using CSF firewall Relay Tracking to achieve this.

Relay Tracking. This allows you to track email that is relayed through the
server. There are also options to send alerts and block external IP addresses
if the number of emails relayed per hour exceeds configured limits. The
blocks can be either permanent or temporary.
We also set ratelimit in Exim Advanced Editor under acl_not_smtp >> custom_begin_outgoing_notsmtp_checkall for script emails.

# Ratelimit sender exceed 100 messages per hour
warn

ratelimit = 100 / 1h / per_rcpt / strict / $authenticated_id
delay = ${eval: ${sg{$sender_rate}{[.].*}{}} - \
$sender_rate_limit }s
log_message = "Sender rate $sender_rate / $sender_rate_period - Delayed $authenticated_id"
# Ratelimit sender end
 
  • Like
Reactions: x-origin

Dhrupodi

Member
Sep 8, 2019
22
1
3
root
cPanel Access Level
Root Administrator
Hi @garconcn ,

Pardon my ignorance.

I have set up Relay tracking in CSF. I am not sure whether the limits are on a per domain, or cPanel user or client IP.

Also, the script you shared seemed to be restricting emails sent to per recipient, 100 emails per hour per recepient. It does not limit a sender to send more than 100 emails to more than 100 recipients, am I correct?