• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Limit number of emails send by PHP mail function

MislavO

Regular Pleskian
Hello, as title says, I'm trying to limit number of emails send by php mail function.

As temporary solution I've disable this option for few domains because spammers are giving me a hard time, but I'm looking for solution how to limit this server-wide. So far I'm unable to find solution on google and I've found only this:

http://www.cyberciti.biz/faq/postfix-limit-incoming-or-receiving-email-rate/
http://serverfault.com/questions/43...f-mails-causing-problems-on-centos-6-plesk-10

Altough this is not reflecting sending mail with php mail function. Thanks in advance
 
Last edited:
Hi, MislavO

You can try to remove localhost (127.0.0.1) from white list in Server-Wide Mail Settings.
This will force PHP web users to use authenticated SMTP connections(using mailboxes).
 
Thanks for the info, altough this is not solution.

I have the same problem and I couldn't find any solution for this. I was thinking to block mail function and force users to use smtp-auth but I want to avoid this.
Could you find any solution for this?
 
MislavO, if you're using Postfix as MTA you can configure a non-SMTP milter for processing emails submitted by the local sendmail wrapper, which is used by PHP mail() function. See http://www.postfix.org/MILTER_README.html#config
You can use something like "mailfromd" as such a milter to apply different sorts of filtering to the submitted email.
If you want to restrict submitted email to just several users only (root, for example) look at "authorized_submit_users" Postfix parameter.
 
Back
Top