How do I forward old root emails from the root mailbox to my address?

Christoph Schug chris+freebsd-questions at schug.net
Wed Apr 25 15:44:08 UTC 2007


On Wed, Apr 25, 2007, Andreas Widerøe Andersen wrote:

> Thanks for your reply. I don't have mutt installed and I was hoping for a
> way of doing this without installing additional software. Also, I didn't
> mention that on one of the machines there are probably a year of emails so
> the box is quite large.

Well, this one requires additional software too, but maybe you've got
formail(1) (which is part of the procmail(1) distribution) installed.

# formail -f -s /usr/sbin/sendmail -oiee newaccount at example.com \
  </var/mail/root

As this can put reasonable pressure on the receiving server, especially
when doing sort of spam scanning, etc., you might want to add an delay:

# formail -f -s /bin/sh -c \
  '/usr/sbin/sendmail -oiee newaccount at example.com; sleep 1' \
  </var/mail/root

-cs


More information about the freebsd-questions mailing list