• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Resolved MSMTP - 554 error from Ionos

jrolland

New Pleskian
Server operating system version
Debian 12.14
Plesk version and microupdate number
18.0.78 #1
Hello!

I'm having a problem when a Cron job needs to send an email notification via the external SMTP relay (MSMTP).

When I test it via SSH using the following command, I don't encounter any issues:
Code:
echo -e "Subject: SMTP config confirmation\n\nEmail to confirm the SMTP configuration in MSMTP." | msmtp --debug [email protected] [email protected]
And this is what appears in /var/log/maillog:

May 21 00:50:07 serverName msmtp: host=smtp.ionos.fr tls=on auth=on user=[email protected] from=[email protected] recipients=[email protected] mailsize=202 smtpstatus=250 smtpmsg='250 Requested mail action okay, completed: id=1Mrh9Y-1xBDiN11qW-00h4I6' exitcode=EX_OK

But when the Cron job needs to send its notification, this is what appears in the same log:

May 21 01:11:06 serverName msmtp: host=smtp.ionos.fr tls=on auth=on user=[email protected] from=[email protected] recipients=[email protected] smtpstatus=554 smtpmsg='554-Transaction failed\n554-Reject due to policy restrictions.\n554 For explanation visit https://www.ionos.com/help/index.php?id=2425... errormsg='the server did not accept the mail' exitcode=EX_UNAVAILABLE

According to Ionos (https://www.ionos.com/help/index.php?id=2425#c138273), this is apparently due to the email being sent in the wrong format:

554 Transaction failed, reject due to policy restrictions​

Problem:

The email was rejected by the IONOS SMTP server because the standards defined in RFC 5321 and RFC 5322 were not adhered to.

Solution:

The email client must meet the following criteria:

  • The header lines of the email must contain exactly one valid "Date" line according to RFC 2822.
  • The following header lines may only exist once: From, Sender, To, CC, Subject
  • The header lines mentioned must be syntactically correct
Note: The To and CC lines can contain multiple recipients.

Is there anything I can do to fix this?
 
Thank you @Sebahat.hadzhi!

The idea of specifying the sender's address is brilliant.

I wasn't able to use the parameter you suggested adding.

When setting up a Cron Job, I need to set the environment variable MAILFROM="", immediately after defining MAILTO="", for it to work.

Code:
MAILTO="[email protected]"
MAILFROM="[email protected]"
16      12      *       *       *       echo "Test"

This post can now be closed if necessary.
 
Back
Top