-   Linux - Software (
-   -   postfix dovecot mysql permissions issue (

gnetcon 08-03-2006 10:32 AM

postfix dovecot mysql permissions issue
I'm again fairly new to linux administration, and I have a box where I'm trying to setup postfix/dovecot/mysql to handle email for virtual users, using MySQL to authenticate the users. I was modifying the following guide, as I have a Redhat FC 4 system:

I have dovecot communicating with the db (I believe), as when I restart dovecot, I see in the maillog:


dovecot-auth: MySQL: connected to
I have a virtual email box setup at:


The perms are:


ls -l /var/spool/postfix/virtual/
total 16
drwx------  2 postfix postfix 4096 Aug  1 15:11 cur
-rw-------  1 postfix postfix  62 Aug  1 15:32 maildirsize
drwx------  2 postfix postfix 4096 Aug  1 15:32 new
drwx------  2 postfix postfix 4096 Aug  1 15:32 tmp

When I try and send an email to the address, I get the following errors:


Aug  3 09:23:25 server042 postfix/virtual[18314]: D309B1B78047: to=<>, relay=virtual, delay=0, status=deferred (maildir delivery failed: create /var/spool/postfix/virtual/ Permission denied)
Aug  3 09:23:25 server042 postfix/virtual[18314]: warning: maildir access problem for UID/GID=12345/54321: create /var/spool/postfix/virtual/ Permission denied
Aug  3 09:23:25 server042 postfix/virtual[18314]: warning: perhaps you need to create the maildirs in advance

I see the UID/GID is 12345. I have my /etc/dovecot-mysql.conf set to use 89, as that is the UID in my /etc/passwd file.

I'm sure this is a simple fix, just struggling to get it right. If anyone needs any conf files or anything, please let me know.

Thanks in advance for any light you can shed on this.

cdhgee 08-03-2006 10:56 AM

This doesn't look like a dovecot issue, it looks like a postfix issue. Are you certain that postfix is running under the "postfix" username? I know it sounds silly, but it's always wise to check. Also find out which user corresponds to UID 12345. It could be that postfix is trying to impersonate the user to deliver the mail.

In any case, the user should have rights to (and probably be the owner of, with postfix being the GID) their own mail spool file - otherwise they can't access their incoming mail!

gnetcon 08-03-2006 11:22 AM

Thanks for the feedback. When I do a "ps aux | grep postfix", I get:


root    18237  0.0  0.2  6596  1420 ?        Ss  09:16  0:00 /usr/libexec/postfix/master
postfix  18238  0.0  0.2  6620  1404 ?        S    09:16  0:00 pickup -l -t fifo -u
postfix  18240  0.0  0.2  6656  1472 ?        S    09:16  0:00 qmgr -l -t fifo -u

There is no user in /etc/passwd that uses either the UID of 12345 or the GID of 54321. I'm assuming this is an issue with my setup?

These users don't have physical access to the servers. My end goal is to have multiple domains, with multiple users, setup to just send and receive email through my server. They won't have physical telnet/ssh access to the box. So "" and "" are 2 different users.

Thanks again.

cdhgee 08-03-2006 11:40 AM

Hmm. I've got dovecot/postfix configured at home so I'll have a look when I go home tonight and see if anything jumps out at me. You might have a look through the postfix and dovecot config files though and see if you can identify the source of the spurious 12345 and 54321.

gnetcon 08-03-2006 12:05 PM

Sweet!!! I found in the that it was set there for the UID of 12345 and the GID of 54321. I updated to 89 (to which postfix is assigned) and restarted postfix (and dovecot, just to be safe). I was then able to send the email successfully.

It also fixed my next problem, which was receiving the emails. I am now able to login via IMAP and receive the messages, too.

Thanks for the advice cdhgee. All is working well on that front.

Now onto my next problem, which is sendind email through this same server out. Connecting through IMAP and setting both my incoming and outgoing email server to the same server, I can check and read fine now. But when I send, I get:


Aug  3 11:08:19 server042 postfix/smtpd[19007]: NOQUEUE: reject: RCPT from[]: 550 <>: Recipient address rejected: User unknown; from=<> to=<> proto=ESMTP helo=<acerbox>
Any ideas where to look for this? Thanks again!

All times are GMT -5. The time now is 05:10 AM.