Subject: Re: Help with mail distribution

From: [email-masked] (Stephen R. van den Berg)
Date: Fri, 3 Feb 1995 15:25:49 +0100

Don Rubin <[email-masked]> wrote:
>Can I use procmail to automatically direct mail to folders?

>I am using sendmail under linux. When I am reading News and find an
>article I want to keep I currently mail it to myself, then when I read
>my mail I file that message into the appropriate folder. What I'd like
>to do is automatically file mail in various folders. I would like to
>specify the folder like this "[email-masked]"
>so if my name has a "-" or some other delimeter it is automatically
>put in the appropriate folder. I want the folder to be arbitrary, that 
>is, not a pre-existing list and if it doesn't exist, it will be created 
>automatically. If the address is just "[email-masked]" it will just 
>stay in my INBOX. I am using procmail and it doesn't appear to support
>the feature I am looking for. Any suggestions would be appreciated. Thanks...

There are several ways to accomplish what you want.  If we stick to
your specs as closely as we can, this is what you need:
1. Setup meta-argument passing from sendmail to procmail (see
   examples/advanced in the procmail distribution, or ask Kimmo Suominen to
   give you the m4 macros procmailfeature package for sendmail).
2. Put the following in your .procmailrc like (procmail v3.10 required):

	ARG="$1"		# fetch meta argument

	:0
	* ARG ?? ^^folder-\/[^./	 ][^/	 ]*^^
	newsfolder/$MATCH

3. Now send your mails to:	[email-masked]
   I.e. this would make ARG=folder-somename

-- 
Sincerely,                                  [email-masked]
           Stephen R. van den Berg (AKA BuGless).

To boldly program, where *no* man has programmed before!