Redirecting mail

Redirecting mail

Geoff Shang geoff at QuiteLikely.com
Sun Apr 11 15:23:07 IDT 2010


Hi,

To recap: I had a directory full of messages in Maildir format which I 
needed to deliver onto the person who should have received them but who 
had stopped checking their mail prematurely.

Thanks for all the suggestions.

I took a look at a couple of them.  The Perl suggestion I got seemed 
sound, but I don't know Perl and it didn't seem to me to be worth the 
effort of learning it in order to do what I wanted to do.  Of course, the 
suggestion could just as easily translate to some other language, but I 
also felt that there ought to be some pre-existing solution to this.

Formail was also suggested, but I couldn't see at a glance how this was 
going to help me.

What I ended up doing seems too easy, and probably has some glaring reason 
why it's a bad idea.   But it worked for me at least.

for i in *
do
   cat $i |sendmail -G -f <my_email_address> <recipient_address>
   sleep 5s
done

I used -f because I wanted any delivery problem reports to come to me 
instead of the original sender.  I used -G because it looked like 
something I should be using, not because I fully understood what it did or 
if it was necessary.

Geoff.




More information about the Linux-il mailing list