Limit of sent emails

Post Reply
User avatar
myVesta
Site Admin
Posts: 941
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 9 times
Been thanked: 6 times

By default, each email account and website can send a maximum of 40 emails per hour.
(websites are actually limited per user account)

If you want to alter that limit, edit /etc/exim4/exim4.conf.template

Find:

Code: Select all

LIMIT_PER_EMAIL_ACCOUNT_MAX_RECIPIENTS = 15
LIMIT_PER_HOSTING_ACCOUNT_MAX_RECIPIENTS = 5
LIMIT_PER_EMAIL_ACCOUNT_MAX_SENT_EMAILS_PER_HOUR = 40
LIMIT_PER_HOSTING_ACCOUNT_MAX_SENT_EMAILS_PER_HOUR = 40

recipients_max = 150
LIMIT_PER_EMAIL_ACCOUNT are variables for PHP scripts.
LIMIT_PER_HOSTING_ACCOUNT are variables for SMTP authenticated users.
MAX_RECIPIENTS is variable for maximal number of TO+CC+BCC email addresses.
MAX_SENT_EMAILS_PER_HOUR is rate limit of sent emails per one hour.
recipients_max is a hard code limit for MAX_RECIPIENTS, which means that it should be larger than the largest defined MAX_RECIPIENTS.

After changes restart exim:

Code: Select all

systemctl restart exim4
In case you have these files on your server:

Code: Select all

/etc/exim4/limit_per_email_account_max_recipients
/etc/exim4/limit_per_email_account_max_sent_emails_per_hour
/etc/exim4/limit_per_hosting_account_max_recipients
/etc/exim4/limit_per_hosting_account_max_sent_emails_per_hour
... you can edit them and redefine limits for specific email addresses or hosting accounts.
Example for email accounts: And example for hosting accounts:

Code: Select all

myacc: 300
testacc: 400
There is no need to restart exim4 after altering these files.
What is not defined here will use global values from exim4 conf from the beginning of this article.



All sent emails will be logged to /var/log/exim4/mainlog file (with a counter per each user)
Example for website:

Code: Select all

2020-07-25 21:41:46 1jzQ3G-0002Qp-8w U=forum Warning: Sender rate [limitlog]: log / account / forum / 7.0 / 1h [limit=40]
Example for email account:

Code: Select all

2020-07-25 20:54:33 H=(DESKTOPGFKPG74) [188.255.1xx.xx] Warning: Sender rate [limitlog]: log / email / [email protected] / 4.0 / 1h [limit=40]



If you can't find LIMIT_PER_EMAIL_ACCOUNT_MAX_RECIPIENT, etc... you have an old exim4 config file.
In that case, find:

Code: Select all

  deny message = Web site is sending too much emails [limitlog]: deny / account / $authenticated_id / $sender_rate / $sender_rate_period
  ratelimit = 40 / 1h / $authenticated_id
This is a limit for PHP scripts (websites), limited to 40 emails per hour per user account.
You can alter 40 to any larger number if you want a wider limit.
Also find:

Code: Select all

  deny message = Email account is sending too much emails [limitlog]: deny / email / $authenticated_id / $sender_rate / $sender_rate_period
  ratelimit = 40 / 1h / $authenticated_id
This is a limit for each email account (authenticated with username and password on SMTP protocol), limited to 40 emails per hour per email account.
You can alter 40 to any larger number if you want a wider limit.

After changes restart exim:

Code: Select all

systemctl restart exim4

Tags:
Jpsciolli
Posts: 13
Joined: Sun Feb 21, 2021 6:54 pm

Hello.

I am wondering if myVesta through this configuration can be suitable for transactional emails.
Actually they need to be fast, reliable and to a large quantity of recipients.
Do you think myVesta can be used for that?

Is there any solution you recomend?

Thanks!
putude
Posts: 12
Joined: Tue Jun 30, 2020 6:06 am

Hello master,
is there any way to trigger a message to [email protected] when the user reached the limit ?
cimek82
Posts: 1
Joined: Thu Oct 05, 2023 3:03 pm

Hello,
Is it possible to remove restrictions for only one email account?
Post Reply