logo       

Re: Sorting Lists: msg#00030

mail.maildrop

Subject: Re: Sorting Lists

Hi,

* Thorsten Haude <list+maildrop@xxxxxxxxxxxxxx> [2004-01-15 22:09]:
>I am subscribed to quite a few mailing lists and I want to use
>Maildrop to sort my mail by list. This seems to be pretty
>straightforward using a list of mailbox addresses and lookup().
>
>However, I want to send more than one list to certain mailboxes and I
>don't necessarily want to name the mailboxes after the list.
>
>I thought I would create a list of mailbox/list pair like this:
>- - - Schnipp - - -
>courier-maildrop@xxxxxxxxxxxxxxxxxxxxx ML/Mail
>mutt-users@xxxxxxxx ML/Mail
>postfix-users@xxxxxxxxxxx ML/Mail
>discuss@xxxxxxxxx ML/NEdit
>develop@xxxxxxxxx ML/NEdit
>- - - Schnapp - - -
>
>This list would be read by some script which would be fed the mail and
>return the mailbox' name to Maildrop.

That was remarkably simple to do within Maildrop:
- - - Schnipp - - -
gdbmopen("/path/to/lists.db")

foreach /^(To|Cc): .*/
{
foreach (getaddr($MATCH)) =~ /.+/
{
listbox = gdbmfetch($MATCH)
if ($listbox ne "")
{
# Drop any unsubscribe mails
if (/^Subject: unsub?scribe$/ && $SIZE < 1500)
{
to /dev/null
}

to $MAILDIR/ML/$listbox
}
}
}

gdbmclose
- - - Schnapp - - -


Thorsten
--
If people could put rainbows in zoos, they'd do it.
- Hobbes

Attachment: pgpXLNrfD3yCe.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise