[svlug] archiving IMAP mail???

Akkana Peck akkana at shallowsky.com
Tue May 6 17:56:19 PDT 2008


Joachim Rosenfeld writes:
> I haven't tried it yet, but I know I can point my BlackBerry at the IMAP
> server. My only worry is that it will interfere with fetchmail popping
> off the mail, i.e. if fetchmail grabs mail every minute on the minute,
> my BlackBerry can grab a message at 10:02:40, and 20 seconds later at
> 10:03:00, fetchmail will come along and check and see that there is no
> mail because the BlackBerry grabbed it. The mail is not archived and
> mutt never sees this.

Most computer-based email clients have a setting you can enable to
check mail but don't delete it from the host. So assuming your
Blackberry has that option, you should be fine.

If the mail server marks the mail as read once the Blackberry has
seen it, the man page for fetchmail says -a is the flag to "retrieve
both old (seen) and new messages from the mailserver." That should
solve the problem without your having to run your own imap server.

Fetchmail has lots of other options described in the man page,
in case you need to tweak that a bit. (I've only used fetchmail
with POP, not with IMAP.)

> - have neither my BB nor mutt grab messages and cause the other not to see it

What I wrote above assumed that you would be roaming with the
Blackberry and reading messages without deleting them from the
server, then when you got home, you would use fetchmail to grab
all the messages (including the ones you've seen from the
Blackberry) and delete them from the server.

If you want them to continue to stay on the server even when you're
home and using fetchmail, add the -k option (keep messages on the
server). Then you'll have to figure out when you want to delete them
off the server.

Daniel Gimpelevich writes:
> Surely, mutt itself can speak IMAP, right?

It can, but it's not a great IMAP client, and reading mail with
IMAP is a lot slower than local files. It usually works better
to grab messages from the IMAP server some other way, then use mutt
on the local files. Besides, Joachim mentioned wanting to filter
mail with procmail and spamassasin, and I'm presuming he means on
his PC, not on the server, so he'll want to run mutt locally after
that filtering has happened.

I switched fairly recently from a "filter everything on the server
and read it there with mutt" model to a "fetchmail to my current
machine and read locally with mutt" model. The tricky part was the
procmail and spamassassin part: I wanted the spam filtering to
happen on the server, so that when I'm travelling I don't have
to download all those spam messages over a dodgy motel wi-fi
connection. But I couldn't find any way for the procmail filtering
into folders to happen on the server, because it's hard to snarf
lots of multiple folders from server to client. (Fetchmail can't
do it, at least not straightforwardly; there are a couple of IMAP
solutions like offlineimap and mailsync, but I had issues getting
them working reliably with the IMAP server I was using and with mutt.)
In the end, I went for spam filtering on the server but not
filtering into folders until I've fetchmailed it to the client.
So I'm running procmail on both ends, but with different rulesets.

I'm curious what solutions other people use to read mail on
several different machines yet still filter into multiple folders.

	...Akkana



More information about the svlug mailing list