Linulex
Silver Pleskian
This a question for the postfix experts. We still use qmail because we have a very easy script that logs every path a mail is send from. This works wonders to find a hacked/spamming website. Would this work in postfix? If not, would some adjustments help to get it working, or will this never work in postfix?
All that is needed now is to rename /var/qmail/bin/sendmail to /var/qmail/bin/sendmail.real and replace /var/qmail/bin/sendmail with this script
create an amty log with the correct rights, place it in logrotation, etc...
Copyright: some poster on this forum between 2001 and 2005 (can't remember, but i have it from the plesk forum).
regards
Jan
All that is needed now is to rename /var/qmail/bin/sendmail to /var/qmail/bin/sendmail.real and replace /var/qmail/bin/sendmail with this script
create an amty log with the correct rights, place it in logrotation, etc...
Code:
#!/usr/bin/perl -w
# 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);
print INFO "$date - $PWD - @info\n";
my $mailprog = '/var/qmail/bin/sendmail.real';
foreach (@ARGV) {
$arg="$arg" . " $_";
}
open (MAIL,"|$mailprog $arg") || die "cannot open $mailprog: $!\n";
while (<STDIN> ) {
print MAIL;
}
close (INFO);
close (MAIL);
Copyright: some poster on this forum between 2001 and 2005 (can't remember, but i have it from the plesk forum).
regards
Jan