How can I view emails sent using the PHP mail function and blocked by SPAMASSASSIN?

Procédure

How can I access the PHPMail() function logs?

1. To access the logs for the PHPMail() function on your shared hosting, connect to the management interface for your web hosting and click on the"Apache and PHP logs" button.

How can I view emails sent using the PHP mail function and blocked by SPAMASSASSIN?

2. Go to the bottom of the page, to the"Logs of mail sent using the PHP Mail() function" section to find out more about the sending error.

How can I view emails sent using the PHP mail function and blocked by SPAMASSASSIN?

What are the rules of SpamAssassin and how can I correct the problem?

SpamAssassin runs a number of tests on your messages before they are sent. Depending on the results, a score is assigned to your message.

If the score exceeds a defined threshold, the email is considered spam. A filter is then created to direct the message to the recycle bin. All messages must pass through SpamAssassin before being sent. SpamAssassin sets two new headers in the event of Spam: X-Spam-Status and X-Spam-Level.

The logs allow you to see where the problem comes from and the reason why your email has been considered as Spam. The most common reasons are

  • Sending several thousand emails in a very short space of time (a few seconds)
  • Sending an email to the wrong email address

The log file gives you an overview of the error as well as its source ( incorrect email, coding problem on one of your PHP web pages , for example). When there is too much spam coming from your website, the PHPMail() function may be automatically deactivated for a predefined period.

To obtain the PHP file that caused this blocking/sending, you will need to search for the term X-PHP-Originating-Script in the email that caused the error.

Conclusion

You can now access the logs for the PHPMail() function on your hosting mutuailised with LWS. The logs of the PHPMail() function give you an indication of errors when sending emails.

Don't hesitate to share your comments and questions!

help.lws.net/a/972
Was this article helpful?

Yes

No

Read 28 048 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.