Create Server-site rules or filters for IMAP mail

I have recently just switched to IMAP mail for my personal account which I view on both my Mac, iPhone and my work PC.

Everything seems to be going well, but I want to try cleaning up clutter in my Inbox. I was wondering if there is a way I use Mail.app to create server-side rules to move certain messages into their respective IMAP folders on the server. Or do I need to use the more unfriendly account rules that my host provides in their control panel?

Thanks,
Mike

2.16 ghz MacBook Pro Core Duo, iPhone 8Gig, Mac OS X (10.5.1), Newton 2100, iPod 5G 30gig, iPodShuffle 1gig

Posted on Jan 25, 2008 7:29 AM

Reply
10 replies

Jan 31, 2008 6:05 AM in response to MLadd

Very interesting! For me, with Mail essentially always running, my iphone generally sees the post-rules mail. You're right, though, it doesn't auto-sync the imap hierarchy insofar as showing new mail in a subfolder. Again, for me, this is the way I want it so that when I check mail it's very quick, having only the inbox to sync up, and yet allowing me to look into any subfolders as I wish. My rules generally move non-essential stuff, forcing me to deal with stuff in my inbox, so the iphone seeing the inbox works just as I need it, yet I do have access to all my folders as necessary.

I can see that for you this would not work, because you need to know whether you have new mail in a folder, placed there by a server-side rule. But I wonder if you can use an extra rule to achieve what you want. I wonder if you can have your server-side rules as you like, but for those folders for which you must have notification of new mail, set the server-side rule to either (a) copy the message into the folder you want (thus leaving a copy in the inbox for your iphone to see), or (b) move the email and also send a new email to yourself alerting you to the fact that a mail was received, moved, and which folder it was moved to. For (b), you could even have the email sent to your phone number @txt.att.net, so that you'd receive the alert as a text on your iphone rather than a new email in your inbox. You could then set another rule to delete such notification text-emails from your sent box, or even set that as a client-side rule for when your mac mail is running, so as not to clutter your sent box with them.

Just a thought.

Jan 25, 2008 8:56 AM in response to Pascal Bouvier

Pascal,
Thanks for the response, but it seems that this is not exactly correct, as I have just recently found out. A shame too, as I was hoping to be able to create all of my rules directly from mail.app.

It seems that using the rules in Mail.app work great when using IMAP folders on the server. However, the catch is that Mail.app must be running in order for the rules to take effect. So for server-side filtering, it seems I need to use the account filters from my domain provider's control panel.

I tested this by creating similar rules in both the domain control panel and Mail.app, but also used the text in a subject field to determine what IMAP folder to put it in. When Mail was running, it worked fine, but when it was not running, only the rules from my domain's control panel would take effect, nothing from Mail.app.

So I guess the answer is No, you can not create IMAP server-side rules or filters using Mail.app; I need to use my hosting provider's control panel to create the filters.

Jan 25, 2008 9:05 AM in response to MLadd

you are correct, the rules in mail will work when mail is opened, much like anything else in mail, as in retrieving email, sending email, syncing with the server for an imap account... am i missing something here? the rules will apply to the server side once mail is up and "syncing" with the server.

i do not want to be glib, but were you expecting for the rules to work even if your mac was shut down?

Jan 25, 2008 9:53 AM in response to Pascal Bouvier

Pascal Bouvier wrote:
i do not want to be glib, but were you expecting for the rules to work even if your mac was shut down?


Exactly. This is the reason why they are called "server-side" rules, and not "client-side". What are you referring to is "client-side":
1. a message is being delivered to IMAP mailbox
2. mail.app downloads the header and (if set up this way) the body of the message
3. mail.app runs the rules engine and uploads the message back to the server, this time to a folder that has been set in the rules
4. mail.app delates the original message
5. mail.app checks if there were some changes to the IMAP account folder structure
6. as there just has been a change (see 3), it downloads the message again - this time from a folder
7. mail.app runs the rules engine and states the message is already in the proper IMAP folder
8. it took 7 steps, two downloads and one upload of a single message to get it into a proper folder

Now the server-side would be:
1. mail server gets a message via SMTP and decides which user is this message addressed to
2. mail server rules engine delivers the message into appropriate IMAP folder in a mailbox
3. mail.app downloads the header and (if set up this way) the body of the message
4. three steps, single download. You've catched the difference in bandwidth usage and CPU usage already, right Pascal?

I am afraid mail.app doesn't support creating server-side rules. Sadly, we (IMAP users) have to create our rules by hand, directly in configuration of our servers.

Jan 30, 2008 5:52 AM in response to Pascal Bouvier

Not to be glib, but you apparently don't understand IMAP.

Yes, I am expecting it to work when my mac is shut down. Server Side rules, filters and folders allow you to have E-Mail delivered to a folder (or even deleted if it's junk, so you never see it) on the server, and these rules reside on the server. What Mail.app uses are client side rules. If you don't have the exact same rules on multiple devices then every time you start up another client the E-mails keep getting bounced around, or don't wind up in the right folder.

The beauty of IMAP is to allow these rules to be executed on the server and your E-mail has the same folders with the same messages regardless of what machine/device you are on.

Jan 30, 2008 6:25 AM in response to igrok-mac

I have a MacBook Pro, so no, I can't.

Now, when I ran my own E-mail server on my old iMac (lamp), It was always on, and that wouldn't have been a problem. But as I am now hosting my domain name through another hosting company like everyone else does, since I got rid of my iMac, this is not possible.

However, something like this would work, as long as your computer never shut down, and E-mail never quit. Granted, a restart here and there is not a very big deal. But I do not want to organize my E-mail using client-side rules. This is one of the beauties of using IMAP. It also reduces the bandwidth needed to process the rules and move E-mail across folders on the server.

Jan 30, 2008 12:47 PM in response to MLadd

Funny, I also am on a MacBook Pro. It's usually on my desktop next to a 20" cinema display for an extended desktop, and I leave it on all the time. All my rules are in mail.app. When I take it with me and mail is not running, there is no mail to apply rules to, and if I happen to access mail from another machine when my laptop is neither with me nor on (which I can't remember ever happening except for an occasional iphone check of mail), my rules just run when I return. But it's never for long, and never a lot of mail to go through anyway. I understand this may not be your situation at all, of course, but it works for me and I don't need to set server-side rules.

Jan 30, 2008 5:58 PM in response to igrok-mac

igroc-mac,
Yes, you are correct that it is not necessary in your situation. Mine is the exact opposite. I travel for work every week. Between hotels, airports, client locations, etc...It's not as easy as just starting mail to apply rules. But using multiple computers with E-mail clients, web based e-mail when I don't have my own with me, and my iPhone, I would like my E-mail to be where it's supposed to be before Mail.app downloads the E-mail, applies the rules, uploads the E-mail back to the server, copies it to the correct folder, deletes the original, and downloads it again. And on the iPhone, I don't really want to view dozens and dozens of E-Mails in my Inbox before I get a chance to apply rules, which is why I chose to switch to IMAP. Your suggestion is no different then using POP3, and choosing not to delete any E-mails from the server once delivered.

Don't get me wrong, it's not a complaint, just a nice to have. As I stated earlier, I can create these directly on the domain provider's control panel so it's really a non-issue. Now, the fact that the iPhone won't sync IMAP folders automatically...that is a complaint.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Create Server-site rules or filters for IMAP mail

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.