Setting Mail Limits has no effect

Hi,

I am having a bit of trouble with rate limits on Exim. By default, it seems to limit everybody to 200 Mails per hour. As I have one domain sending a Newsletter, I set the limit for that particular domain to 9999. Unfortunately, this did have no effect and I got mails rejected mentioning I exceeded the limit by sending 200.5 mails / hour.

Then I tried to set the enhanced rate globally (exim-conf-template) to 4000 per hour. This also had no effect and I still got the rejected mails.

Also, changing the value in /etc/exim4/limit.conf directly did not change the behaviour.

What am I missing?

The sending software is a PHP application (ACYMailing), which worked before on another server. There is no rate limiting within that application.

Any suggestion welcome.

Cheers,
Stefan

Hestia Control Panel: v1.9.4
Operating System: Ubuntu 24.04 (x86_64)

Hi,

Limits used in limit.conf or in limit per mail domain is only valid for SMTP sessions used by authenticated users. For PHP scripts it uses a hardcoded limit of 200.

What did you modify in /etc/exim4/exim4.conf.template?

The part for PHP scripts is this one:

# Limit per user for PHP scripts
acl_not_smtp:
  deny    message       = Website of user $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
  ratelimit             = 200 / 1h / $authenticated_id

  warn    ratelimit     = 100 / 1h / strict / $authenticated_id
  log_message           = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period

  accept

Remember to backup the file /etc/exim4/exim4.conf.template and restart Exim after the changes.

systemctl restart exim4
3 Likes

Hi,

Ok. Not sure, whether the Mailer uses SMTP. Maybe not.

Yes, that’s the part I modified. Changing 200 to 4000 and 100 to 2000. I am quite sure to have restarted exim, but I will recheck.

Thanks,
Stefan

Ok, the changes now seem to have had an effect. Strange. I modified the template via HestaCP where it has this “restart” checkbox. But it seems it did not have the desired effect.

Thanks and all the best,
Stefan

1 Like

Glad you solved it :wink:

Hestia internally restarts exim4 service like this:

systemctl reload-or-restart exim4

As Exim supports reload, it is reloaded instead of restarted and seems Exim needs to be restarted to apply the new hardcoded ratelimit.

1 Like

Hey,

Might be good to have a second checkbox then. :smirking_face:

Cheers,
Stefan