setec / check-email-loop

Nagios plugin to check email infrastructure via sending & retrieving emails
GNU General Public License v2.0
15 stars 11 forks source link

plesk-sendmail[3207]: S3207: Unable to prepare arguments for mail handlers. #5

Closed futureweb closed 2 years ago

futureweb commented 2 years ago

When using this Plugin to Monitor Plesk Mailserver it throws this Error: plesk-sendmail[3207]: S3207: Unable to prepare arguments for mail handlers.

The cause of the problem is the absence of a new line between the email header and the content in the mails

Previously, OS Sendmail was used instead of Plesk Sendmail when that happened. Therefore, functions such as DKIM did not work. No error message about the problem was printed in the maillog.

In version 18.0.38 of Plesk, such a phenomenon is now recognized as an error. Therefore, before the OS sendmail is executed, Plesk will output an error message and stop sending mail.

To fix the problem I can suggest that you enter a new line between the email header and the content in your website code.

Example (send_mail_ver2):

$ fp = popen ($ new_send_mail_command. "-F". $ Sender_from_addr, "w");
fputs ($ fp, $ subject);
fputs ($ fp, "\ n");
fputs ($ fp, "MIME-Version: 1.0 \ n");
fputs ($ fp, "From:". $ From_addr. "\ N");
fputs ($ fp, "To:". $ To_addr. "\ N");
fputs ($ fp, "Reply-to:". $ Reply_to. "\ n");
fputs ($ fp, "Content-Type: text / plain; charset = \" ISO-2022-jp \ "\ n");
fputs ($ fp, "Content-Transfer-Encoding: base64 \ n");
fputs ($ fp, "X-Mailer: Mailer \ n");
fputs ($ fp, "\ n"); // Add this line.
fputs ($ fp, base64_encode ($ content). "\ n");
bentolor commented 2 years ago

Closed via https://github.com/setec/check-email-loop/commit/e1d63dfd743da5010362f286543bb135e3ee2019 by the contributed patch. Thank you very much!