# [RESOLVED]mysql-virtual-maps.cf

## JoeG

This is nuts.  Local users are getting their email fine.  Virtual users are not.  When I 

```
cat /var/log/mail/current
```

I get:

```
Mar 16 19:18:35 [postfix/virtual] fatal: open /etc/postfix/mysql-virtual-maps.cf: Permission denied
```

Obviously, this is why the virtual users are not receiving email.  Postfix simply cannot read the virtual-maps.cf.  I just figured that it was a permissions issue with postfix.  So I  did a quick 

```
ls -l /etc/postfix
```

 and found 

```
-rw-r--r--    1 root     postfix       267 Mar  3 21:42 mysql-virtual-maps.cf
```

What gives??

JoeG

----------

## kashani

I've got mine owned root.root with permission 644 and no problems. I'd suspect a typo in the actual file name or in your /etc/postfix/main.cf, but that doesn't look especially likely from your post.

It's possible it's a mysql error. Are you able to connect as the mailsql user, or whatever you're using, to the address you've specified in the mysql-virtual-maps.cf from the command line? 

The off chance is, are you doing any chrooting or strange security measures?

kashani

----------

## avendesora

Also check the permissions on /etc and /etc/postfix. You might well need both to be at least +r (and maybe +rx) for the user that needs to open that file.

----------

## JoeG

Thanks for the ideas guys...but, alas, no joy.  :Confused: 

 *Quote:*   

> Are you able to connect as the mailsql user, or whatever you're using, to the address you've specified in the mysql-virtual-maps.cf from the command line? 

 Yup.  Every time.  No chrooting here (although I'm probably gonna have to for spamassassin and antivirus later.) or other weird security measures.  Just straight-up stuff.

 *Quote:*   

> Also check the permissions on /etc and /etc/postfix. You might well need both to be at least +r (and maybe +rx) for the user that needs to open that file.

 Actually, I currently have the permissions for that file set 644, with the path to it world-readable.  Besides, you are supposed to be able to set all mysql-*.cf files to 640 for security purposes.  Scroll down to just above the SquirrelMail section and you'll see that the doc has been updated to reflect this.  According to this, it was a recognized but that any of these were world-readable.

I'll post any further findings.  If I can get this resolved, maybe it'll help some other poor slob with the same issue.

Thx.  The help is appreciated.

JoeG

----------

## JoeG

Resolved.

I simply did a

```
USE="mysql imap libwww maildir sasl ssl" emerge -k postfix
```

 restarted postfix, and all users are again receiving email.  The mailq was immediately flushed to users.  Thanks for the help, guys.    :Very Happy:  Gentoo community rocks.

JoeG

P.S.  You really should 

```
chmod 640 /etc/postfix/mysql-*.cf
```

and 

```
chgrp postfix /etc/postfix/mysql-*.cf
```

 for security reasons.  Those sql passwords are plain text in those .cf files, as explained in my last post in the linkage.

----------

## kashani

Ah makes sense. I never understood why the Howto stated with you installing Postfix when you needed to have mysql installed already for all the packages you were building. 

Fixed my permissions. I was lazy before knowing I was the only local user on the box.

kashani

----------

## JoeG

 *kashani wrote:*   

> Ah makes sense.

 

Glad that someone could benefit from my confusion.    :Laughing: 

Happy Gentoo'ing

JoeG

----------

