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.
#!/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+(