# Postfix: unreasonable virtual_alias_maps map nesting

## jaeger_m

Hey...

I'm using postfix+mysql and i would like to use aliases.

I've got an alias table:

address 	goto 	domain 	created 	modified 	active

a@esel2k.org	b@esel2k.org	esel2k.org	2007-03-08 15:58:08	2007-03-08 15:58:08	1

#mysql-aliases.cf

user         = mailsql

password     = mailsql

dbname       = postfix

table        = alias

select_field = goto

where_field  = address

hosts        = localhost

Error:

Mar  8 16:15:10 www postfix/cleanup[15062]: warning: B02164142B4: unreasonable virtual_alias_maps map nesting for a@esel2k.org

I did some googling, but found nothing of assistance, so I hope someone here can help?!?

Greetings!

----------

## steveb

What Postfix version?How about posting main.cf and master.cf?

On my setup I have the following table:

```
+----------+--------------+------+-----+---------------------+-------+

| Field    | Type         | Null | Key | Default             | Extra |

+----------+--------------+------+-----+---------------------+-------+

| address  | varchar(255) | NO   | PRI |                     |       |

| goto     | text         | NO   |     |                     |       |

| domain   | varchar(255) | NO   |     |                     |       |

| created  | datetime     | NO   |     | 0000-00-00 00:00:00 |       |

| modified | datetime     | NO   |     | 0000-00-00 00:00:00 |       |

| active   | tinyint(1)   | NO   | MUL | 1                   |       |

+----------+--------------+------+-----+---------------------+-------+
```

And the following MySQL config in Postfix:

```
# /etc/postfix/virtual_alias_maps.mysql

#

# virtual_alias_maps = mysql:/etc/postfix/virtual_alias_maps.mysql

user                    = XXX

password                = XXX

dbname                  = postfix

hosts                   = localhost

query                   = SELECT goto FROM alias WHERE CONVERT(address USING utf8)=CONVERT(_latin1'%s' USING utf8) AND active='1'
```

And the following stuff in main.cf (I am using proxy maps):

```
virtual_alias_maps =

        ...

        proxy:mysql:$config_directory/virtual_alias_maps.mysql

        ...
```

cheers

SteveB

----------

## jaeger_m

Doesn't work for me as I can't insert the "select" statement but have to specify the fields al listed above.

main.cf:

```
myhostname = www.entertainment-zone.de

#alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

myorigin = /etc/mailname

mydestination = $myhostname, localhost.$mydomain, $mydomain

mynetworks = 127.0.0.0/8, (MY IP)/24

inet_interfaces = all

smtpd_delay_reject = yes

smtpd_helo_required = yes

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain = $mydomain

broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =

        permit_mynetworks

        permit_sasl_authenticated

        reject_unauth_destination

        reject_unauth_pipelining

        reject_invalid_hostname

        reject_non_fqdn_sender

        reject_non_fqdn_recipient

        check_helo_access hash:/etc/postfix/helo_access

        reject_unknown_sender_domain

smtp_use_tls = yes

smtp_tls_per_site = hash:/etc/postfix/tls_per_site

smtp_tls_CAfile = /etc/ssl/private/entertainment-zone.de.pem

smtpd_use_tls = yes

smtpd_tls_cert_file = /etc/ssl/private/mail.entertainment-zone.de.pem

smtpd_tls_CAfile = /etc/ssl/private/entertainment-zone.de.pem

smtpd_tls_received_header = yes

alias_maps = mysql:/etc/postfix/mysql-aliases.cf

//relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

local_transport = virtual

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

virtual_transport = virtual

virtual_mailbox_base = /

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf

#virtual_mailbox_limit =

#virtual_mailbox_domains = ad-index.de

virtual_uid_maps = static:103

virtual_gid_maps = static:104

virtual_minimum_uid = 103

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf mysql:/etc/postfix/mysql-aliases.cf

# Additional for quota support

virtual_create_maildirsize = yes

virtual_mailbox_extended = yes

virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf

virtual_mailbox_limit_override = yes

virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.

virtual_overquota_bounce = yes

```

master.cf:

```
# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (yes)   (never) (100)

# ==========================================================================

smtp      inet  n       -       n       -       -       smtpd

#submission inet n      -       -       -       -       smtpd

#       -o smtpd_etrn_restrictions=reject

#628      inet  n       -       -       -       -       qmqpd

pickup    fifo  n       -       -       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       -       300     1       qmgr

#qmgr     fifo  n       -       -       300     1       oqmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       -       -       0       bounce

defer     unix  -       -       -       -       0       bounce

trace     unix  -       -       -       -       0       bounce

verify    unix  -       -       -       -       1       verify

flush     unix  n       -       -       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       -       -       -       smtp

relay     unix  -       -       -       -       -       smtp

#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5

showq     unix  n       -       -       -       -       showq

error     unix  -       -       -       -       -       error

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

#

# Interfaces to non-Postfix software. Be sure to examine the manual

# pages of the non-Postfix software to find out what options it wants.

#

# maildrop. See the Postfix MAILDROP_README file for details.

#

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient

scalemail-backend unix  -       n       n       -       2       pipe

  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}

# only used by postfix-tls

tlsmgr    fifo  -       -       n       300     1       tlsmgr

#smtps    inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes

#587      inet  n       -       n       -       -       smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes

```

as to the version:

```
Mar  9 20:44:46 www postfix/master[8175]: daemon started -- version 2.1.5

```

----------

## jaeger_m

noone?!?

----------

## steveb

this looks fishy:

```
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf mysql:/etc/postfix/mysql-aliases.cf
```

can you post the content of mysql-virtual.cf?

can you as well post the output of this command:

```
postmap -v -q a@esel2k.org mysql:/etc/postfix/mysql-virtual.cf
```

and of this command as well:

```
postmap -v -q a@esel2k.org mysql:/etc/postfix/mysql-aliases.cf
```

----------

