upgrade bug from 18.04 to 20.04; dpkg: error processing package ssmtp (--configure): installed ssmtp package post-installation script subprocess returned error exit status 2

Bug #1897523 reported by Maksim Yu.Semenov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ssmtp (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

error during 'do-release-upgrade -d'
======================
[...]
Progress: [ 99%]
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-3) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.2) ...
Errors were encountered while processing:
 ssmtp
Exception during pm.DoInstall(): E:Sub-process /usr/bin/dpkg returned an error code (1)

Could not install the upgrades

The upgrade has aborted. Your system could be in an unusable state. A
recovery will run now (dpkg --configure -a).

Please report this bug in a browser at
http://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+filebug
and attach the files in /var/log/dist-upgrade/ to the bug report.
E:Sub-process /usr/bin/dpkg returned an error code (1)

Setting up ssmtp (2.64-8.1ubuntu1) ...
/var/lib/dpkg/info/ssmtp.config: 11: export: #адрес: bad variable name
dpkg: error processing package ssmtp (--configure):
 installed ssmtp package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 ssmtp

Upgrade complete

The upgrade has completed but there were errors during the upgrade
process.

To continue please press [ENTER]
===========================================

However 'lsb_release -a' output
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Revision history for this message
Maksim Yu.Semenov (rasmiy) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

The file /var/lib/dpkg/info/ssmtp.config contains the following lines:

if [ -f /etc/ssmtp/ssmtp.conf ]
then
        for v in `grep -E "^(root|mailhub|rewriteDomain|hostname|FromLineOverride)=" /etc/ssmtp/ssmtp.conf`
        do
                export $v
        done

So it was reading your /etc/ssmtp/ssmtp.conf and found something that could not be exported.

affects: ubuntu-release-upgrader (Ubuntu) → ssmtp (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ssmtp (Ubuntu):
status: New → Confirmed
Revision history for this message
Dominik Müller (muellerdo) wrote :

Got the same issue. Is there any chance to solve this issue / bug?

Revision history for this message
Dominik Müller (muellerdo) wrote :

Here is my /var/lib/dpkg/info/ssmtp.config file.

set -e

. /usr/share/debconf/confmodule

if [ -f /etc/ssmtp/ssmtp.conf ]
then
        for v in `grep -E "^(root|mailhub|rewriteDomain|hostname|FromLineOverride)=" /etc/ssmtp/ssmtp.conf`
        do
                export $v
        done

        db_set ssmtp/root "$root"
        if [ -n "$mailhub" ]
        then
                if [ `expr index "$mailhub" :` -ne 0 ]
                then
                        db_set ssmtp/port "${mailhub#*:}"
                        db_set ssmtp/mailhub "${mailhub%:*}"
                else
                        db_set ssmtp/port 25
                        db_set ssmtp/mailhub "$mailhub"
                fi
        fi
        if [ -n "$rewriteDomain" ]
        then
                db_set ssmtp/rewritedomain "$rewriteDomain"
        fi
        if [ -n "$hostname" ]
        then
                db_set ssmtp/hostname "$hostname"
        fi
        if [ -n "$FromLineOverride" ]
        then
                if [ "$FromLineOverride" = "YES" ]
                then
                        db_set ssmtp/fromoverride true
                else
                        db_set ssmtp/fromoverride false
                fi
        fi
fi

db_input medium ssmtp/root || true
db_go

db_input medium ssmtp/mailhub || true
db_go

db_input low ssmtp/port || true
db_go

db_input medium ssmtp/rewritedomain || true
db_go

db_input low ssmtp/hostname || true
db_go

db_input medium ssmtp/fromoverride || true
db_go

# Program End
exit 0

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.