Blog‎ > ‎

Resending emails from a maildir

posted Feb 11, 2009, 12:09 PM by Jade Rubick

A user on one of my linux boxes had accumulated a bunch of email in a maildir, and wanted them forwarded to a new email address.

I wrote a script that did this:

#!/bin/bash

echo

for file in *.org

do
/usr/sbin/sendmail hisemail@safe4all.org hisemail@safe4all.org < "$file"
echo "$file name";
done
exit 0


Our domain name ends in .org, so that would change if you were at a .com or otherwise.

Comments