Public bug reported:

Binary package hint: dovecot-common

The post-inst script for dovecot does not take into account having
multiple ssl certs in the configuration.  If there are, the script fails
as follows:

***********************************************************
Unpacking replacement dovecot-common ...
Setting up dovecot-common (1:1.0.5-1ubuntu2.1) ...
[: 75: /etc/ssl/certs/cert2.crt: unexpected operator
Creating generic self-signed certificate:  /etc/ssl/certs/cert1.crt
 /etc/ssl/certs/cert2.crt
 /etc/ssl/certs/cert3.crt
(replace with hand-crafted or authorized one if needed).
Warning : Bad SSL config, can't generate certificate.
[: 75: /etc/ssl/certs/cert2.crt: unexpected operator

Setting up dovecot-pop3d (1:1.0.5-1ubuntu2.1) ...
 * Restarting IMAP/POP3 mail server dovecot                                     
                                                                   [ OK ]

Setting up dovecot-imapd (1:1.0.5-1ubuntu2.1) ...
 * Restarting IMAP/POP3 mail server dovecot  

************************************************************

This appears to be the fault of the following grep not accounting for
multiple occurances in postinst:

  ## SSL Certs
  # Certs and key file
  SSL_CERT=$( (grep "ssl_cert_file" /etc/dovecot/dovecot.conf  || echo 
'/etc/ssl/certs/dovecot.pem') | cut -d'=' -f2)
  SSL_KEY=$( (grep "ssl_key_file" /etc/dovecot/dovecot.conf || echo 
'/etc/ssl/private/dovecot.pem') | cut -d'=' -f2)

I would recommend adding -m 1 to the grep to limit the number of hits
returned to one.  This wouldn't help if a random one of multiple certs
was missing, but it would avoid breakage and serve the same purpose it
was intended to serve now.

  ## SSL Certs
  # Certs and key file
  SSL_CERT=$( (grep -m 1 "ssl_cert_file" /etc/dovecot/dovecot.conf  || echo 
'/etc/ssl/certs/dovecot.pem') | cut -d'=' -f2)
  SSL_KEY=$( (grep -m 1 "ssl_key_file" /etc/dovecot/dovecot.conf || echo 
'/etc/ssl/private/dovecot.pem') | cut -d'=' -f2)

** Affects: dovecot (Ubuntu)
     Importance: Undecided
         Status: New

-- 
dovecot-common postinst fails for multiple ssl certs
https://bugs.launchpad.net/bugs/182086
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to