|Sun 1998-07-05 Scott <scott(_at_)cai-chicago(_dot_)com> list.procmail
| [1 <text/plain>]
| I have procmail sorting out all of my mail for my lan and everything is
| working fine with the exception of mail from mailing lists (like this
| one) getting delivered properly. What statement should i put in the
.procmailr
|
| c file to deliver mail from all mailing lists to
scott(_at_)cai-chicago(_dot_)com??
| Anyone have a problem like this??
You could plug in my mailing list detector module: if message was detected
from mailing list (Variable LIST holds the list name) then forward messages.
See X-info's file server.
RC_LIST = $PMSRC/pm-jalist.rc
# After pile of other trapping recipes...
RC_LIST = $PMSRC/pm-jalist.rc
:0
* ! LIST ?? ^^^^
{
dummy = "forwarding mailing list: $LIST"
:0
! scott(_at_)cai-chicago(_dot_)com
}
jari
Pm-jalist.rc -- Subroutine to detect mailing LIST from message.
Description
This subroutine tries to detect and derive the mailing list name as
it appears in some of the know methods that ezlm, smarlist,
listserv, majordomo etc normally use. After this subroutine has
been applied to message the variable `LIST' contains the mailing
list name. Subroutine adaptively finds new new mailing lists
from the messages.
If you can use sendmail PLUS addressing capabillities, you may not
be interested in this module, because you have an alternative way
to handle mailing list messages. Let's suppose you want to
subscribe to procmail maling list and want to save all messages
to folder list.procmail, then you'd subribe with address:
login+list(_dot_)procmail(_at_)site(_dot_)com
The extra information after "+" is available to your procmail
scripts via $ARG pseudo variable when procmail is the LDA. If you
are not fortunate to have new sendmail, you usually subscribe
to mailing lists with regular email address:
login(_at_)site(_dot_)com
How do you detect the arriving mailing list messages?
Traditionally, you would add a piece of recipe to .procmailrc to
catch each list, but that's manual work every time. When you use
this subroutine, you no longer need to write separate mailing list
recipes to your .procmailrc every time you subscribe to a new
mailing list. The detection of a new list happens in this
subroutine for you.
Ask for help
If you find maling lists that this subroutine does not detect, but
which could have been detected by looking the headers in standard
way, please send a email to maintainer. There may be cases where it
is impossible to detect the mailing list and in those cases you
just has to carve a new entry to your procmailrc.
When you keep your procmail log running, you may see message
*** potential list ***
Which is an indication that some new recipe could be added to
to this subroutine to detect that mailing list. If the message
you received WAS from a mailing list, please send all the headers
to the maintainer so that support can be added.
You can search for mailing list that interests you at:
http://www.lsoft.com/lists/listref.html
Required settings
PMSRC must point to source direcry of procmail code. This subroutine
will include pm-javar.rc from there.
Variable JA_LIST_KILL_POSTFIX
If grabbed `LIST' match this regexp at the end of list name, then
the postfix match will be removed. It is traditional that many
lists name themself as list1-info, list2-beta, list3-l and you
would prefer more names (for mbox) list1, list2 and list3. The
default value will ditch "-(info|beta|l)".
Variable JA_LIST_CONVERSION
Many times the grabbed `LIST' name is not what you would like to
use for your mailbox name. You want to make the name perhaps
more shorter, more descriptive or categorize the messages according
to hierarchy. Let's say that you have subscribed to following mailing
lists:
LIST LIST name Description of mailing list
(as grabbed) you want
jde java.jde Java Development Env
java java.prog Java programming
FLAMENCO flamenco Flamenco music
tango-l tango Argentine Tango dancing
tm-en-help tm-en Emacs TM mime package mailing list
w3-beta w3 Emacs WWW mailing list
First, remember that the variable `JA_LIST_KILL_POSTFIX' is applied,
so the actual `LIST' appear as follows:
jde, java, FLAMENCO, tango, tm-en, w3
Ok, Now we apply the conversion table by defining it as follows,
where the grabbed LIST is first, then comes space(s), new name
_and_ terminating colon. Repeat this for each list you want to
convert.
LIST CONVERSION,LIST CONVERSION,
This gives us table below: Notice that antries tango-l, w3-beta
were not included, because the `JA_LIST_KILL_POSTFIX' already got
rid of the posfixes. Also note how the uppercase match FLAMENCO is
converted to more suitable lowercase mailbox name. After you have
set up this variable you can start saving messages to folders.
JA_LIST_CONVERSION = "\
jde java.jde,\
java java.prog,\
FLAMENCO flamenco,\
"
Example: basic installation
Here is recipe to save all your mailing list to separate folders.
If you subsribe to new lists or unsubsribe to lists, you don't
need to change anything.
RC_LIST = $PMSRC/pm-jalist.rc # name the subroutine
...
# Handle all mailing lists with one subroutine and recipe
# following it
INCLUDERC = $RC_LIST
:0 # if list name was grabbed
* ! LIST ?? ^^^^
{
dummy = "Saving mailing list: $LIST"
# the LIST will contain the found list name. Drop
# this message to mailing list folder
:0 :
list.$LIST
}