I've successfully set up an "imap forwarding" solution using imapsync to move my mail from one imap server to my company's google apps email.

Everything works dandy except that the new mail is not "received" so gmail does not run it's filters on it. This is a rather unique situation with gmail, but is there anyway to have an imap level transfer and still have gmail run it's filters? Even a "filter all email now" button (that worked with all filters of course) would suffice.

Notes: - Mail forwarding is out of the question for complicated reasons. - I'm aware of imapfilter, but i'd rather use google's filtering if possible.

2 Answers 2


I don't think you will find a way to make the google filters run automatically on email that is pushed via IMAP, but there is an option, when creating or editing filters, to apply the filter to all matching mail currently on the server. I think that satisfies your "filter all email now" example.

Alternatively, you could change your insertion method. I assume there must be some reason you can't have gmail pull from a POP or IMAP account, which would cause the filters to fire. What about using an intermediary account? You could push to the intermediary using imapsync, then pull from your main gmail account, which would cause the imported mail to be filtered properly

  • I have 20 filters.
    – Ralphleon
    Feb 10, 2011 at 19:20
  • updated answer with another suggestion
    – jj33
    Feb 10, 2011 at 19:51
  • I marked you up for the nice suggestion, but sadly we're wary of it going through any other servers.
    – Ralphleon
    Feb 10, 2011 at 22:06

If you have Gmail retrieve your mail using POP or IMAP -- rather than pushing it in using imapsync -- the messages will get passed through your filters.

  • gmail cannot retrieve email via imap. At least, our google sites version cannot. Or else, i wouldn't have needed imapsync. Pop is not an option.
    – Ralphleon
    Feb 10, 2011 at 22:04
  • Sorry, you're right; I forgot that Gmail only supports POP import. Is POP not an option because the service is simply not available externally from your site? I migrated a large collection of email from an IMAP account to Google by setting up my own server to (a) aggregate all the mail from multiple folders and (b) provide Google with a POP server for import.
    – larsks
    Feb 11, 2011 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .