Username:
TITLE
mailhandler ignores small info text in case of REJECT
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
plesk obsidian linux, 18.0.42 Debian 10 - 64 bit, postfix
PROBLEM DESCRIPTION
See following smtp session:
Mailhandler was:
The other side should see "550 5.7.1 Command rejected - this should be seen during REJECT", not a reject without any comment. IIRC this works fine on earlier versions of plesk.
docs.plesk.com
states:
The handler should only write to its standard output after writing PASS or REJECT on the standard error.
For PASS, the output should be a message in the same format as found on input.
I tested this a long time ago, and found in case of REJECT STDOUT is transmitted within the answer to SMTP command.
STEPS TO REPRODUCE
install mailhandler (perl) ( code above) in /usr/local/bin/test and make it executable
Execute following in bash
ACTUAL RESULT
550 5.7.1 Command rejected
EXPECTED RESULT
550 5.7.1 Command rejected this should be seen during REJECT
or
550-5.7.1 Command rejected
550 this should be seen during REJECT
probably the 2nd form ( multiline answer) is expected to use.
ANY ADDITIONAL INFORMATION
(DID NOT ANSWER QUESTION)
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Confirm bug
TITLE
mailhandler ignores small info text in case of REJECT
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
plesk obsidian linux, 18.0.42 Debian 10 - 64 bit, postfix
PROBLEM DESCRIPTION
See following smtp session:
Code:
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 220 puck983.startdedicated.de ESMTP Postfix (Debian/GNU)
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> EHLO foxtrot452.startdedicated.de
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-puck983.startdedicated.de
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-PIPELINING
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-SIZE 10240000
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-ETRN
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-STARTTLS
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-ENHANCEDSTATUSCODES
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-8BITMIME
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-DSN
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250-SMTPUTF8
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250 CHUNKING
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> MAIL FROM:<[email protected]>
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250 2.1.0 Ok
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> RCPT TO:<[email protected]>
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250 2.1.5 Ok
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> DATA
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 354 End data with <CR><LF>.<CR><LF>
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> Content-Disposition: inline
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> Content-Transfer-Encoding: 8bit
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> Content-Type: text/plain; charset=utf-8
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> MIME-Version: 1.0
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> X-Mailer: MIME::Lite 3.030 (F2.85; T2.17; A2.20; B3.15; Q3.13)
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> Date: Sat, 8 May 2021 09:34:27 +0200
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> From: [email protected]
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> To: [email protected]
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> Subject: virustest eicar
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> test ohne eicar-virus
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> .
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 550 5.7.1 Command rejected
sending failed: Net::CMD (Net::SMTP) DATAEND command failed.
Last server message was:5.7.1 Command rejected
Mailhandler was:
Perl:
#! /usr/bin/perl -wtT
#
use strict;
use warnings;
print STDERR "REJECT\n";
print STDOUT "this should be seen during REJECT\n";
exit 1;
The other side should see "550 5.7.1 Command rejected - this should be seen during REJECT", not a reject without any comment. IIRC this works fine on earlier versions of plesk.

Processing Messages
This process consists of three parts: message data is read by a handler from the standard input, processed by the han...
states:
The handler should only write to its standard output after writing PASS or REJECT on the standard error.
For PASS, the output should be a message in the same format as found on input.
I tested this a long time ago, and found in case of REJECT STDOUT is transmitted within the answer to SMTP command.
STEPS TO REPRODUCE
install mailhandler (perl) ( code above) in /usr/local/bin/test and make it executable
Execute following in bash
Bash:
#! /bin/bash
#
# should called with domain.tld as parameter.like
#
# test-on-script example.com
# ins Verzeichnis wechseln
cd /usr/local/psa/admin/bin
CFG=`echo "$1" | tr "." "_"`
# Mailhandler zuweisen
./mail_handlers_control --add --priority=35 --name=test --mailname=$1 --queue=before-queue --type=recipient-domain --executable=/usr/l
ocal/bin/test --context=/usr/local/etc/test.d/${CFG}.ini
./mail_handlers_control --enable --priority=35 --name=test --mailname=$1 --queue=before-queue --type=recipient-domain --executable=/us
r/local/bin/test --context=/usr/local/etc/test.d/${CFG}.ini
exit 0
ACTUAL RESULT
550 5.7.1 Command rejected
EXPECTED RESULT
550 5.7.1 Command rejected this should be seen during REJECT
or
550-5.7.1 Command rejected
550 this should be seen during REJECT
probably the 2nd form ( multiline answer) is expected to use.
ANY ADDITIONAL INFORMATION
(DID NOT ANSWER QUESTION)
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Confirm bug