Im having a bit of a problem using .mailfilter in a users home directory to sort incoming email into folders automatically when it hits the server rather than using the email client to do the filtering.
Setup:
CentOS 2.6.18-92.el5PAE
rpm -qa | grep -i courier
courier-mlm-0.58.0-1.2
courier-maildrop-0.58.0-1.2
courier-0.58.0-1.2
courier-ldap-0.58.0-1.2
courier-authlib-0.60.2-1.fc2
courier-imapd-0.58.0-1.2
courier-webmail-0.58.0-1.2
courier-pop3d-0.58.0-1.2
I have a .mailfilter in /home/user with the following contents

Owned/grouped correctly)
logfile "$HOME/mailfilter.log"
MAILBOX="$HOME/Maildir/"
if (/^To: distributionslist/ )
{
to "$HOME/Maildir/.distributionslist/"
}
I also have other filters that do work. The problem is with distribution list emails. For example. I have a list we'll call distributionslist, the email for this is
distributionslist@domainname.com. So if someone sends an email to
distributionslist@domainname.com it SHOULD be automatically sorted into .distributionslist or distributionslist folder in the email client. Some of the emails work and some end up in the Inbox. Also, sometimes people will have their own nickname for distributionslist and they'll call it something like Distributions List or some other variation. My email client is Thunderbird, so when one of these emails come in in the email header I will see To: Distributions List, then if I highlight it I will see the actual email.
So how do I set up my .mailfilter to include the different spelling variations of the distributions list? Shouldn't courier/mailfilter only go by the actual email and NOT the nickname? Also how would I sort emails that were CC (carbon copy) to the same distributions list? Sorry if this is confusing but I am confused.
thanks!