Anti-Telus filter

GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
#!/usr/bin/perl $user = 'REDIR@EXAMPLE.ADDRESS'; $pass = 'PASSWORD'; $host = 'POP3.SERVER.ADDRESS'; %redir = ( 'sender@example.address' => 'reciever@example.address' ); $sendmail = '/usr/sbin/sendmail -t'; #DEBUG $sendmail = 'cat >>test2.txt'; use Mail::POP3Client; # connection $pop = new Mail::POP3Client(HOST => $host); $pop->User($user); $pop->Pass($pass); $pop->Connect() >= 0 || die $pop->Message(); # loop through messages for ($i = 1; $i <= $pop->Count(); $i++) { %head = (); foreach ($pop->Head($i)) { /^(From|Subject|Content-type):\s+(.+)/i; $head{lc($1)} = $2; } # print "From: $head{'from'}\n"; # print "Subject: $head{'subject'}\n"; # print "Content-type: $head{'content-type'}\n"; $head{'from'} =~ /<(.+)>$/; $email = $1; $body = $pop->Body($i); $body =~ s/Email on the go, sent by TELUS//mi; open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!\n"; print SENDMAIL "From: $head{'from'}\nReply-to: $head{'from'}\n"; print SENDMAIL "Subject: $head{'subject'}\n"; print SENDMAIL "To: $redir{$email}\n"; print SENDMAIL "Content-type: $head{'content-type'}\n\n"; print SENDMAIL $body; close(SENDMAIL); # print $body # print "\n\n=====\n\n"; $pop->Delete($i); } $pop->Close;

A Perl script which removes the tag added by Telus in mobile e-mail, so that various services can work properly when using mobile e-mail from a Telus phone.

Settings

$user
The user name for the POP3 server hosting the mailbox used by the filter program.
$pass
The password for the mailbox.
$host
The name of the POP3 server.
%redir
A list of e-mail addresses. The key is the address from which a message is sent to be filtered. The value is the e-mail address to which the filtered message is sent.

This script is easily customizable for other service providers which add a static tag to e-mails that you want filtered. Simply change the regular expression on line 39, replacing the Telus tag between the first two slashes with the tag added by your service provider.