procmail
[Top] [All Lists]

Re: How to forward by default

2000-11-21 09:56:20
On Tue, Nov 21, 2000 at 09:41:03AM -0600, David W. Tamkin wrote:
Chris Green asked,

| I want to use procmail to filter out mail for a couple of addresses
| and then forward all other mail to the same place that the original
| .forward file sent it to.
| 
| How do I set up a DEFAULT variable in procmail to send mail to an
| email address rather than a mailbox file?

You can't do it by setting DEFAULT.  You need an explicit recipe at the end
of your rcfile to forward all mail that procmail has not already delivered:

  :0 # no conditions; recipe is unconditional
  ! the(_at_)other(_dot_)address

Aha, OK, thanks.

I'd recommend adding some loop detection to that, though:

  :0fwh
  * ! ^X-Loop: this(_at_)local\(_dot_)address
  | formail -A "X-Loop: this(_at_)local(_dot_)address"
   :0A
   ! the(_at_)other(_dot_)address
  :0E:
  loopingmail
That might be a good idea as I might get carried away and try testing
from the address that the mail gets sent to be default.  However
the mail should stop there so I don't think it can loop.

-- 
Chris Green (chris(_at_)areti(_dot_)co(_dot_)uk)
  Home: chris(_at_)isbd(_dot_)demon(_dot_)co(_dot_)uk            Work: 
cgreen(_at_)bcs(_dot_)org(_dot_)uk
  WWW: http://www.isbd.co.uk/
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>