Auto filtering mail to IMAP folders...

RTKS

Verified User
Joined
Nov 25, 2003
Messages
47
I'm looking for a way to automatically filter mail to various IMAP folders I have setup for some Yahoo groups I belong to. Not looking to enable this for my customers, though it'd be nice to have, so I don't mind getting into the configuration of EXIM, etc.

Anyone integrated procmail or something similar with DA to get mail delivered to specific folders?

TIA!
 
Hrm...ok I hate to answer my own question...but I'd like to see if some of the more experienced people can tell me if what I did will break anything. I figured out that EXIM can handle filtering (I know I'm the last one to figure it out).

First off I played around a bit with the filter file located in /etc/virtual/dmydomain.com directory. I figured out how it would send e-mails to the SA spam folder if so directed.

I then figured out where the IMAP mail folder was for the account that I wanted to send mail to...so I added the following to the filter file:
Code:
if
        $header_subject: contains "Filtering Test"
then
        save /home/myuser/imap/mydomain.com/lists/mail/IN-TESTING 660
endif
NOTE: lists is the mailbox name ([email protected]) and IN-TESTING is the folder.

I tried sending a test and noticed permissions issues in the exim logs. So off I went to research the permissions of the SA spam box. I came up with the following workaround but wonder if there's a chance it's going to break something down the road.

I reset the owner on the IN-TESTING file to be mail. I left the group the the default (myuser) and the permissions are default at 660.

I reset the group to mail on each of the directories within the /imap/mydomain.com/lists/mail/ structure and gave each directory 770 permissions.

A test proves the filter now works for the IN-TESTING folder and delivery to the plain inbox still works. I can see the mailboxes within Outlook and SquirrelMail.

Think this will break anything or can I go ahead and deploy the full filtering solution? I realize the filter file can get overwritten if I change my spam settings within DA so I'll keep a copy handy.

If this all works I'm thinking about adding a request to the DA folks for streamlining this process. It'd involve changing the owner/group/permissions as appropriate during mailbox/folder creation and integrating a custom filters section into the spam page.

Again, thanks in advance!
 
Back
Top