jc23 has asked for the wisdom of the Perl Monks concerning the following question:

Hey Perl Monks,

I was wondering how to set up mail forwarding so that it will only forward mail from a particular mailbox directory? I'm using sendmail. Can you specify in a .forward file which mailbox to use so that only mail in a particular directory is forwarded? Or does this have to be done using some type of script?

Thanks.

jc

  • Comment on forwarding mail from different mailboxes

Replies are listed 'Best First'.
Re: forwarding mail from different mailboxes
by cianoz (Friar) on Jul 25, 2003 at 22:39 UTC
    look at Mail::Audit
Re: forwarding mail from different mailboxes
by Limbic~Region (Chancellor) on Jul 25, 2003 at 23:47 UTC
    jc23,
    Even though this really isn't a Perl question:

    From the man page for Sendmail on my HPUX 11.0 machine:
    .forward files are described in the aliases(5) manpage.

    From section 5 of the man pages for aliases on my HPUX 11.0 machine:
    If a file named .forward exists in a user's home directory and is owned by the user, sendmail redirects mail for that user to the list of addresses in the .forward file.

    An address in a .forward or :include: file can be anything that can appear as a mailing-list in the alias text file.

    Hope this helps - L~R

      Right, but say my mail is directed to various folders. How do i specify the .forward file so that only mail from folder x is forwarded?

      thanks.

      jc

Re: forwarding mail from different mailboxes
by skyknight (Hermit) on Jul 25, 2003 at 22:24 UTC
    You almost certainly want to learn about a program by the name of procmail to do what you're asking.