Showing posts with label mail filtering. Show all posts
Showing posts with label mail filtering. Show all posts

Tuesday, July 7, 2009

Migrating to gmail...

It's been long time since my last post... This post is about a migration i'm trying for my mailbox as lately i'm experiencing some issues with my primary mail account...

It's a strange situation because although my mailbox was migrated to another imap server, which clearly puts the blame at the server, i was not the only one who was migrated but i was the only one that experienced issues. (Using same OS and imap client software).

At the beginning the issue was due to the postfix's default max connections per IP given that Mail.app at os X opens many connections in parallel.

After raising this limit things were better but again it wasn't as it was.... So i though why not outsourcing the imap server work at Google? This is something that a colleague is already doing. I didn't want to migrate all my mails at gmail at once thus i just added the following to procmailrc at my account at our mailbox in order to copy all messages to my gmail account:
:0c:
! myemail@gmail.com

That did the trick and i soon realized how world would be without mail filters...
I started to add filters and "labels" (i really loved gmail labels! MUCH MUCH better than imap folders) and i realized that there is no way to filter my mails using non-standard headers (i did hard work on my imap client to find the best "custom" mail header to categorize my email sources and now this is unusable :( ).

Anyway the feeling after 2 days using gmail in comparison to my primary email is that gmail is much much faster but the spam filtering is not as "educated" as the one i was used to. Of course as the anti-SPAM software runs before procmail i can rely on both Google's and my previous mail provider anti-SPAM assertions.

Another very interesting comment that i have about gmail is that it can find which mails have arrived more than once for my email account (i.e. when i get a reply from a mailing list and the sender is using both my email and mailing list as recipients) and gives me only one of them. I thought that i was losing mails at first but actually all the information is preserved as the gmail recognizes both sources and if i have a filter that adds a label to each source the the mail will have all the labels.

Friday, June 26, 2009

I don't want all these mails on my iPhone!

A week ago i was writing on this blog about about the iPhone 3.0 OS update and as a disadvantage i had that there is no mail filters yet.

I really hate it when my laptop is not connected to the imap server (in order to filter all my mails) and i get all these SPAM and mailing list mails on my iPhone. It makes it totally useless.

The first thought i had was to use procmail which seem to be powerful with one "show-stopper" for me. It requires to have access to your mailbox server in order to upload your procmail configuration.

Then i thought to search for a simple client that will connect to IMAP, filter my mails and then logout. The client that i found is imapfilter which is actually developed a Greek guy!

Its operation does EXACTLY what i want. You feed it with an easy to read configuration (LUA):

---------------
-- Options --
---------------

options.timeout = 120
options.subscribe = true


----------------
-- Accounts --
----------------

-- Connects to "imap1.mail.server", as user "user1" with "secret1" as password.
account1 = {
server = 'imap1.mail.server',
username = 'user1',
password = 'secret1',
ssl = 'ssl3',
}

---------------
-- Filters --
---------------

spam = {
'new',
'header "X-DSPAM-Result" "Spam"',
}


----------------
-- Commands --
----------------

-- Get status (messages, recent, unseen) of the mailbox.
-- check(account1, 'INBOX')

-- Move messages between mailboxes at the same account.
results = match(account1, 'INBOX', spam)
move(account1, 'INBOX', account1, 'SPAM', results)

I just setup a cronjob for this and works perfect!