• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

Limit send mail by script

Massimo_Dalla_Nora

New Pleskian
Hi,
in my plesk I setted a outgoing mail limits and works fine.
But the problem is in php script and php mail function that they can send mail unlimited.
In this Plesk KB it's write:
<<
This issue has been considered as software issues with IDs #PPPM-2612 and #PPPM-2628 and was fixed in Plesk 12.0, microupdate #39
>>

My plesk version is: 12.0.18 CentOS 6 1200150615.10
and in web gui interface I don't see update to do.
Please can you help me?

Thanks
 
Hi Massimo_Dalla_Nora,

if you dont find the "Updates and Upgrades" option in the Plesk Control Panel, you have always the choice to update/upgrade/patch Plesk over the command line:

/usr/local/psa/admin/bin/autoinstaller --select-product-id plesk --select-release-current --reinstall-patch --install-component base
 
@Massimo_Dalla_Nora,

In order to resolve your issue in a more thorough fashion, be aware that

a) sending mail with the php mail function is not perfectly limited with the outgoing mail control function (despite of the micro-update)

b) configuring a local mail server with a specific mail address and a forward to a (static) mail address is an option, if the receiver of mail is fixed (note: the php mail function will try to deliver mail locally at first and, if the mailbox is present, it will deliver the mail to the local mailbox, after which the mail will be forwarded to the designated mail address. The advantage is that all common mail and security functions do apply on the local mailbox, including the throttling/limitation of outgoing mail)

c) one can easily prevent mail via scripts by implementing the PHPMailer class (with a variety of valuable settings) in a php script (note: when wanting to send mail from WordPress, many good SMTP plugins are available).

The option under point c is very likely to be most suited for what you want to achieve, with some basic SMTP connection to a (local or external) mail server and the advantages of:

- proper authentication,
- preventing spam (by spamfilters and/or mail server settings on the before mentioned mail server),
- preventing that your server is being blacklisted on a DNSBL (note that mail via script often results in your server being blacklisted, sooner or later)
- perfect control over outgoing mail, including limiting/throttling of mail (if the mail server supports that, the Plesk mail servers do support that)
- and so on

and, more important, the ability to "uncheck" the "allow scripts to send mail" (under Server Management > Tools & Settings > Mail Server settings), hence preventing that your server can be used as a mail relay (for spammers and other malicious activities) and/or preventing that your server becomes vulnerable (in general).

In conclusion, try to implement the PHPMailer class (instead of php mail function), in order to establish a proper SMTP connection.

Hope the above helps.
 
Back
Top