4

I've found that the msmtp package for Ubuntu 18.04 is old and missing a component. The current included package is version 1.6.6 from 2016-11-14 and is missing msmtpd. I would like to install version 1.8.6 from 2019-09-27 that is significantly updated and does include msmtpd.

What are the proper configuration arguments that would get this to compile with appropriate make install locations for Ubuntu 18.04?

Additionally, what would be the process for creating a quick /etc/init.d/ startup script for this so as to make sure that this service starts at boot-up and can be restarted easily?

A simle ./configure gives the following output, which appears to be missing TLS and I don't think /usr/local is the preferred folder from the other package's defaults:

Install prefix ......... : /usr/local
NLS support ............ : yes
TLS support ............ : no (Library: none)
IDN support ............ : yes (no library required)
GNU SASL support ....... : no (most likely unnecessary)
Libsecret support (GNOME): no
MacOS X Keychain support : no
Build msmtpd ............: yes
user.dz
  • 48,105
ylluminate
  • 1,459

1 Answers1

3

First, /usr/local is usually where manually installed packages go (/usr/local/bin). This will override any packages in /usr/bin or other directories used by apt installed packages.

Next, install the build dependencies:

sudo apt build-dep msmtp

Now, cd into the msmtp directory and run the following commands:

make clean
./configure
make
sudo make install 

This will install to the correct location which is /usr/local. When you install to this directory, you do not need to uninstall the apt version so that packages that depend on msmtp will not break. When you or the system runs msmtp, the version in /usr/local will be used.

To uninstall, cd into the msmtp directory and run the following command:

sudo make uninstall
mchid
  • 43,546
  • 8
  • 97
  • 150
  • I assume the apt build-dep msmtp is to get the TLS support from the original package? When I execute this I get E: You must put some 'source' URIs in your sources.list – ylluminate Oct 20 '19 at 17:52
  • @ylluminate Yes, this installs all the packages needed to build msmtp. Try running again. It looks like you ran: sudo apt build-dep instead of sudo apt build-dep msmtp – mchid Oct 20 '19 at 17:55
  • 1
    Unfortunately not: https://share.getcloudapp.com/2NuA0XNp – ylluminate Oct 20 '19 at 18:09
  • 2
    @ylluminate Sorry, I was looking at a different error message. You need to enable the sources in your /etc/apt/sources.list file. You can easily do that using the software center. https://askubuntu.com/a/857433/167115 Of course, you will probably need to run: sudo apt update before you try again. – mchid Oct 20 '19 at 18:14
  • Excellent, yes that makes sense and that did work out here now. One final point as per the initial question is the missing aspect of adding the appropriate startup script to /etc/init.d. I assume I should just take an existing script and hack it out to work for msmtpd, however I do want to be sure I get a clean and appropriate enough starting point. – ylluminate Oct 20 '19 at 18:29
  • @ylluminate Yeah msmtpd just has start stop options and I don't see any systemd stuff so that sounds about right. Archlinux has some information but it mentions using a cron service that is not used by Ubuntu and the Ubuntu docs don't say much. There is also a doc directory in the build directory that has an msmtpd file but it doesn't say much either. – mchid Oct 20 '19 at 19:04