Converting a server from dovecot to courier-imap

Discussion in 'Installation/Configuration' started by markc, Apr 10, 2013.

  1. markc

    markc Member

    Ubuntu 64bit 13.04 with ISPConfig

    I am attempting to convert and already setup server from dovecot to courier-imap so I can use maildrop for delivery. I've removed dovecot and /etc/dovecot and re-run update.php a few times and some messages have been delivered but now I am bumping into this one... note the/var/vmail path is completely wrong, this users real path is /var/vmail/ where I have moved the original Maildir/{cur,new,tmp} up a level.

    Apr 10 13:08:14 hp postfix/pipe[5838]: DA29D10065D: to=<[email protected]>, relay=maildrop, delay=0.05, delays=0.01/0.01/0/0.03, dsn=4.3.0, status=deferred (temporary failure. Command output: /usr/bin/maildrop.orig: Unable to create a dot-lock at /var/vmail/[email protected]/ )

    For some reason the SENDERS email address is being inserted into the path. The /usr/bin/maildrop is currently a shell script for debugging, it is...

    ~ cat /usr/bin/maildrop
    (echo $*; id ; env) | logger -p
    /usr/bin/maildrop.orig $*
    ~ ll /usr/bin/maildrop*
    -rwxr-xr-x 1 root root       78 Apr 10 13:07 /usr/bin/maildrop
    -rwsr-xr-x 1 root daemon 196000 Jan 23 23:32 /usr/bin/maildrop.orig
    Apr 10 13:15:05 hp logger: -d vmail [email protected] markc [email protected]
    Apr 10 13:15:05 hp logger: uid=5000(vmail) gid=5000(vmail) groups=5000(vmail)
    Apr 10 13:15:05 hp logger: MAIL_CONFIG=/etc/postfix
    Apr 10 13:15:05 hp logger: PATH=/usr/bin:/bin
    Apr 10 13:15:05 hp logger: PWD=/var/spool/postfix
    Apr 10 13:15:05 hp logger: LANG=C
    Apr 10 13:15:05 hp logger: SHLVL=1
    Apr 10 13:15:05 hp logger: _=/usr/bin/env
    Apr 10 13:15:05 hp maildrop[6015]: Unable to create a dot-lock at /var/vmail/[email protected]/
    Anyone have a suggestion what going on here and how to remove the senders address from the path?

    I did discover I cannot use /etc/courier/maildroprc as a global filter because postfix does not provide the env variables it would normally need so I will have to use a .filter or .mailfilter in each users /var/vmail virtural maildir.

    My objective it to enable Dspam filtering (via maildrop) because the default Spamassassin rules just suck, barely 80% effective. Perhaps I should investigate how to improve amavis/spamassassin but I figure there may be less pain installing Dspam which I know can work 99% effectively once trained.

    Also FWIW, /etc/postfix/ still has a reference to dovecot even after it's removed and I've run the update.php script...

    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
    [... further down ...]
    dovecot   unix  -       n       n       -       -       pipe
      flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
  2. Parsec

    Parsec New Member

    Are you using courier-maildrop or maildrop? As per available packages in debian/ubuntu. The maildrop line in your is one that courier-maildrop uses, I don't think standalone maildrop uses the ${sender} on the end (just guessing from looking back on some old server configs).
  3. markc

    markc Member

    Good point, I am using the courier-maildrop package and didn't notice the plain maildrop package (I searched for "courier" related pakages).

    So I guess I should try the maildrop package and remove courier-maildrop?
  4. Parsec

    Parsec New Member

    Hmm no, I'm using courier-maildrop and it works fine with that line. Just that I used to use other maildrop and the was different.

    I've not really delved into this courier-maildrop thing much - my ispc setup is only relatively new and i have been fighting with other issues. Actually I can't even find the maildroprc file.... I'll have a look around.
  5. Parsec

    Parsec New Member

    Hmm is your var/vmail setup correct? if using courier then this:
    Unable to create a dot-lock at /var/vmail/[email protected]/

    Is completely wrong. It should be

    Maybe you need to reset up your mailboxes because you're using courier now and not dovecot.
  6. markc

    markc Member

    Right, so leave the courier-imap package as is. I've only been using ispc for a few months too but I've been using the full courier-mta suite for about 10 years on a couple of client servers so I am not used to postfix at all. Yes, I can see the dot-lock path is wrong although I have had email delivered to my inbox... until maybe I rebooted, not sure. I'd like to try and understand why this error is happening rather than patch it up because I want to add Dspam filtering and maybe even become bold enough to try courier-mta instead of postfix on a test server... but to do that I need to understand the system better which is why I switched to courier-imap because it's half way to using courier-mta.

    As for a maildroprc there isn't one unless your create it but it's almost useless without courier-mta providing a bunch of env variables that maildrop needs when using a global /etc/courier/maildroprc. A maildrop filter filter in the /var/vmail/domain/users virtual home directory will probably work but I haven't got that far yet (not sure what the magic filename is yet). I use this to test with and on a standard courier-mta system those env vars are available but as you would see they are not when postfix is the MTA...

    ~ head /etc/courier/maildroprc
    logfile "/var/log/maildrop.log"
    import RECIPIENT
    import SENDER
    import HOME
    log "$RECIPIENT -> $HOME"
    Obviously touch /var/log/maildrop.log; chmod 666 /var/log/maildrop.log for testing.
  7. Parsec

    Parsec New Member

    Yep, used to use a maildrop.log before - added one to this server and everything in it is fine.

    Have you checked your ispc web panel and made sure it's now using courier in the selection rather then dovecot?

    Create a new mailbox and check it's real path - send it an email and see if you get the same problem.

    As to using courier-mta, it's most probably quite easily possible, all ispc does is add it's own mysql db stuff for postfix (to lookup users, paths etc), it doesn't actually optimise postfix much at all. Everytime there's an update I have to reconfigure my - but then I've been using postfix for years so I include a bunch of stuff I gleamed over time. So I don't see the problem making a courier-mta if you are used to it, you just have to have it understand how ispc stores the info in the database everything else is just basic mail server stuff. Even with maildrop you have to add your own quota warnings etc, ispc doesn't do anything like that.

    btw, I know you from way back in the old "localnet" days ;-)
  8. markc

    markc Member

    Well thank you Parsec for the suggestion that installing courier-mta should not be too disruptive. That gave me the confidence to try it out and sure enough it was easier and less time consuming for me than trying to work out this problem with postfix + maildrop.

    If anyone happens to be interested I could write up a short guide on how I did the conversion and a few tweaks to make sure courier-mta works with a ISPConfig on ubuntu (13.04) system. I now have Dspam working as I would normally set it up and now my spam has dropped to nearly zero :)
    Last edited: Apr 12, 2013

Share This Page