Complete.Org: Mailing Lists: Archives: offlineimap: October 2004:
Re: IMAP + procmail + offlineimap
Home

Re: IMAP + procmail + offlineimap

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Cc: Nikolai Weibull <offlineimap@xxxxxxxxxxxxx>
Subject: Re: IMAP + procmail + offlineimap
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Mon, 25 Oct 2004 15:32:08 -0500

Nikolai,

Right now, OfflineIMAP has no support for filtering things itself on 
anything more granular than a per-folder level.  Part of the reason is 
that a bidirectional syncing system like OfflineIMAP must preserve a 
one-to-one relationship between messages, and sending them through 
something like procmail makes it impossible to guarantee that.  
(Procmail may not deliver it at all, may deliver it multiple times, may 
forward it, and in any case, doesn't provide a reliable way to find the 
name of the message it just stored.)  For that reason, I doubt that 
OffilneIMAP will ever itself support anything more than a simple yes/no 
filtering scheme.

However, there are ways to accomplish what you want.

One is, of course, to do server-side filtering.  That's the approach I 
take, and has the advantage that it works regardless if whether a 
client machine is connected.

Another is to deliver incoming mail to a specific folder, run fetchmail 
over the messages there (deleting them after they've been processed), 
and have fecthmail deliver its mail to a place that OfflineIMAP syncs.  
You'll be downloading and then uploading everything, but it will be 
synced.

BTW, before paying money for a specific account, please make sure 
OfflineIMAP works with it first.  Certain IMAP servers do not correctly 
adhere to the protocol and are thus incompatible with OfflineIMAP.

Hope that helps.

-- John


On Monday 25 October 2004 12:37 pm, Nikolai Weibull wrote:
> Hi!
>
> Currently, I have a mailing address that takes 16 mb of mail.  I've
> been thinking of upgrading this to a 600 mb account that would allow
> me to store basically all my mail on the server instead of pulling it
> to my local machine every so often.  Now, the problem is that I've
> become very accustomed to my mail passing through procmail, not only
> for delivery, but also for rewriting.  The pipeline goes something
> like
>
> mail->fastmail.fm->INBOX->fetchmail->postfix->procmail->~/.maildir
>
> and then I can happily read it with mutt.  fastmail.fm is my email
> service provider.
>
> Fastmail.fm provides Seive support on their servers, so I could
> achieve basically the same filtering into correct sub-folders (for
> mailing lists and so on), but not rewriting (such as clean up of
> various headers) and piping messages on boring mailing list threads
> to /dev/null (I keep a msgid cache for that).
>
> Anyway, I've tried to come up with a solution where my mail pipeline
> would achive the same end result, but that the result after all the
> procmail rules and so on would be reflected back to the mail on the
> fastmail.fm account:
>
> mail->fastmail.fm->INBOX->fetchmail->postfix->procmail->~/.maildir->
> offlineimap
>
> However, I haven't come up with a solution to this?  Someone
> suggested that I use Sieve to place incoming mail into a separate
> spool folder on fastmail.fm (not simply INBOX) and tell fetchmail to
> only pull mail from that folder and so to only process the new mail
> through procmail and so on and then reflect the changes back with
> offlineimap.
>
> This is fine, but my favorite solution is if mail was delivered to
> the correct folder immidiately on the server, then pulled and cleaned
> up. This would obviously not work very well with fetchmail (what if
> you viewed the new mail on the server side, then fetchmail wouldn't
> pull it).
>
> So, a solution I thought could work but haven't been able to figure
> out how to do is if the pipeline was altered to
>
> mail->fastmail.fm->Sieve-><FOLDER>->offlineimap-><FILTER>->~/.maildir
>
> Here, <FILTER> would be some program that offlineimap would
> instantiate and feed the incoming mail to before storing it locally. 
> <FILTER> would be allowed to alter the mail however it wishes and
> offlineimap would use its output as the mail to store locally.  It
> would also update any changes remotely, if necessary.
>
> So, to conclude, would this be possible to implement, or is it
> already possible and I've just missed out on how to do it?
>       nikolai
>
>
> --
>
> ::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
> ::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
> ::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
>
> main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

-- 
John Goerzen
Author, Foundations of Python Network Programming
http://www.complete.org/pynet


[Prev in Thread] Current Thread [Next in Thread]