--On Saturday, March 1, 2003 1:15 PM -0800 William Pietri
<will...@scissor.com> is rumoured to have written:
Whenever I subscribe to a new mailing list, I end up creating a new
directory and then putting another entry into my set of filters.
Does anybody have a clever way of automating this so that the the
creation and filing happens automatically, so that I can subscribe to
new lists and just have the right things happen?
Here is what I use. It seems to work with most of the lists I'm subscribed
too. [the expression line is long, so I wrapped it at the OR/AND
delimiters]
if (( /^List-Id:.*<![:alnum:]*\-?[:alnum:]*\-?[:alnum:]*\-?[:alnum:]*!.*>/
|| /^X-list: ![:alnum:]*/
|| /^Mailing-List: contact ![:alnum:]*\-?[:alnum:]*!-help@.*/
|| /^Sender: owner\-![:alnum:]*\-[:alnum:]*!@cyrusoft.com/ )
&& !/^X-Spam-Status: Yes.*/ )
{ exception {
to ${MAILDIR}/.${MATCH2}/
}
exception {
logfile $HOME/mailfilter2.log
`maildirmake -f ${MATCH2} ${MAILDIR}`
`echo $MATCH2 | mail -s 'new listserv folder created' my_email`
`echo INBOX.${MATCH2} >> ${MAILDIR}/courierimapsubscribed`
to ${MAILDIR}/.${MATCH2}/
}
}