When I set-up our internal server I was in experienced with sendmail and how mailboxs are handled. So I relied on the expertise of others turns out they were just as inexperienced as me. We left all the mailboxs as the default MBox format an granted it's ran pretty good for the last year or so. Recently our mail usage skyrocketed and we started to have problems with large mailboxes. Because the nautre of our business I couldn't tell users to stop send 40 to 50 MB files. So I consulted the oracle (google) and discovered sendmail loads the entire mbox file into memory (not good). So I found the answer Maildir but how to get all my old mail from MBox to MailDir? I did some more digging and came up with this script: http://batleth.sapienti-sat.org/projects/mb2md/
The fall back is I have 100+ users on the server and the script must be run from the users home directory as the user. Well the sudo command works well but you need to tell the script where the mbox for the user is.
sudo -u [username] perl /home/[username]/mb2md.pl -s /var/spool/mail/[username]
Still that's alot of time consuming typing. So I did more digging and found user data stored in the passwd file delimited by ":".
So I wrote a script to pull those users and run the sudo command for each.
http://www.se3.org/freestuff/1,6,19,0
My problems started when I ran yum to update dovecot from .99 to 1.0. My install of poprelay stopped working. Found this on dovecots wiki:
http://wiki.dovecot.org/PopRelay
But it was still wrong, my log looked like this and the example splits the line by ": ". Returning "dovecot" for "$service" not "pop3-login" like it's suppose to.
Jun 7 09:54:53 mail dovecot: pop3-login: Login: user=<user>, method=PLAIN, rip=[IP Address], lip=[IP Address]
To fix this I did this:
($crap, $info, $string)=split(/\: /,$line);
Next problem my remote users IP is "rip=[IP Address]" in the logs. To fix this I did the following:
($ip) = $line=~/\, rip\=(\d+\.\d+\.\d+\.\d+)/;
That's all, and it works now!!