Use maildrop to forward a mail to another mail box | Just my blog

/dev/random

Use maildrop to forward a mail to another mail box

I recently had the need to forward e-mail based on the from field to another mailbox. I know, it's possible with a simple .forward in your $HOME, but that will forward all the mail. :-(


So after some further searching I end up with the following rule for your maildrop filter... it simply checks if the mail (in this example) is from [email protected]  and will forward it to [email protected]:


if ( /^From: .*[email protected]*/ )
{
        dotlock "forward.lock" {
          log "Forward mail"
          to "|/usr/sbin/sendmail [email protected]"
        }
}


And that's all you need to put add to your $HOME/.mailfilter


  • Social

  • By continuing to use the site, you agree to the use of cookies. more information

    The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible and enable advertising to provide you free content. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

    Close