# Postfix virtual  mysql.  virtual alias issues.



## hockey97 (Nov 20, 2011)

Hi, currently I set up postfix with mysql database and devocot. Here is the issue: I can log in to my e-mail accounts and send e-mail to outside to the internet. The problem is that I can't send e-mail from the internet to any of these users account. I get an error saying sorry no such user on this server. I checked the logs and it says something about the virtual alias table lookup failed to find user such and such. 

Well here is the word for word error I see:

```
Recipient address rejected: User unknown in virtual alias table
```

I don't understand what this means? I do have the users created in the mysql database.
Even they have their own folders in the virtual mailbox path. I don't understand what is wrong. I just know it keeps failing to find such users on this server. I am guessing that the virtual alias script is wrong. Yet, I followed many tutorials. Can anyone explain to me what I need to do in the virtual alias map? what in the database is needed for my mail server to be able to find the users and their mailboxes so the mail server can deliver e-mails sent to these users.

I am having the same issues like this guy:

http://groups.google.com/group/mailing.postfix.users/browse_thread/thread/3f2ebf65a0244d93


but I want to be able to have multiple domain names to receive mail for.


----------



## redw0lfx (Nov 22, 2011)

It would help if you could show your current configuration. Or at least the virtual_* and smtpd_recipient_restrictions from /usr/local/etc/postfix/main.cf.  Also any /usr/local/etc/postfix/virtual_* files you have configured for. The more info the merrier.

Also, I am guessing each of your virtual email addresses will map to a physical UNIX user?  Or are you using a single UNIX account like 'vhost' to for all virtual users?  If the latter, then you want to use virtual mailbox domains, not virtual aliases domains.


----------



## hockey97 (Dec 7, 2011)

I am using one single physical UNIX user. I am using both methods currently at the same time.

What would normally cause such an error asp osted in my main post?


----------



## redw0lfx (Dec 7, 2011)

With the minimal information, I can only infer on how your setup would be. But to answer your question, that error is given if it can't find the user and map it to an account.  This can happen if you listed the domain in both the mydestination and in virtual_mailbox_domains.


----------



## hockey97 (Dec 13, 2011)

redw0lfx said:
			
		

> With the minimal information, I can only infer on how your setup would be. But to answer your question, that error is given if it can't find the user and map it to an account.  This can happen if you listed the domain in both the mydestination and in virtual_mailbox_domains.



ya, my domain name is listed in both. I thought it needs to be in both.


----------



## redw0lfx (Dec 13, 2011)

You can't have the same domain listed in both locations.  Please read the postfix virtual documentation if you haven't done so already.

Additionally, I normally set mydestination to be localhost.localdomain and use the virtual_mailbox_domains properties to list the domain names I would like to receive mail for, including the actual domain of that system.


----------



## hockey97 (Dec 14, 2011)

redw0lfx said:
			
		

> You can't have the same domain listed in both locations.  Please read the postfix virtual documentation if you haven't done so already.
> 
> Additionally, I normally set mydestination to be localhost.localdomain and use the virtual_mailbox_domains properties to list the domain names I would like to receive mail for, including the actual domain of that system.



I changed it with what you suggested. I still get the same error.


----------



## dave (Dec 19, 2011)

Are you able to post the contents of your MySQL  map file from the postfix config dir, and describe your MySQL table, and give us a sample row from the table?


----------

