A long time ago, i wrote some mailhandlers ( check email for viruses using ClamAV and Sophos AV; wrapper for renattach ( a program which renames appended files ) ...
works fine since about Plesk 10
Works still on current Plesk 18 with a minor bug:
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.
In my case my virushandler is affected, because it rejects the mail as expected, but don't deliver any cause to the other side. It's hard to guess why the mail couldn't be sent for the guys who try to send me a virus they don't know about.
handler is activated by
PS: of course i've read about the special forum for bugs. a try told me not have permission to view the page with the form.
works fine since about Plesk 10
Works still on current Plesk 18 with a minor bug:
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:<ro_ot@foxtrot452.startdedicated.de>
MIME::Lite::SMTP=GLOB(0x564b72abadc0)<<< 250 2.1.0 Ok
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> RCPT TO:<post_master@service.heirich.eu>
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: ro_ot@foxtrot452.startdedicated.de
MIME::Lite::SMTP=GLOB(0x564b72abadc0)>>> To: po_stmaster@service.heirich.eu
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.
In my case my virushandler is affected, because it rejects the mail as expected, but don't deliver any cause to the other side. It's hard to guess why the mail couldn't be sent for the guys who try to send me a virus they don't know about.
handler is activated by
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
PS: of course i've read about the special forum for bugs. a try told me not have permission to view the page with the form.