I've run into a problem with one of the postfix tls scripts.
Attempting to deploy server certificates with
# postfix tls deploy-server-cert certificate.crt keyfile.key
Expected to deploy new certificates
What happened - command fails with
/usr/lib/postfix/sbin/postfix-tls-script: 780: shift: can't shift
that many
Reproducing this doesn't need a lot of pre-setup:
# apt install postfix ssl-cert
# postfix tls deploy-server-cert /etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/ssl/private/ssl-cert-snakeoil.key
/usr/lib/postfix/sbin/postfix-tls-script: 780: shift: can't shift that
many
The issue appears to be that the function "deploy-server-cert" in
/usr/lib/postfix/sbin/postfix-tls-script expects be three arguments:
/usr/lib/postfix/sbin/postfix-tls-script line 777
deploy_server_cert() {
certfile=$1; shift
keyfile=$1; shift
deploy=$1; shift
...
This works when the function is called by new_server_cert() in line 830,
which calls the function as follows:
deploy_server_cert "${certfile}" "${keyfile}" "${deploy}" || return
1
But when this function is invoked directly in line 1042, it is called
with only 2 arguments
deploy_server_cert "${certfile}" "${keyfile}" || exit 1
My work-around was to comment out the final shift in line 780, which is
probably NOT the best long-term solution.
Please let me know if I may provide additional information.
Thanks for your help!
=>Robert
$ lsb_release -rd
Description: Ubuntu 18.04.4 LTS
Release: 18.04
postfix:
Installed: 3.3.0-1ubuntu0.2
Candidate: 3.3.0-1ubuntu0.2
Version table:
*** 3.3.0-1ubuntu0.2 500
500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu
bionic-updates/main amd64 Packages
100 /var/lib/dpkg/status
3.3.0-1 500
500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main
amd64 Packages
$ ubuntu@mail3:~$ postconf -d | egrep mail_version
mail_version = 3.3.0
Please let me know