Courier imap (ssl)
Kevin D. Clark
kclark at CetaceanNetworks.com
Thu Oct 9 10:18:08 EDT 2003
Cole Tuininga <colet at code-energy.com> writes:
> I guess my first question would be "How do I change exim to deliver to
> maildir format?" I haven't had a chance to look at the links that have
> been sent to me yet, so it's very possible I will find the answer there.
Not sure here.
> My next question would be "How do I have procmail handle maildir
> format?" An example from my current .procmailrc:
Look at the snippet from my .procmailrc:
# Procmail delivery rules:
# .../somefile -> "somefile" is in mbox format
# .../foo/ -> Maildir format
# .../foo/. -> MH format
:0
* ^TO.*IETF-Announce@
$HOME/Maildir/.ietf-announce/
Also see my attached writeup.
> Are there any well used/known good tools for
> converting existing mbox structures over to maildir? I can
> google/freshmeat around for converters, but I'm looking for specific
> experiences.
I'd probably hack something together with formail and procmail.
> So, make a real effort to avoid getting sucked into all the expensive
> lifestyle habits of typical Americans. Because if you do that, then
> people with the money will dictate what you do with your life.
> -- Richard Stallman
Regards,
--kevin
--
Empty ya pockets son, they got you thinkin that
What ya need is what they sellin
Make you think that buyin is rebellin
-- No Shelter / Rage Against the Machine
-------------- next part --------------
Motivations:
------------
I want the following features in my mail system:
o I want IMAP access so I can read my mail with multiple clients.
o I want standards-conforming encryption available to me so my
passwords don't go over the wire in the clear.
o I want my mail to get sorted into folders automatically.
o I want SPAM filtering (SpamBouncer, etc.).
o I want the system to be fast.
I pretty much had all of these features, except for the last one, when
I was running the University of Washington's IMAP server. So, I
decided to migrate to courier-imapd.
How to do what I did:
---------------------
0: Install procmail-3.22. I found procmail-3.15.x to have serious
bugs in handling the Maildir format, so I would strongly recommend
*not* using this version.
1: Get and install courier imapd. If compiling from source, and
you want SSL support, you're going to have to mess around with
CPPFLAGS and LDFLAGS (and have OpenSSL).
While this is compiling, take a look at the graphs here:
http://www.courier-mta.org/mbox-vs-maildir/
2: Configure authentication. For now, I decided to use PAM. I had to mess
around with the /usr/lib/courier-imap/etc/authdaemonrc and configure it
to use PAM before LDAP -- the server was trying to use LDAP first
and wouldn't let me login.
3: Make your Maildir and the folders that you want.
(the server won't let you login if you don't have a Maildir
either...)
Before you do this, you'll probably want to read the "maildirmake"
man page. You might have to muck with your MANPATH to do this.
If you're impatient, here is what I did:
$ /usr/lib/courier-imap/bin/maildirmake $HOME/Maildir/
$ /usr/lib/courier-imap/bin/maildirmake -f ietf-announce $HOME/Maildir
$ /usr/lib/courier-imap/bin/maildirmake -f gnhlug $HOME/Maildir
$ /usr/lib/courier-imap/bin/maildirmake -f gnhlug-announce $HOME/Maildir
[etc.]
(you can create folders through a IMAP client too)
This has the effect of creating a special Maildir directory in
$HOME/Maildir. Courier imapd stores folders in "dot-files" --
from the above commands a directory called $HOME/Maildir/.gnhlug
is created. (*)
* This has the next effect of this: when you look at your
folders in a IMAP client, you'll have folders named
"INBOX.gnhlug". Various people on the net suggest installing
symlinks to get around this "problem", but I didn't do this.
4: Configure your .procmailrc thusly:
[...lots of spurious details omitted]
# I don't even know if this next line is necessary -- YMMV
MAILDIR=$HOME/Maildir
# Procmail delivery rules:
# .../somefile -> "somefile" is in mbox format
# .../foo/ -> Maildir format
# .../foo/. -> MH format
:0
* ^TO.*IETF-Announce@
$HOME/Maildir/.ietf-announce/
:0
* ^TO.*gnhlug@
$HOME/Maildir/.gnhlug/
# etc...
# IT IS CRITICAL THAT THIS IS THE LAST RULE
:0
$HOME/Maildir/
5: Do whatever you have to do to your mail system to get it to run
incoming mail through procmail.
6: Test. Test. Test.
6a: If you happen to be snarfing your mail off of another IMAP server
(in my case, uwash-imapd) and putting it into this server, you
might find procmail's "formail" to be useful. Alternatively, you
might find fetchmail's "--folder" and "--keep" options to be
useful. Caveat programmer...
7: You're running your own IMAP server -- you might want to take a
moment to consider "how is my mail getting backed up?".
Acknowledgements:
-----------------
Obviously, I would like to thank the people who put courier-imapd,
procmail, and fetchmail together -- these are industrial-strength,
high-quality tools.
I would also like to thank Bob Bell (GNHLUG member), Fred Yankowski,
and Keith T. Garner (both of the Linux Users Of Northern Illinois) for
letting me bounce ideas off them when I was running into procmail
problems.
THE END
More information about the gnhlug-discuss
mailing list