Pawel Wasylyszyn wrote: > Hello, > > I have a problem with virtual domains - when I'm trying to send an > e-mail from any host outside the localhost to user in virtual domain, > I get 'relay access denied'. > However, when I'm trying to send it from localhost, everything's OK. > MX is set to my Postfix machine, entries in MySQL are OK. > > When I'm trying to send mail from remote host, in MySQL logs I can see > that postfix doesn't query for full address, but only for the part > after @ - it also queries for domain I'm sending mail from: > > my source email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > my dest email : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > Please use example.(com|net|org) or domain.invalid when anonymizing domains. > > From any host outside localhost postfix sends following queries: > -- > 080826 18:37:53 133 Connect [EMAIL PROTECTED] on postfix > 133 Query SELECT goto FROM alias WHERE > address='domain.com <http://domain.com/>' > 134 Connect [EMAIL PROTECTED] on postfix > 134 Query SELECT domain FROM domain WHERE > domain='domain.com <http://domain.com/>' > 133 Query SELECT goto FROM alias WHERE > address='virtual.com <http://virtual.com/>' > 134 Query SELECT domain FROM domain WHERE > domain='virtual.com <http://virtual.com/> > -- > > When I'm sending it from localhost, it queries OK, though: > > -- > 080826 19:01:10 179 Connect [EMAIL PROTECTED] on postfix > 179 Query SELECT goto FROM alias WHERE > address='[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>' > 176 Query SELECT goto FROM alias WHERE > address='virtual.com <http://virtual.com/>' > 177 Query SELECT domain FROM domain WHERE > domain='virtual.com <http://virtual.com/>' > 180 Connect [EMAIL PROTECTED] on postfix > 180 Query SELECT maildir FROM mailbox WHERE > username='[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>' > --
These are moderately useful, but temporarily increasing the verbosity on a master.cf process will show you even more. > > Here's my configuration: > > -- > [EMAIL PROTECTED]:~# postconf -n > > maximal_queue_lifetime = 2 This is rather short. The default accounts for DNS failures and temporary outages more effectively. > mydestination = xxxxxxxxxx, localhost I hope your virtual domain is not listed here. > virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf > <http://mysql_virtual_alias_maps.cf/> > virtual_mailbox_domains = > mysql:/etc/postfix/mysql_virtual_domains_maps.cf > <http://mysql_virtual_domains_maps.cf/> > virtual_mailbox_maps = > mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf > <http://mysql_virtual_mailbox_maps.cf/> > The maps below are using the obsolete syntax (as of Postfix 2.2). Try changing them as listed. Then, test each with 'postconf -q testvalue mysql:/path/to/map' (see man postconf) > > [EMAIL PROTECTED]:~# cat /etc/postfix/mysql_virtual_alias_maps.cf > <http://mysql_virtual_alias_maps.cf/> > user = postfix > password = xxxxx > hosts = yyyyyy > table = alias > dbname = postfix > select_field = goto > where_field = address user = postfix password = xxxxx hosts = yyyyyy dbname = postfix query = SELECT goto FROM alias WHERE address='%s' > > > [EMAIL PROTECTED]:~# cat /etc/postfix/mysql_virtual_domains_maps.cf > <http://mysql_virtual_domains_maps.cf/> > user = postfix > password = xxxxxxx > hosts = yyyyyyyyy > dbname = postfix > table = domain > select_field = domain > where_field = domain user = postfix password = xxxxx hosts = yyyyyy dbname = postfix query = SELECT goto FROM alias WHERE address='%s' > > [EMAIL PROTECTED]:~# cat /etc/postfix/mysql_virtual_mailbox_maps.cf > <http://mysql_virtual_mailbox_maps.cf/> > user = postfix > password = xxxxxxx > hosts = yyyyyyyy > dbname = postfix > table = mailbox > select_field = maildir > where_field = username user = postfix password = xxxxx hosts = yyyyyy dbname = postfix query = SELECT maildir FROM mailbox WHERE username='%s' > -- > > > Postfix version 2.3.8-2, Debian 4. If nothing changes, please post verbose logs for single lookups as well as the results of a 'postmap -q' of each map. Brian