[rt-users] Blocking mail to RT

Luis Moreno luis at cantv.net
Wed Feb 15 14:14:09 EST 2006


Hello.

I´m using procmail in a linux box to block the undesired mail going to rt
system. A sample of my .procmailrc its at the end

Hope it helps

Regards

-luis

$ cat $HOME/.procmailrc
SHELL=/bin/bash
SPAMDIR= /var/tmp/spam/`date +%Y-%m`
DUMMY=`test -d $SPAMDIR || (mkdir -p $SPAMDIR; chmod 755 $SPAMDIR)`

# Spam
:0 c
* ? formail -x"Subject:" \
        | egrep -i '[SPAM]';
$SPAMDIR/

# Refuse mail from myself
:0
* ? formail -x"From:" -x"Reply-To:" -x"Errors-To:" \
        | egrep -i 'mydomain'
! spamtrap at mydomain

# Cron mail should be looked upon
:0
* ? formail -x"From:" -x"Reply-To:" -x"Errors-To:" \
        | egrep -i 'Cron Daemon'
! Root

# Refuse bounces
:0
* ? formail -x"From:" | egrep -i MAILER-DAEMON
/dev/null

# All mails bigger than 1.5 Mb are sent to an administrator instead
:0
* > 1500000
! root

# Send the mail to rt engine
:0
|perl -MMail::Message -e '$msg = Mail::Message->read(\*STDIN); if
(length($msg->
subject)>= 70) {my $newsubject = substr($msg->subject,0,67) . "..."; my
Mail::Me
ssage::Head $head = $msg->head; $head->delete('Subject');
$head->add(Subject =>
 $newsubject)} $msg->print()'|/opt/rt3/bin/rt-mailgate --queue dnsbls
--action c
orrespond --url http://myrt/





More information about the rt-users mailing list