Upgrade doesnt work if using mysql dict types

Bug #200308 reported by darren
2
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Invalid
Undecided
LaMont Jones

Bug Description

Whenever any updates to Postfix come out, I have to change my main.cf so there are no mysql: dict types in there otherwise dist-upgrade fails:

darrenm@ugs:~$ sudo apt-get dist-upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up postfix (2.5.1-1~gutsy2) ...

Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
postalias: fatal: dict_mkmap_func: unsupported dictionary type: mysql does not allow map creation.
dpkg: error processing postfix (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postfix-mysql:
 postfix-mysql depends on postfix; however:
  Package postfix is not configured yet.
 postfix-mysql depends on postfix (= 2.5.1-1~gutsy2); however:
  Package postfix is not configured yet.
dpkg: error processing postfix-mysql (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 postfix
 postfix-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 200308] [NEW] Upgrade doesnt work if using mysql dict types

 status: incomplete

What makes you think that's a supported configuration? I've reviewed the
postfix documentation and don't find it. I think what you want is described
in the "Using MySQL tables" section of the MYSQL_README..

Please check that and provide the output of postconf -n and a copy of the
/etc/postfix/mysql-aliases.cf file (IMPORTANT: Munge or remove the user ID
and password in that file before providing it)

Revision history for this message
darren (darrenm) wrote :

How is it not a supported configuration? the apt-get upgrade process fails all the same. mysql dict types are in the postfix documentation.

man mysql_table
darrenm@darrenm:~$ sudo dpkg-query -S mysql_table
postfix: /usr/share/man/man5/mysql_table.5.gz

Not sure what you mean by "I think what you want is described in the "Using MySQL tables" section of the MYSQL_README.' - I'm not in need of any configuration help or anything, I'm just reporting a bug in the Postfix package.

I'll post the 2 requested outputs when I get on the box later.

Just to clarify: If I have mysql as a dict type then the postfix post-inst(?) running newaliases fails. If I take mysql out of main.cf then it works. Its an easy workaround but surely one that shouldn't need to be done?

Revision history for this message
Scott Kitterman (kitterman) wrote :

OK. I use postfix and help maintain it, but don't personally use mysql with it.

In terms of what's supported and not, all the documentation I can find refers to mysql and postmap, not mysql and postaliases or newaliases. What I can't tell right now is if the mysql dict is getting stuffed into newaliases because of something specific to your configuration, a bug in the post-inst, or if I'm completely missing the point.

Revision history for this message
darren (darrenm) wrote :

I use Postfix but I don't help maintain it so you know more about it than me. :)

Anyway, I don't have a mysql_aliases.cf file. This is the closest one which is just the query to use for the alias maps.

root@ugs:~# cat /etc/postfix/mysql_virtual_alias_maps
user = ugs
password=[removed]
dbname=ugs_development
hosts=127.0.0.1
query = SELECT goto FROM aliases WHERE address='%s'

And the postconf -n

alias_database = mysql:/etc/postfix/mysql_virtual_alias_maps
alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 4h
fallback_transport = virtual
inet_interfaces = all
mailbox_size_limit = 0
mydestination =
myhostname = ugs
mynetworks = 127.0.0.0/8, 192.168.0.0/24
myorigin = /etc/mailname
recipient_delimiter = +
relayhost = post.demon.co.uk
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myorigin ESMTP $mail_name (Ubuntu)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_sender_login_maps
smtpd_tls_cert_file = /etc/ssl/certs/ugs.pem
smtpd_tls_key_file = /etc/ssl/private/ugs.key
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps
virtual_gid_maps = static:155
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps
virtual_transport = virtual
virtual_uid_maps = static:155

Thanks :)

Revision history for this message
Scott Kitterman (kitterman) wrote :

I'm a little confused by your configuration. You have:

alias_database = mysql:/etc/postfix/mysql_virtual_alias_maps
alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps

and

virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps

I don't think you need both of these. I suspect that if you restore alias_database and alias_maps to the Ubuntu default values:

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

your system would still work correctly and the problem would go away. I'm guessing that you only want mysql lookups for your virtual domains. The way you have it now, it's looked up for all domains. I'm not certain of this, so please try the change and see if it still does what you need. If it does, we can maybe go through downgrading and upgrading and see if this is the root of the issue.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 200308] Re: Upgrade doesnt work if using mysql dict types

Any updates?

Changed in postfix:
status: New → Incomplete
Revision history for this message
darren (darrenm) wrote :

I'm sure you're correct with what you say Scott. I'll check tonight and post if it fixes.

Thanks

Revision history for this message
LaMont Jones (lamont) wrote :

> alias_database = mysql:/etc/postfix/mysql_virtual_alias_maps

alias_database is the list of maps that newaliases should rebuild whenever it is run...
exactly what are you expecting postfix to do to rebuild your mysql database??

alias_maps is the list of maps that are queried to find where mail should be redirected.

The bug here is in the usage of the configuration.

Changed in postfix:
assignee: nobody → lamont
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.