Not true. This support artikel is not working anymore after the update to plesk 17.8.11, atleast not on centos 7. I have been testing with this and another script i use the last few days now and the log stays empty. I was going to open a new post about it, but posting here is just as good. The general idea is that plesk knows about it and fix there artikel so we can crack down on spam once more.
I used to have a permanent script in place to log mails send via websites and that is also not working anymore. Both the support article and my usual script worked fine until plesk 17.5.3
Code:
#!/usr/bin/perl -w
## https://kb.plesk.com/114845
## create as /usr/sbin/sendmail.postfix-wrapper
## chmod a+x /usr/sbin/sendmail.postfix-wrapper
## mv /usr/sbin/sendmail.postfix /usr/sbin/sendmail.postfix-bin
## ln -s /usr/sbin/sendmail.postfix-wrapper /usr/sbin/sendmail.postfix
## create /var/log/formmail 0666
## enable logrotation
## test via website, doesn't work via webmail (is smtp)
# use strict;
use Env;
my $date = `date`;
chomp $date;
open (INFO, ">>/var/log/formmail") || die "Failed to open file ::$!";
my $uid = $>;
my @info = getpwuid($uid);
#if($REMOTE_ADDR) {
#print INFO "$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME \n";
#}
#else {
print INFO "$date - $PWD - @info\n";
#}
my $mailprog = '/usr/sbin/sendmail.postfix-bin';
foreach (@ARGV) {
$arg="$arg" . " $_";
}
open (MAIL,"|$mailprog $arg") || die "cannot open $mailprog: $!\n";
while (<STDIN> ) {
print MAIL;
}
close (INFO);
close (MAIL);
regards
Jan