On 05/10/10 17:36, Hans-Werner Hilse wrote:
> Hi,
> 
> On Mon, 10 Oct 2005 15:54:12 +0200
> Jean Magnan de Bornier <[EMAIL PROTECTED]> wrote:
> 
> > | I've liked the fetchmail->procmail setup as I can have procmail process 
> > | the mail in many ways and even though Opera can do much of that I'ld like 
> > | to keep this process.
> > 
> > OK, sorry, I remember now why I gave up using opera!
> > 
> > What you can do is setting up a mail server, (postfix, exim, qmail) as an
> > imap server on your machine. Fetchmail keeps its business as before, now
> > feeding your mail server; you can point opera to your server.
> > 
> > Procmail would not be used in this case, but you can organize folders
> > within opera... 
> 
> Hm, a couple of things here:
> 
> - both Opera and Pine can talk SMTP. So no need for a SMTP Server (MTA)
> here (postfix, exim, qmail,...).
> 
> - fetchmail can use arbitrary MDAs, so even for delivery no need for a
> mail server (the OP probably knows this as he did only mention
> fetchmail and procmail).
> 
> - Pine and Opera have different backends for local mail file storage.
> 
> - Pine and Opera both support IMAP as backend (can't talk for Opera
> here, but IMAP using Pine is just amazingly fast).
> 
> Consequence (same as above cited but a little bit different explained)
> is: using IMAP backend would probably be the way to go. This could be
> e.g. Cyrus, UW-Imapd, dovecot, Courier. I have used Cyrus and Dovecot
> and can recommend both. Cyrus makes sense for multiple users and for
> those who like the Sieve mailfilter (like me).
> 
> IMAP servers usually bring their own utility for dropping mails into
> the mailstore. One would pipe the mail from procmail into such a
> program and configure Pine/Opera/other MUA to use the IMAP backend.
In case of Courier, you can just make procmail put the mails in a (set
of) local folder(s) under a given directory, then configure Courier to
use that directory as its base to look for your mails.
The folders under the directory has to be named ".folder_name" where
folder_name is (you guessed it) the name of the folder you sort the
mail into. Every dot in the folder-name will expand to a subdirectory
when you are watching the imap-server in your mail-client. 

Here is a little more concrete example of how to lay it out:

=== Procmail ===
Set MAILDIR in your .procmailrc to the base directory of where you want
to put your mails. For me that is $HOME/.maildir (since that's the
default location Courier is set up to look...)
Then change your filters so that they put the mails into subfolders of
MAILDIR. 

<Example>
:0
* ^List-Id.*gentoo-user\.gentoo\.org
.gentoo-user/
</Example>

Note the dot in front of the folder name! Courier expects this layout!

If you want to make the gentoo-user "folder" displayed as a subfolder of
for example a "lists" folder in your mail client, then you rewrite the
last line like so:
.lists.gentoo-user/

If you look at the directory structure under $MAILDIR when you've let
procmail filter some mails, then it'll probably look something like this
(depending on how you filter your mails):
$ ls -a1 $HOME/.maildir
./
../
.inbox
.lists.gentoo-user
.lists.gentoo-dev
.lists.fvwm
[and so on...]

=== Courier-imap ===
You'll have to emerge courier-imap to use Courier's imap server. 
# emerge net-mail/courier-imap

The only thing you'll have to set in courier-imap's config
(/etc/courier-imap/imapd) is where you store your emails, and what IP
adress you want to bind it too.

Set ADDRESS to the IP you want to bind courier-imap to. For example
127.0.0.1 if you only want local email clients to be able to connect.
Then set MAILDIR and MAILDIRPATH to your procmail recipies base
directory (MAILDIR in ~/.procmailrc without the $HOME/ part). 

In my case (/etc/courier-imap/imapd): 
ADDRESS=127.0.0.1
MAILDIR=.maildir
MAILDIRPATH=.maildir

Also, if you want to use ssl for your connections, you'll have to
generate certificates for the imap server:
# cd /etc/courier-imap
# $EDITOR imapd.cnf
(Change the C, ST, L, CN, and email parameters to match your server)

# mkimapdcert

You might have to change which ways that courier will try to
authenticate you if you have any troubles loggin in. Look for
"authmodulelist" in /etc/courier/authlib/authdaemonrc and remove those
modules you don't want/need. I only have "authpam" there myself. 

Then start the courier-imap service:
# /etc/init.d/courier-imapd start
(if you want ssl encrypted connection:)
/etc/init.d/courier-imapd-ssl start

This should be all you have to do to have a working Courier IMAP server
on your system... 
The biggest problem you'll have is probably to migrate your existing
emails from your local setup to the IMAP way. But that's easily done
with any mail client supporting local maildirs and IMAP (Pine should do
it, I think).
If you have any problems, the mailing list is always open ;)

PS. I'm pretty certain I've forgotten to bring something up, but the
documentation on either Gentoo's official site or [1] will probably
help. DS.

[1] http://dev.gentoo.org/~spider/local-mail-0.3.0/local-email.html

-- 
Regards,
  Patrick Börjesson

PGP signature: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21792A5D
PGP fingerprint: 74AF D4EF 6BDE CF77 16BE  6A29 CDB8 7607 2179 2A5D

Attachment: pgpEX4dOhl4N1.pgp
Description: PGP signature

Reply via email to