Friday, January 19, 2018

Joe Barker: Configuring MSMTP On Ubuntu 16.04 (Again)

Joe Barker: Configuring MSMTP On Ubuntu 16.04 (Again)


Joe Barker: Configuring MSMTP On Ubuntu 16.04 (Again)

Posted: 19 Jan 2018 02:30 AM PST

This post exists as a copy of what I had on my previous blog about configuring MSMTP on Ubuntu 16.04; I'm posting it as-is for posterity, and have no idea if it'll work on later versions. As I'm not hosting my own Ubuntu/MSMTP server anymore I can't see any updates being made to this, but if I ever do have to set this up again I'll create an updated post! Anyway, here's what I had…

I previously wrote an article around configuring msmtp on Ubuntu 12.04, but as I hinted at in a previous post that sort of got lost when the upgrade of my host to Ubuntu 16.04 went somewhat awry. What follows is essentially the same post, with some slight updates for 16.04. As before, this assumes that you're using Apache as the web server, but I'm sure it shouldn't be too different if your web server of choice is something else.

I use msmtp for sending emails from this blog to notify me of comments and upgrades etc. Here I'm going to document how I configured it to send emails via a Google Apps account, although this should also work with a standard Gmail account too.

To begin, we need to install 3 packages:
sudo apt-get install msmtp msmtp-mta ca-certificates
Once these are installed, a default config is required. By default msmtp will look at /etc/msmtprc, so I created that using vim, though any text editor will do the trick. This file looked something like this:

# Set defaults.  defaults  # Enable or disable TLS/SSL encryption.  tls on  tls_starttls on  tls_trust_file /etc/ssl/certs/ca-certificates.crt  # Setup WP account's settings.  account   host smtp.gmail.com  port 587  auth login  user   password   from   logfile /var/log/msmtp/msmtp.log    account default :   

Any of the uppercase items (i.e. ) are things that need replacing specific to your configuration. The exception to that is the log file, which can of course be placed wherever you wish to log any msmtp activity/warnings/errors to.

Once that file is saved, we'll update the permissions on the above configuration file — msmtp won't run if the permissions on that file are too open — and create the directory for the log file.

sudo mkdir /var/log/msmtp  sudo chown -R www-data:adm /var/log/msmtp  sudo chmod 0600 /etc/msmtprc  

Next I chose to configure logrotate for the msmtp logs, to make sure that the log files don't get too large as well as keeping the log directory a little tidier. To do this, we create /etc/logrotate.d/msmtp and configure it with the following file. Note that this is optional, you may choose to not do this, or you may choose to configure the logs differently.

/var/log/msmtp/*.log {  rotate 12  monthly  compress  missingok  notifempty  }  

Now that the logging is configured, we need to tell PHP to use msmtp by editing /etc/php/7.0/apache2/php.ini and updating the sendmail path from
sendmail_path =
to
sendmail_path = "/usr/bin/msmtp -C /etc/msmtprc -a -t"
Here I did run into an issue where even though I specified the account name it wasn't sending emails correctly when I tested it. This is why the line account default : was placed at the end of the msmtp configuration file. To test the configuration, ensure that the PHP file has been saved and run sudo service apache2 restart, then run php -a and execute the following

mail ('personal@email.com', 'Test Subject', 'Test body text');  exit();  

Any errors that occur at this point will be displayed in the output so should make diagnosing any errors after the test relatively easy. If all is successful, you should now be able to use PHPs sendmail (which at the very least WordPress uses) to send emails from your Ubuntu server using Gmail (or Google Apps).

I make no claims that this is the most secure configuration, so if you come across this and realise it's grossly insecure or something is drastically wrong please let me know and I'll update it accordingly.

Re-imagining beta testing in the ever-changing world of automation

Re-imagining beta testing in the ever-changing world of automation


Re-imagining beta testing in the ever-changing world of automation

Posted: 18 Jan 2018 11:51 PM PST

Fundamentally, beta testing is a test of a product performed by real users in the real environment. There are a number of names for this type of testing—user acceptance testing (UAT), customer acceptance testing (CAT), customer validation and field testing (common in Europe)—but the basic components are more or less the same. All involve user testing of the front-end user interface (UI) and the user experience (UX) to find and resolve potential issues.read more

Purism Progress Report, Spectre Mitigation for Ubuntu, Malicious Chrome Extensions and More

Posted: 18 Jan 2018 10:36 PM PST

Purism, the group behind the security and privacy-focused Librem 5 phone just recently published a progress report highlighting the latest developments and design decisions to its crowdfunded project. Changes include an even faster processor.

Google moves to Debian for in-house Linux desktop

Posted: 18 Jan 2018 09:22 PM PST

Google is officially moving from Ubuntu to Debian for its in-house Linux desktop. Google has officially confirmed the company is shifting its in-house Linux desktop from the Ubuntu-based Goobuntu to a new Linux distro, the DebianTesting-based gLinux.

$25k Linux Journalism Fund

Posted: 18 Jan 2018 08:08 PM PST

Linux Journal's new parent, Private Internet Access, has established a $25k fundto jump-start the next generation of Linux journalism[he]mdash[/he]and to spend it here,where Linux journalism started in 1994.

How to Install Cassandra Distributed Database on CentOS 7

Posted: 18 Jan 2018 06:53 PM PST

In this tutorial, we will learn how to install and configure Cassandra on CentOS 7. Cassandra is a free and open source distributed database management system that can be used to handle large amounts of data across many servers.

SBC kit runs Linux on a quad -A53 i.MX8M SoC

Posted: 18 Jan 2018 05:39 PM PST

CompuLab released details and pricing for its "SBC-iMX8 Evaluation Kit." The sandwich-style SBC includes an i.MX8M-based CL-SOM-iMX8 module, and provides WiFi, BT, GbE, USB 3.0, PCIe, HDMI 2.0, and more. Earlier this week when we reported on CompuLab's CL-SOM-iMX8 compute module, there were only a few details on the board's SBC-iMX8 Evaluation Kit.

Educational-Oriented Escuelas Linux 5.6 Distro Released with LibreOffice 6.0

Posted: 18 Jan 2018 04:25 PM PST

Bodhi-based, educational-oriented Escuelas Linux GNU/Linux distribution has been updated today to version 5.6, as developer Alejandro Diaz informed us a few moments ago.

Monitoring Your Picluster with Elasticsearch and Kibana

Posted: 18 Jan 2018 03:10 PM PST

PiCluster is a simple way to manage Docker containers on multiple hosts. It will work on x86 or ARM CPU architectures that can run Docker and Node.js. PiCluster 2.3 will be out soon and I wanted to share the exciting new Elasticsearch integration currently in the dev branch. Traditionally, PiCluster had the ability to store its log output in Elasticsearch. Starting in PiCluster 2.3, node metrics such as disk, cpu, and memory utilization is stored also. With this ability, users can easily view their host metrics over time.

Amazing Facts about Linux Operating System You Probably Don't Know

Posted: 18 Jan 2018 01:56 PM PST

It was almost 20 years ago when the first version of Linux came into the market and since then, this operating system has made its important stature beside Microsoft Windows. Linux has turned out to be one of the most acknowledged and extensively used operating system.

Cooking With Linux : Installing and Running ReactOS

Posted: 18 Jan 2018 12:42 PM PST

VIDEO: Back in the before time (1996), there was a project called FreeWin95 which was originally meant to create a clone of Windows 95. Two years later, that project became ReactOS.

Securing the Linux filesystem with Tripwire

Posted: 18 Jan 2018 11:27 AM PST

While Linux is considered to be the most secure operating system (ahead of Windows and MacOS), it is still vulnerable to rootkits and other variants of malware. Thus, Linux users need to know how to protect their servers or personal computers from destruction, and the first step they need to take is to protect the filesystem.read more

No More Ubuntu! Debian is the New Choice For Google’s In-house Linux Distribution

Posted: 18 Jan 2018 10:13 AM PST

Goobuntu is now being replaced by gLinux, which is based on Debian Testing.

4 Tools for Network Snooping on Linux

Posted: 18 Jan 2018 08:59 AM PST

Carla Schroder looks at how to use whois, dig, nmcli, and nmap to investigate networks.

NHS: Thanks for all the free work, Linux nerds, now face our trademark cops

Posted: 18 Jan 2018 07:44 AM PST

Dev team quits, suggests NHS used them to get better deal with MicrosoftThe small team behind an ambitious NHoS Linux project are calling it a day, citing receipt of a trademark infringement warning from the Department of Health's (DoH) "brand police" as the "final straw".…

How to create outlines in Linux with TreeLine

Posted: 18 Jan 2018 06:30 AM PST

As someone who's been known to string a few words together, I know that a well-crafted outline can be a key part of any writing project. Why? A good outline helps you organize your work. It provides a structure for what you're writing as well as a roadmap from beginning to end.Outlines aren't just for writing, either. They can be a great tool for organizing just about any kind of project.read more

Microsoft, Masking/Hiding Itself Behind Patent Trolls, is Still Engaging in Patent Extortion

Posted: 18 Jan 2018 05:16 AM PST

A review of Microsoft's ugly tactics, which involve coercion and extortion (for businesses to move to Azure and/or for OEMs to preload Microsoft software) while Microsoft-connected patent trolls help hide the "enforcement" element in this whole racket

Hehe, still writing code for a living? It's 2018. You could be earning x3 as a bug bounty hunter

Posted: 18 Jan 2018 03:24 AM PST

Oh, yeah, and learning new tricks and protecting stuff, sureEthical hacking to find security flaws appears to pay better, albeit less regularly, than general software engineering.…

Firefox locks down its future with HTTPS 'secure contexts'

Posted: 18 Jan 2018 02:10 AM PST

Mozilla's embrace of HTTPS, the secure form of HTTP, has ratcheted up a notch with the news that Firefox developers must start using a web security design called 'secure contexts' "effective immediately."

Four Malicious Google Chrome Extensions Affect 500K Users

Posted: 18 Jan 2018 12:56 AM PST

The ICEBRG Security Research team discovered four malicious Google Chrome extensions during a routine investigation of anomalous traffic. More than 500,000 users, including workstations in major businesses around the world, have been affected.

Getting Started with ncurses

Getting Started with ncurses


Getting Started with ncurses

Posted: 18 Jan 2018 01:22 PM PST

How to use curses to draw to the terminal screen.

While graphical user interfaces are very cool, not every program needs to run with a point-and-click interface. For example, the venerable vi editor ran in plain-text terminals long before the first GUI. more>>

$25k Linux Journalism Fund

Posted: 18 Jan 2018 09:52 AM PST

Linux Journal's new parent, Private Internet Access, has established a $25k fund to jump-start the next generation of Linux journalism—and to spend it here, where Linux journalism started in 1994. more>>

Purism Progress Report, Spectre Mitigation for Ubuntu, Malicious Chrome Extensions and More

Posted: 18 Jan 2018 08:20 AM PST

News briefs for January 18, 2018.

Purism, the group behind the security and privacy-focused Librem 5 phone just recently published a progress report highlighting the latest developments and design decisions to its crowdfunded project. Changes include an even faster processor. more>>