Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Dec 2003 13:07:45 +0300
From:      Odhiambo Washington <wash@wananchi.com>
To:        freebsd-isp@freebsd.org
Subject:   Re: Managing Maildirs
Message-ID:  <20031220100745.GC89870@ns2.wananchi.com>
In-Reply-To: <3FE3523D.7000701@centtech.com>
References:  <20031219165302.GA51410@ns2.wananchi.com> <20031219190055.GD85955@alexis.mi.celestial.com> <3FE3523D.7000701@centtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--//IivP0gvsAy3Can
Content-Type: multipart/mixed; boundary="Q0rSlbzrZN6k9QnT"
Content-Disposition: inline


--Q0rSlbzrZN6k9QnT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Eric Anderson <anderson@centtech.com> [20031219 22:33]: wrote:
> Bill Campbell wrote:
>=20
> >Number one above will do the trick and is far more efficient than using =
the
> >``find ...-exec'', although you might want to modify it to only nuke mail
> >over a certain age.  To nuke all trash over 30 days old:
> >
> >	find /home/*/Maildir/.Trash -type f -mtime +30 | xargs rm
> >
>=20
> On a totally unrelated note,  I'm thinking about switching from mbox=20
> formatted mailboxes using imap, to a more robust and faster imap server=
=20
> that uses maildirs.=20

That is a very easy move. Just don't get scared. I did it and it wasn't
difficult. Planning is required. All I had to do was:

1. Make my mail server to run in queue_only mode. No deliveries. BTW I
run Exim (http://www.exim.org).

2. I changed the config file for Exim to change a transport from doing
   delivery to mboxes to Maildir.

3. Ran a script to convert all the mboxes that I had into Maildir. The
   emails were in /var/mail/$user for all users (they were about 7k
   then).  Since the MTA would now deliver mails into
   /home/$user/Maildir, I simply run a simple "redeliver" command:

   cd /var/mail
   for mbox in `ls -1`; do formail -Y -s sendmail \
   $mbox@our.domain.tld.com < $mbox; done

When that process completed ...

4. Restarted the MTA on "deliver" mode. All mail got redelivered. I
   didn't care whether they seemed new or not. The important thing is
   that they were there. I assumed they were new mail. Some users left
   mail on the server. That was their own problem. Sometimes an admin
   must have a tough skin, like the armadillo ;)

5. rm -rf /var/mail/* (that is where the mboxes lived)


> My problem is, I have pop users, imap users, and elm/mutt/pine users
> on the same box.

That is not a problem. Their e-mail will be "there", only they may not
be able to access it until they change their configs. Mutt users must
change their .muttrc. I believe elm will work staright, but not sure.
I used pine long ago so I can't comment on it. I use mutt all these
days!
> Does elm/mutt/pine work ok with maildirs?=20

Definately.

> What about sendmail?=20

Sendwhat?? ;-)

Please use a sane MTA. If you can't use Exim, use Postfix ;-)
I can only talk about Exim for that is what I use. It has no problem at
all delivering to Maildir.

> What should I be looking out for?

I believe a perfect script to migrate your mboxes to $home/Maildir.
I have attached the script. If you have the mail located elswhere, you
can use this script:

#!/usr/local/bin/bash

DIRNAME=3D"/var/mail"
cd $DIRNAME
for user in `ls`; do
           mv $user $user.mbox
           maildirmake ~$user/Maildir
           perfect_maildir.pl ~$user/Maildir < $user.mbox
           chown -R $user ~$user/Maildir
           chgrp -R mail ~$user/Maildir
           chmod 700 ~$user/Maildir
           find ~$user/Maildir/ -type f | xargs chmod 660
           rm -f $user.mbox
        done

NB: Please test this with some test account before you run it for all
    users.


You will need courier-imap. Very easy to get up and running. If you want
fancy life, go for Cyrus. I've never tried it because it's rather
complicated, but maybe it's the swiss knife of imap servers?



-Wash

http://www.netmeister.org/news/learn2quote.html

--
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+
    |\      _,,,---,,_     | Odhiambo Washington    <wash@wananchi.com>
Zzz /,`.-'`'    -.  ;-;;,_ | Wananchi Online Ltd.   www.wananchi.com
   |,4-  ) )-,_. ,\ (  `'-'| Tel: +254 20 313985-9  +254 20 313922
  '---''(_/--'  `-'\_)     | GSM: +254 722 743223   +254 733 744121
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+
While most peoples' opinions change, the conviction of their
correctness never does.

--Q0rSlbzrZN6k9QnT--

--//IivP0gvsAy3Can
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE/5B9xn7LIsuxjem8RAq3HAKCRJYL0jJVhPvgAxEuA+FaukWd16gCgg1pu
54yFm9ZU3LXnS8WaNRTSewc=
=chD1
-----END PGP SIGNATURE-----

--//IivP0gvsAy3Can--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031220100745.GC89870>