[Memphis.pm] Mail::Audit

Brock Sides philarete at mindspring.com
Fri Jul 20 21:50:03 CDT 2001


For anyone who missed my presentation last night on Mail::Audit, or who
just wanted a refresher, here's an article on perl.com about the module:

<http://www.perl.com/pub/a/2001/07/17/mailfiltering.html>

I'll add a few notes of my own:

(1) Sendmail is very picky about your .forward file. Neither it, nor
anything in the path above it, can be group or world writable. If you're
using RH, you're umask is set to 002 by default, so files you create are
group writable by default. You'll get an bounce saying "Unsafe for
mailing to programs".

(2) Any filters need to be located in /etc/smrsh. Otherwise smrsh (the
restricted shell sendmail spawns) will not execute it.

(3) The pod documentation refers to a method called "put", which adds
headers to messages. It's real name in the code is "put_header".

Here's my example from last night:

#!/usr/bin/perl -wT

# Always use the -T flag when processing untrusted data, such as an
# email message. See "perldoc perlsec" for details.

use Mail::Audit;

my $message = new Mail::Audit;

if ($message->subject =~ /XXX/) {
   $message->reject("I don't like spam!");
}

$message->accept;

__END__

-- 
Brock Sides
philarete at mindspring.com

One OS to rule them all, one OS to find them,
One OS to bring them all and in the darkness bind them,
In the land of Redmond, where the shadows lie.
----------------------------------------------------------------------------
To unsubscribe, please send email to majordomo at pm.org
with 'unsubscribe memphis-pm-list' in the body of the message.
----------------------------------------------------------------------------




More information about the Memphis-pm mailing list