#!/usr/bin/perl # Simple script for catching email bounces use strict; use Email::Simple; # Configuration my @valid_email = qw( pete@clueball.com sheriff@linuxufo.com ); my $modify_subj = 1; # Gubbins my $email_source = join '', (<>); my $email = Email::Simple->new($email_source); my ( $subject, $to ) = ($email->header("Subject"), $email->header( +"To")); unless ( ( $email->header("Return-path") eq '<>' ) || ( $email->header("Auto-Submitted") ) || ( $email->header("Return-path") =~ m/MAILER-DAEMON\@/i ) + || ( $email->header("Sender") =~ m/^CompuServe Postmaster/) | +| ( ($email->header("From") =~ m/postmaster\@/) && ( $email->header("Subject") =~ m/Undeliverable/ ) ) ) { dump_mail(); } for ( @valid_email ) { my $email_address = quotemeta $_; dump_mail() if $to =~ m/$email_address/i; } $email->header_set("Subject", "[Bounced: $to]"); $email->header_set("X-SpamBounce", $to); dump_mail(); # Return mail sub dump_mail { print $email->as_string; exit; }
In reply to Spam bounces catcher by sheriff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |