• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Outgoing mail control does not work for emails sent from web scripts?

Kroptokin

Regular Pleskian
Server operating system version
CentOS Linux 7.9.2009 (Core)
Plesk version and microupdate number
Plesk Obsidian Version 18.0.49
I seem to remember reading somewhere some time ago that the system for controlling outgoing mail does not work with email sent by a website (e.g. by a PHP process running under Apache in some way). I did a test to see if this was the case or not. I set an outgoing email limit for a domain to 10 messages per hour. I used a contact form on the site - which sends email to email on another domain - using PHP to send 15 messages in 10 minutes, I then checked at the 'Outgoing Mail Control' page in Plesk. Where it says "attempts to exceed the limits" nothing was showing. I received all 15 emails. This appears to confirm what I thought - it doesn't work with mail sent from a web process.

I then configured another domain to have a limit of 10 messages. I sent 11 messages via an email client on my local PC. The limit kicked in. However - I realised this because sending from my email client ceased to work and I got a message in the client. Good. However; nothing in the Plesk control panel which still reports "no attempts to exceed limits". The main thing is it worked - as for reporting maybe this will be updated after the full reporting period - so not a problem.

But - if this is correct, and my tests appears to confirm this - this means the system does not control for emails sent by websites (in my case PHP running as FPM). This is a pity because this seems to be the most likely case when it could be useful to be able to monitor excess sending.

However! - it seems there is an easy work around for this. I set the limit on domain A.com to be 10 per hour. I configure my web script to send contacts on the site to [email protected] and I have also configured the mail server to forward emails from [email protected] to [email protected]. This causes emails to be send from one email account to another - and the limit kicks in.

This seems to work for me - but I would be interested if someone can confirm that the system does indeed not work to control emails sent from web scripts. Does it say this somewhere in the current documentation?

Thank you
 
If in the mailserver settings the checkbox "Allow users and scripts to use Sendmail" is checked, scripts can send emails beyond the limit of a specific mailbox or domain, but they will still be limited by the max allowed outgoing mails of the subscription that these scripts belong to.
 
Back
Top