# maildrop can't find directory using Postfix info [SOLVED]

## NotExcessive

I'm trying to get maildrop-2.0.1 to work with my virtual domain/user system built with Postfix-2.2.10 and MySQL.

My /etc/postfix/master.cf file contains

```
maildrop  unix  -       n       n       -       -       pipe

  flags=ODRhu user=mail argv=/usr/bin/maildrop -d ${recipient}
```

and I've set this in /etc/postfix/main.cf:

```
virtual_transport = maildrop

maildrop_destination_recipient_limit = 1

mailbox_command = /usr/bin/maildrop -d  "$USER" "$LOCAL" "$DOMAIN" "$HOME"
```

If I hard code the maildirs in /etc/maildrop/maildroprc:

```
DEFAULT="/vmail/domains/mydomain.net/myname/"
```

 then of course mail reaches user myname@mydomain.net as it should. Obviously this isn't going to be much good for more than one user. Now if I change the line to 

```
DEFAULT="/vmail/domains/$DOMAIN/$LOCAL/"
```

 or 

```
DEFAULT="/$HOME/$DOMAIN/$LOCAL/"
```

 (hence the format of mailbox_command) then it barfs:

```
Aug 21 17:10:48 [postfix/qmgr] A9BEE1B8E0B: from=<me@gmail.com>, size=1634, nrcpt=1 (queue active)

Aug 21 17:10:48 [authdaemond] Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/vmail/domains/, address=me@mydomain.net, fullname=<null>, maildir=mydomain.net/me/, quota=<null>, options=<null>

Aug 21 17:10:48 [authdaemond] Authenticated: clearpasswd=secret, passwd=<null>

Aug 21 17:10:48 [maildrop] Unable to open mailbox.

Aug 21 17:10:48 [postfix/pipe] A9BEE1B8E0B: to=<me@mydomain.net>, relay=maildrop, delay=1, status=deferred (temporary failure. Command output: /usr/bin/maildrop: Unable to open mailbox. )

```

 -it can't find the maildir. I know maildrop is authenticating OK from 

```
[authdaemond] Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/vmail/domains/, address=me@mydomain.net, fullname=<null>, maildir=mydomain.net/me/, quota=<null>, options=<null>
```

 and authdaemond correctly reports back the base address of homedir=/vmail/domains and my directory maildir=mydomain.net/me/.

I know I'm either not passing the variables from Postfix into maildrop correctly in the mailbox_command line, or that I'm not describing the location of the maildir in /etc/maildrop/maildroprc correctly.

Can anybody please tell me what the correct form is, or, if I even need to pass the variables from Postfix to maildrop if there's a way of doing it directly from authdaemond's report of homedir and maildir?Last edited by NotExcessive on Mon Aug 21, 2006 10:14 am; edited 1 time in total

----------

## NotExcessive

Never mind, solved it. For /etc/maildroprc I have:

```
#

# File: /etc/maildrop/maildroprc

import LOCAL

import DOMAIN

MAILDIR="/vmail/domains/$DOMAIN/$LOCAL/"

```

and in /etc/postfix/main.cf I have:

```
mailbox_command = /usr/bin/maildrop -d  "$USER" "$LOCAL" "$DOMAIN"
```

And that seems to work OK.

----------

## NotExcessive

Just a footnote: changing back to  mailbox_command = /usr/bin/maildrop -d  "$USER" and removing 

import LOCAL

import DOMAIN

and

MAILDIR="/vmail/domains/$DOMAIN/$LOCAL/" from the above files, I find that maildrop still works. Obviously it's retrieving homedir=/vmail/domains/ and maildir=mydomain.net/me/ from authdaemond without any help. Don't know why I had to do it myself - I had a null config before and it didn't work. Who knows, with all the farting around playing with things, it just needed a reboot.

----------

