LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   postfix dovecot mysql permissions issue (http://www.linuxquestions.org/questions/linux-software-2/postfix-dovecot-mysql-permissions-issue-470426/)

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:

http://bliki.rimuhosting.com/space/k...n+debian+sarge

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

Code:

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

/var/spool/postfix/virtual/username@domain.com

The perms are:

Code:

ls -l /var/spool/postfix/virtual/username@domain.com
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:

Code:

Aug  3 09:23:25 server042 postfix/virtual[18314]: D309B1B78047: to=<username@domain.com>, relay=virtual, delay=0, status=deferred (maildir delivery failed: create /var/spool/postfix/virtual/username@domain.com/tmp/1154615005.P18314.server042.xxx.com: 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/username@domain.com/tmp/1154615005.P18314.server042.xxx.com: 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:

Code:

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 "joe@domain1.com" and "joe@domain2.com" 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 main.cf 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:

Code:

Aug  3 11:08:19 server042 postfix/smtpd[19007]: NOQUEUE: reject: RCPT from c-71-200-120-33.xxx[xx.xxx.xxx.xx]: 550 <user@otherdomain.com>: Recipient address rejected: User unknown; from=<user@domain.com> to=<user@otherdomain.com> proto=ESMTP helo=<acerbox>
Any ideas where to look for this? Thanks again!


All times are GMT -5. The time now is 09:44 AM.