Hooks and multiple accounts.

David Soulayrol david.soulayrol at gmail.com
Wed May 4 10:44:22 BST 2011


2011/5/3 Sebastian Spaeth <Sebastian at sspaeth.de>:
> Right, why not having 2 imapfilter configs and run both in one hook?
> Assume:
> IMAP1 = old account
> IMAP2 = active account
> imapfilter1.conf = Shove stuff from IMAP1 to IMAP2
> imapfilter2.conf = Sort stuff nicely on IMAP2

Well, I have finally changed my configuration this way. Imapfilter
configuration is split with the final receiving imap account in mind.
I will improve this further, since I wrote utility functions (e.g. to
fetch passwords from .netrc or to sort spam) that are used by both.

[Account A]
localrepository = ALocal
remoterepository = ARemote
presynchook = imapfilter -c ~/.config/imapfilter/config_A.lua
postsynchook = ~/.config/scripts/notify_new_mail.sh A

[Account B]
localrepository = BLocal
remoterepository = BRemote
presynchook = imapfilter -c ~/.config/imapfilter/config_B.lua
postsynchook = ~/.config/scripts/notify_new_mail.sh B

I guess now that whatever the configuration, there is always a way to
separate roles in each account. But perhaps a global presynchook could
help optimizing imap calls in some situations, no?

More information about the OfflineIMAP-project mailing list