Strange Rambling And More
 
« September 2006 | Home
 

ARCHIVES
June 2007
September 2006
August 2006
April 2006
January 2006
December 2005
March 2005
February 2005
November 2004
September 2004
August 2004
LINKS
  • www.alizandscott.com
  • www.se3.org
  • Kickass Chat


  • Archives for June 2007

    Mbox to MailDir Conversion
    June 07, 2007

    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

    Posted by scott at 12:47 PM | Comments (0)
    ––––––––––––––––––––––––––––––––––––––––––––

    Dovecot 1.0.0-11, Sendmail 8.14.1-1 and Poprelay or Fedora core 2

    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!!

    Posted by scott at 10:22 AM | Comments (0)
    ––––––––––––––––––––––––––––––––––––––––––––