Bug 1367858 - No alternatives exist for msmtp, yet do for esmtp
Summary: No alternatives exist for msmtp, yet do for esmtp
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: msmtp
Version: rawhide
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Gerald Cox
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1551346 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-17 16:31 UTC by Gerald Cox
Modified: 2023-03-08 21:55 UTC (History)
7 users (show)

Fixed In Version: msmtp-1.6.7-1.fc27 msmtp-1.6.7-1.fc28
Clone Of:
Environment:
Last Closed: 2018-07-01 22:23:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Gerald Cox 2016-08-17 16:31:59 UTC
Description of problem:

I needed to rebuild my system for F24.  Previously I had been just doing upgrades and had msmtp configured and working fine.  Apparently now, sendmail is no longer installed and instead esmtp is installed.  

I've installed msmtp and everything is working fine IF I directly invoke it - yet everything else on my system is using esmtp because of the alternatives setting.

I cannot remove esmtp because it has a ton of dependencies.  This whole thing is a bit weird IMO anyway because esmtp apparently is a dead project 

http://esmtp.sourceforge.net/

but Fedora for some reason decided to make it the default.  So now I'm stuck with esmtp which I don't want - and msmtp which I have installed and working, but there are no instructions on how to make it the default.

Shouldn't it also appear in alternatives?  If for some reason no, how do I make it the default?

Version-Release number of selected component (if applicable):
msmtp-1.6.5-1.fc24.x86_64

Comment 1 Gerald Cox 2016-08-17 17:48:37 UTC
I reviewed the esmtp.spec file, specifically these lines:

# setup dummy files for alternatives
rm -f %{buildroot}%{_bindir}/mailq
touch %{buildroot}%{_bindir}/mailq
rm -f %{buildroot}%{_libdir}/sendmail
mkdir -p %{buildroot}%{_prefix}/lib                                                                   
touch %{buildroot}%{_prefix}/lib/sendmail
rm -f %{buildroot}%{_sbindir}/sendmail
touch %{buildroot}%{_sbindir}/sendmail
rm -f %{buildroot}%{_mandir}/man1/sendmail.1*
touch %{buildroot}%{_mandir}/man1/mailq.1.gz
mkdir -p %{buildroot}%{_mandir}/man8/
touch %{buildroot}%{_mandir}/man8/sendmail.8.gz

and

# newaliases is fake, so don't install the links.
%{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{_bindir}/esmtp-wrapper 30 \
--slave %{_prefix}/lib/sendmail mta-sendmail %{_bindir}/esmtp-wrapper \
--slave %{_mandir}/man8/sendmail.8.gz mta-sendmailman %{_mandir}/man1/esmtp.1.gz \
--slave %{_bindir}/mailq mta-mailq %{_bindir}/esmtp-wrapper \
--slave %{_mandir}/man1/mailq.1.gz mta-mailqman %{_mandir}/man1/esmtp.1.gz

Since the dummy files have already been created by the default install of esmtp, they didn't need additional action.

I then modified and executed the alternative statements as follows:

/usr/sbin/alternatives --install /usr/sbin/sendmail mta /usr/bin/msmtp 30 \
--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

I then went into:  alternatives --config mta
and selected the just added entry for msmtp as the default

then re-ran logwatch manually and everything appears to be working again.

I guess the question is:  why isn't this code or some version of it included in the msmtp spec.  I quickly reviewed the comments in the package review and it was considered and then removed - but does esmtp have more functionality than msmtp?  I'm a bit confused here.  If the above method isn't recommended, then what is the solution?  msmtp needs to be installed as a drop in replacement doesn't it?  Isn't that it's function?  

Thanks!

Comment 2 Gerald Cox 2017-07-10 05:00:51 UTC
Adjusting the priority because this still isn't fixed.  Also, changing to F26 so it doesn't fall of the map when F25 is EOL.

Comment 3 Peter Lemenkov 2017-10-10 13:01:02 UTC
(In reply to Gerald Cox from comment #2)
> Adjusting the priority because this still isn't fixed.  Also, changing to
> F26 so it doesn't fall of the map when F25 is EOL.

Hello Gerald,

Since almost everything is done via GitHub nowadays, I almost stopped using msmtp (I'm still using it occasionally, but only for git-email purposes). If you have a patch which fixes that or willing to maintain the package, then drop me a note.

Comment 4 Gerald Cox 2017-10-15 20:39:35 UTC
(In reply to Peter Lemenkov from comment #3)
> Hello Gerald,
> 
> Since almost everything is done via GitHub nowadays, I almost stopped using
> msmtp (I'm still using it occasionally, but only for git-email purposes). If
> you have a patch which fixes that or willing to maintain the package, then
> drop me a note.

Hey Peter, thanks for the response.  I believe all this requires is a spec file change borrowing the methodology from esmtp.  I think all that needs to be done is outlined in comment #1.

I'd be happy to be a co-maintainer if you'd like and then I can make the changes to the spec file or you can take a stab at it yourself.  I think it would be pretty straightforward.

Thanks!

Comment 5 Aron Griffis 2017-12-03 03:53:23 UTC
Gerald, thanks for your tips here, allowed me to configure msmtp as my MTA.

Would definitely be nice to get this into the spec.

Comment 6 Aron Griffis 2018-03-26 12:50:49 UTC
Thomas Schneider submitted a patch for this in https://bugzilla.redhat.com/show_bug.cgi?id=1551346

Comment 7 Aron Griffis 2018-03-26 13:30:06 UTC
For anybody else looking, here's the one-liner:

/usr/sbin/alternatives \
--install /usr/sbin/sendmail mta /usr/bin/msmtp 30 \
--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

Comment 8 Gerald Cox 2018-03-26 16:26:45 UTC
(In reply to Aron Griffis from comment #7)
> For anybody else looking, here's the one-liner:
> 
> /usr/sbin/alternatives \
> --install /usr/sbin/sendmail mta /usr/bin/msmtp 30 \
> --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

Hi Aron...

I sent Peter an email to be co-maintainer.   Looks like he isn't seeing updates to this bug.

Comment 9 Gerald Cox 2018-06-23 02:38:28 UTC
Note:  rpmlint complains about the following:
msmtp.x86_64: E: wrong-script-interpreter /usr/share/doc/msmtp/scripts/msmtpq/msmtp-queue /usr/bin/env bash
msmtp.x86_64: E: wrong-script-interpreter /usr/share/doc/msmtp/scripts/msmtpq/msmtpq /usr/bin/env bash
msmtp.x86_64: E: wrong-script-interpreter /usr/share/doc/msmtp/scripts/msmtpqueue/msmtp-enqueue.sh /usr/bin/env bash
msmtp.x86_64: E: wrong-script-interpreter /usr/share/doc/msmtp/scripts/msmtpqueue/msmtp-listqueue.sh /usr/bin/env bash
msmtp.x86_64: E: wrong-script-interpreter /usr/share/doc/msmtp/scripts/msmtpqueue/msmtp-runqueue.sh /usr/bin/env bash
msmtp.x86_64: E: wrong-script-interpreter /usr/share/doc/msmtp/scripts/set_sendmail/set_sendmail.sh /usr/bin/env bash


These can be ignored, as per:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/PSJIYXHDRRHEZPUQYYN24MPKD4FRF6BB/

Comment 10 Gerald Cox 2018-06-23 03:00:33 UTC
*** Bug 1551346 has been marked as a duplicate of this bug. ***

Comment 11 Fedora Update System 2018-06-23 03:35:09 UTC
msmtp-1.6.6-6.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d13afeda5f

Comment 12 Fedora Update System 2018-06-23 03:35:31 UTC
msmtp-1.6.6-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-325016f0df

Comment 13 Fedora Update System 2018-06-23 04:27:52 UTC
msmtp-1.6.7-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-31a3b589c9

Comment 14 Fedora Update System 2018-06-23 04:28:22 UTC
msmtp-1.6.7-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-6992da4475

Comment 15 Fedora Update System 2018-06-23 18:56:08 UTC
msmtp-1.6.7-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-6992da4475

Comment 16 Fedora Update System 2018-06-23 21:22:14 UTC
msmtp-1.6.7-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-31a3b589c9

Comment 17 Fedora Update System 2018-07-01 22:23:39 UTC
msmtp-1.6.7-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2018-07-01 22:37:03 UTC
msmtp-1.6.7-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Gerald Cox 2023-03-08 21:55:24 UTC
*** Bug 2176591 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.