# Maildrop error: Home directory owned by wrong user

## tsafx86

/etc/maildroprc

```
DEFAULT="$HOME/.maildir/"
```

Permessions on .maildir 777

mail.log

```
Dec 10 21:19:02 Gen postfix/smtpd[29700]: connect from tfx.tower.loc[192.168.1.1]

Dec 10 21:19:02 Gen postfix/smtpd[29700]: 77CCD17A44E: client=tfx.tower.loc[192.168.1.1]

Dec 10 21:19:02 Gen postfix/cleanup[29703]: 77CCD17A44E: message-id=<475D8344.10305@tower.loc>

Dec 10 21:19:02 Gen postfix/qmgr[29551]: 77CCD17A44E: from=<tfx@tower.loc>, size=465, nrcpt=1 (queue active)

Dec 10 21:19:02 Gen postfix/smtpd[29700]: disconnect from tfx.tower.loc[192.168.1.1]

Dec 10 21:19:02 Gen maildrop[29705]: Home directory owned by wrong user.

Dec 10 21:19:03 Gen postfix/local[29704]: 77CCD17A44E: to=<tfx@gen.tower.loc>, orig_to=<root@tower.loc>, relay=local, delay=0.57, delays=0.21/0.02/0/0.35, dsn=4.3.0, status=deferred (temporary failure. Command output: /usr/bin/maildrop: Home directory owned by wrong user. )

```

When I disabled maildrop, error disappears.

I think that the lack of rights to the folder. But I do not understand where that folder

----------

## steveb

Under what user do you run maildrop? (should be in your master.cf).

// SteveB

----------

## tsafx86

master.cf

```
#

# Postfix master process configuration file.  For details on the format

# of the file, see the master(5) manual page (command: "man 5 master").

#

# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (yes)   (never) (100)

# ==========================================================================

smtp      inet  n       -       n       -       -       smtpd

#submission inet n       -       n       -       -       smtpd

#  -o smtpd_enforce_tls=yes

#  -o smtpd_sasl_auth_enable=yes

#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

#smtps     inet  n       -       n       -       -       smtpd

#  -o smtpd_tls_wrappermode=yes

#  -o smtpd_sasl_auth_enable=yes

#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

#628      inet  n       -       n       -       -       qmqpd

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       n       300     1       qmgr

#qmgr     fifo  n       -       n       300     1       oqmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       n       -       -       smtp

# When relaying mail as backup MX, disable fallback_relay to avoid MX loops

relay     unix  -       -       n       -       -       smtp

        -o fallback_relay=

#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

discard   unix  -       -       n       -       -       discard

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

scache    unix  -       -       n       -       1       scache

#

# ====================================================================

# Interfaces to non-Postfix software. Be sure to examine the manual

# pages of the non-Postfix software to find out what options it wants.

#

# Many of the following services use the Postfix pipe(8) delivery

# agent.  See the pipe(8) man page for information about ${recipient}

# and other message envelope options.

# ====================================================================

#

# maildrop. See the Postfix MAILDROP_README file for details.

# Also specify in main.cf: maildrop_destination_recipient_limit=1

#

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

#

# The Cyrus deliver program has changed incompatibly, multiple times.

#

old-cyrus unix  -       n       n       -       -       pipe

  flags=R user=cyrus argv=/usr/lib/cyrus/deliver -e -m ${extension} ${user}

# Cyrus 2.1.5 (Amos Gouaux)

# Also specify in main.cf: cyrus_destination_recipient_limit=1

cyrus     unix  -       n       n       -       -       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${extension} ${user}

# Cyrus with "virtdomains: yes"

# Also specify in main.cf: virtual_transport = virt-cyrus

virt-cyrus     unix  -       n       n       -       -       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${recipient} ${user}

#

# See the Postfix UUCP_README file for configuration details.

#

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

#

# Other external delivery methods.

#

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

```

main.cf

```

..

mailbox_command = /usr/bin/maildrop -d ${USER}

maildrop_destination_recipient_limit = 1

..

```

cat /etc/group | grep vmail

cat /etc/passwd | grep vmail

Result is empty

I tried:

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=root argv=/usr/local/bin/maildrop -d ${recipient}

The same result.

----------

## steveb

Postfix probably wont let you use root. Create the user and the group vmail. Group is not needed but user is needed if you want to use it as it is now in your master.cf. Or use nobody, but not root.

// SteveB

----------

## JeffBlair

Well, I am having the same problem as him. 

I have the vmail user setup, and the group setup as well. I have double checked in the main.cf and master.cf that the settings are right. I have the UID and GID in main, and vmail for the user in master. Still no go.

I am moving my mail server from another PC. The old one works with no issue, but it's the new one that I am having the problem with.

I have checked to make sure that my /home/vmail/domain.com/user/.maildir is owned by vmail:vmail.

The rights of that directory is 700.

And, to further kick me. I'm getting the error: [imapd-ssl] chdir /home/vmail/domain.com/user/.maildir/: Permission denied

when I try to login to it via SquirrelMail. 

Any help would be greatfull before I lose all my hair.  :Wink: 

----------

## i8puppies

Anybody find a solution on this? I'm having the same problem.

master.cf says to use vmail uid, the maildir has permissions set to rwx for vmail and rwx for the group named "mail".

----------

## i8puppies

Solved:

A couple things: make sure the sticky bit isn't set on the maildir

```
chmod -t -R .maildir
```

Also check uid in authlib, mine was set incorrectly

So for example in authmysqlrc:

```
MYSQL_UID_FIELD         'vmail uid here'
```

Hope this helps

----------

## r00t440

I have the same problem, but I use qmail+vpopmail. Which folder is the homedir maildrop is referring to? Thanks

----------

