1 |
On 05/10/10 17:36, Hans-Werner Hilse wrote: |
2 |
> Hi, |
3 |
> |
4 |
> On Mon, 10 Oct 2005 15:54:12 +0200 |
5 |
> Jean Magnan de Bornier <jean@×××××××.net> wrote: |
6 |
> |
7 |
> > | I've liked the fetchmail->procmail setup as I can have procmail process |
8 |
> > | the mail in many ways and even though Opera can do much of that I'ld like |
9 |
> > | to keep this process. |
10 |
> > |
11 |
> > OK, sorry, I remember now why I gave up using opera! |
12 |
> > |
13 |
> > What you can do is setting up a mail server, (postfix, exim, qmail) as an |
14 |
> > imap server on your machine. Fetchmail keeps its business as before, now |
15 |
> > feeding your mail server; you can point opera to your server. |
16 |
> > |
17 |
> > Procmail would not be used in this case, but you can organize folders |
18 |
> > within opera... |
19 |
> |
20 |
> Hm, a couple of things here: |
21 |
> |
22 |
> - both Opera and Pine can talk SMTP. So no need for a SMTP Server (MTA) |
23 |
> here (postfix, exim, qmail,...). |
24 |
> |
25 |
> - fetchmail can use arbitrary MDAs, so even for delivery no need for a |
26 |
> mail server (the OP probably knows this as he did only mention |
27 |
> fetchmail and procmail). |
28 |
> |
29 |
> - Pine and Opera have different backends for local mail file storage. |
30 |
> |
31 |
> - Pine and Opera both support IMAP as backend (can't talk for Opera |
32 |
> here, but IMAP using Pine is just amazingly fast). |
33 |
> |
34 |
> Consequence (same as above cited but a little bit different explained) |
35 |
> is: using IMAP backend would probably be the way to go. This could be |
36 |
> e.g. Cyrus, UW-Imapd, dovecot, Courier. I have used Cyrus and Dovecot |
37 |
> and can recommend both. Cyrus makes sense for multiple users and for |
38 |
> those who like the Sieve mailfilter (like me). |
39 |
> |
40 |
> IMAP servers usually bring their own utility for dropping mails into |
41 |
> the mailstore. One would pipe the mail from procmail into such a |
42 |
> program and configure Pine/Opera/other MUA to use the IMAP backend. |
43 |
In case of Courier, you can just make procmail put the mails in a (set |
44 |
of) local folder(s) under a given directory, then configure Courier to |
45 |
use that directory as its base to look for your mails. |
46 |
The folders under the directory has to be named ".folder_name" where |
47 |
folder_name is (you guessed it) the name of the folder you sort the |
48 |
mail into. Every dot in the folder-name will expand to a subdirectory |
49 |
when you are watching the imap-server in your mail-client. |
50 |
|
51 |
Here is a little more concrete example of how to lay it out: |
52 |
|
53 |
=== Procmail === |
54 |
Set MAILDIR in your .procmailrc to the base directory of where you want |
55 |
to put your mails. For me that is $HOME/.maildir (since that's the |
56 |
default location Courier is set up to look...) |
57 |
Then change your filters so that they put the mails into subfolders of |
58 |
MAILDIR. |
59 |
|
60 |
<Example> |
61 |
:0 |
62 |
* ^List-Id.*gentoo-user\.gentoo\.org |
63 |
.gentoo-user/ |
64 |
</Example> |
65 |
|
66 |
Note the dot in front of the folder name! Courier expects this layout! |
67 |
|
68 |
If you want to make the gentoo-user "folder" displayed as a subfolder of |
69 |
for example a "lists" folder in your mail client, then you rewrite the |
70 |
last line like so: |
71 |
.lists.gentoo-user/ |
72 |
|
73 |
If you look at the directory structure under $MAILDIR when you've let |
74 |
procmail filter some mails, then it'll probably look something like this |
75 |
(depending on how you filter your mails): |
76 |
$ ls -a1 $HOME/.maildir |
77 |
./ |
78 |
../ |
79 |
.inbox |
80 |
.lists.gentoo-user |
81 |
.lists.gentoo-dev |
82 |
.lists.fvwm |
83 |
[and so on...] |
84 |
|
85 |
=== Courier-imap === |
86 |
You'll have to emerge courier-imap to use Courier's imap server. |
87 |
# emerge net-mail/courier-imap |
88 |
|
89 |
The only thing you'll have to set in courier-imap's config |
90 |
(/etc/courier-imap/imapd) is where you store your emails, and what IP |
91 |
adress you want to bind it too. |
92 |
|
93 |
Set ADDRESS to the IP you want to bind courier-imap to. For example |
94 |
127.0.0.1 if you only want local email clients to be able to connect. |
95 |
Then set MAILDIR and MAILDIRPATH to your procmail recipies base |
96 |
directory (MAILDIR in ~/.procmailrc without the $HOME/ part). |
97 |
|
98 |
In my case (/etc/courier-imap/imapd): |
99 |
ADDRESS=127.0.0.1 |
100 |
MAILDIR=.maildir |
101 |
MAILDIRPATH=.maildir |
102 |
|
103 |
Also, if you want to use ssl for your connections, you'll have to |
104 |
generate certificates for the imap server: |
105 |
# cd /etc/courier-imap |
106 |
# $EDITOR imapd.cnf |
107 |
(Change the C, ST, L, CN, and email parameters to match your server) |
108 |
|
109 |
# mkimapdcert |
110 |
|
111 |
You might have to change which ways that courier will try to |
112 |
authenticate you if you have any troubles loggin in. Look for |
113 |
"authmodulelist" in /etc/courier/authlib/authdaemonrc and remove those |
114 |
modules you don't want/need. I only have "authpam" there myself. |
115 |
|
116 |
Then start the courier-imap service: |
117 |
# /etc/init.d/courier-imapd start |
118 |
(if you want ssl encrypted connection:) |
119 |
/etc/init.d/courier-imapd-ssl start |
120 |
|
121 |
This should be all you have to do to have a working Courier IMAP server |
122 |
on your system... |
123 |
The biggest problem you'll have is probably to migrate your existing |
124 |
emails from your local setup to the IMAP way. But that's easily done |
125 |
with any mail client supporting local maildirs and IMAP (Pine should do |
126 |
it, I think). |
127 |
If you have any problems, the mailing list is always open ;) |
128 |
|
129 |
PS. I'm pretty certain I've forgotten to bring something up, but the |
130 |
documentation on either Gentoo's official site or [1] will probably |
131 |
help. DS. |
132 |
|
133 |
[1] http://dev.gentoo.org/~spider/local-mail-0.3.0/local-email.html |
134 |
|
135 |
-- |
136 |
Regards, |
137 |
Patrick Börjesson |
138 |
|
139 |
PGP signature: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21792A5D |
140 |
PGP fingerprint: 74AF D4EF 6BDE CF77 16BE 6A29 CDB8 7607 2179 2A5D |