Bug 1828854

Summary: msmtp-1.8.7-2 package broken at least making mailq hang
Product: [Fedora] Fedora EPEL Reporter: Justin Albstmeijer <justin>
Component: msmtpAssignee: Wart <wart>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: epel7CC: gbcox, lemenkov, ndevos, wart
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: msmtp-1.8.10-1.el7 msmtp-1.8.10-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-15 06:04:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Albstmeijer 2020-04-28 13:32:57 UTC
Description of problem:

After upgrading from msmtp-1.4.32-1.el7 to msmtp-1.8.7-2.el7, mailq hangs.
Downgrading back fixes mailq.

While debugging and reinstalling msmtp-1.8.7-2.el7 I find it has issues in post script.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Install or upgrade to msmtp-1.8.7-2.el7

Actual results:

D: adding "e61f2c2c5ad7d8c8a8a782af8b4f022cb4bb57c8" to Sha1header index.
D: %post(msmtp-1.8.7-2.el7.x86_64): scriptlet start
D: %post(msmtp-1.8.7-2.el7.x86_64): execv(/bin/sh) pid 29937
+ /usr/sbin/update-alternatives --install /usr/sbin/sendmail mta /usr/bin/msmtp 40 --slave /usr/lib/sendmail mta-sendmail /usr/bin/msmtp --slave /usr/share/man/man8/sendmail.8.gz mta-sendmailman /usr/share/man/man1/msmtp.1.gz --slave /usr/bin/mailq mta-mailq /usr/bin/msmtp --slave /usr/share/man/man1/mailq.1.gz mta-mailqman /usr/share/man/man1/msmtp.1.gz
+ /usr/sbin/install-info /usr/share/info/msmtp.info
install-info: No dir file specified; try --help for more information.
D: %post(msmtp-1.8.7-2.el7.x86_64): waitpid(29937) rc 29937 status 100
warning: %post(msmtp-1.8.7-2.el7.x86_64) scriptlet failed, exit status 1

and mailq hangs after that

Expected results:

No error and a functional mailq

Additional info:

Comment 1 Wart 2020-04-28 18:00:56 UTC
I've got a fix for the install-info error, but that shouldn't prevent msmtp from installing or working.  I'll take a look at the mailq issue next.

Comment 2 Wart 2020-04-28 19:08:56 UTC
I don't seem to have a working mailq with the older msmtp either, but at least the older one doesn't hang:

# rpm -q msmtp
msmtp-1.4.32-1.el7.x86_64

# alternatives --set mta /usr/bin/msmtp
# file /etc/alternatives/mta-mailq
/etc/alternatives/mta-mailq: symbolic link to `/usr/bin/msmtp'

# mailq
mailq: no recipients found

Is mailq from msmtp-1.4.32 actually doing anything useful for you?

In any case, I'll make the necessary changes so that mailq from msmtp-1.8.X does not hang indefinitely.

Comment 3 Fedora Update System 2020-04-29 10:37:52 UTC
FEDORA-EPEL-2020-6279ffdc77 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-6279ffdc77

Comment 4 Justin Albstmeijer 2020-04-29 14:02:12 UTC
Hi,

> # mailq
> mailq: no recipients found

I got this too with msmtp-1.8.7-2, but only after pressing Enter.
"no recipients found" does look to me like a valid mailq output, seems to behave more like a general mta.

> Is mailq from msmtp-1.4.32 actually doing anything useful for you?

Yes, works for me.

# rpm -q msmtp
msmtp-1.4.32-1.el7.x86_64

# ls -al /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 22 Apr 28 15:36 /etc/alternatives/mta-mailq -> /usr/bin/mailq.postfix

# mailq
Mail queue is empty

than

# rpm -Uvh msmtp-1.8.7-2.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:msmtp-1.8.7-2.el7                ################################# [ 50%]
install-info: No dir file specified; try --help for more information.
warning: %post(msmtp-1.8.7-2.el7.x86_64) scriptlet failed, exit status 1
Cleaning up / removing...
   2:msmtp-1.4.32-1.el7               ################################# [100%]


# ls -al /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 14 Apr 29 15:44 /etc/alternatives/mta-mailq -> /usr/bin/msmtp

mailq stops working

# rpm -Uvh msmtp-1.4.32-1.el7.x86_64.rpm --force
Preparing...                          ################################# [100%]
Updating / installing...
   1:msmtp-1.4.32-1.el7               ################################# [ 50%]
Cleaning up / removing...
   2:msmtp-1.8.7-2.el7                ################################# [100%]

# ls -al /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 14 Apr 29 15:44 /etc/alternatives/mta-mailq -> /usr/bin/msmtp

and now mailq again stops working

# rpm -e msmtp
# yum reinstall postfix

now a broken link /etc/alternatives/mta-mailq -> /usr/bin/msmtp

Now clean;

# rpm -e postfix msmtp --nodeps

# ls -al /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 14 Apr 29 15:57 /etc/alternatives/mta-mailq -> /usr/bin/msmtp (broken)

# yum install postfix

# alternatives --set mta /usr/sbin/sendmail.postfix

# ls -al /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 22 Apr 29 15:57 /etc/alternatives/mta-mailq -> /usr/bin/mailq.postfix

#rpm -ivh msmtp-1.8.7-2.el7.x86_64.rpm

# ls -al /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 22 Apr 29 15:57 /etc/alternatives/mta-mailq -> /usr/bin/mailq.postfix

# mailq
Mail queue is empty

So this way it seems to work, maybe something to do with alternatives mta was set to auto?


Gr, J

Comment 5 Wart 2020-04-29 14:12:33 UTC
Thank you for this additional feedback.  From your example above, the only reason 'mailq' was working was because the alternatives mta-mailq setting was set to use mailq from postfix, not msmtp.  If you explicitly set mta-mailq to msmtp, it will fail with the 'No recipients found' error (which is not a meaningful error message for mailq's intended purpose).

msmtp was never intended to be a full blown mta, and in fact I don't see that it ever really supported being used as a 'mailq' agent.  My fix in this latest package was to remove the mta-mailq alternative for msmtp, as it has never worked as intended.  But it appears that there is a corner case when the alternative setting for 'mta-mailq' is removed while msmtp is currently set as the active mta.  I didn't see this behavior when I tested with msmtp vs ssmtp, so I'll try again with msmtp vs postfix.

Comment 6 Wart 2020-04-29 14:31:10 UTC
(In reply to Justin Albstmeijer from comment #4)
[...]
> # rpm -Uvh msmtp-1.8.7-2.el7.x86_64.rpm
> Preparing...                          #################################
> [100%]
> Updating / installing...
>    1:msmtp-1.8.7-2.el7                ################################# [
> 50%]
> install-info: No dir file specified; try --help for more information.
> warning: %post(msmtp-1.8.7-2.el7.x86_64) scriptlet failed, exit status 1
> Cleaning up / removing...
>    2:msmtp-1.4.32-1.el7               #################################
> [100%]
> 
> 
> # ls -al /etc/alternatives/mta-mailq
> lrwxrwxrwx 1 root root 14 Apr 29 15:44 /etc/alternatives/mta-mailq ->
> /usr/bin/msmtp
> 
[...]

Please try again with msmtp-1.8.10-1.el7 linked in comment #3.  This has a fix for the %post scriptlet, and will no longer update the mta-mailq alternatives setting.

Comment 7 Fedora Update System 2020-04-30 06:09:20 UTC
FEDORA-EPEL-2020-6279ffdc77 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-6279ffdc77

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-05-15 06:04:04 UTC
FEDORA-EPEL-2020-6279ffdc77 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2020-05-19 16:08:35 UTC
FEDORA-EPEL-2020-04ae3db1b5 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-04ae3db1b5

Comment 10 Fedora Update System 2020-05-20 05:13:55 UTC
FEDORA-EPEL-2020-04ae3db1b5 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-04ae3db1b5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-06-04 00:49:15 UTC
FEDORA-EPEL-2020-04ae3db1b5 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.