Michael Mertel writes:
 > after having a few frustrating hours I cannot see any option to force qmail or any 
 >related
 > program to tell me which IP address sent a message in which size.
 > 
 > sendmail is usually providing me with this information as relay= and size= in the 
 >from= 
 > line of my syslog output.

cd /usr/local/src/qmail-1.03
cat <<EOF >extra.h
#ifndef EXTRA_H
#define EXTRA_H

#define QUEUE_EXTRA "Talias-acct\0"
#define QUEUE_EXTRALEN 12

#endif
EOF

make setup

echo '|./acct' >~alias/.qmail-acct

cat <<EOF >~alias/acct
#!/usr/bin/perl

$size = (stat STDIN)[7];
while(<>) {
    last if /^$/;
    $address = $2 if /^Received:.*\((.*\@)?(\d+\.\d+\.\d+\.\d+)\)/;
    $ip = $address if /^  by .+ with SMTP;/;
}

print "size=$size relay=$ip";
EOF
chmod 755 ~alias/acct

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | Government schools are so
521 Pleasant Valley Rd. | +1 315 268 1925 voice | bad that any rank amateur
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | can outdo them. Homeschool!

Reply via email to