February 4, 2021

Fedora 32 -- running an FTP server

On 1-20-2021 I received the following helpful information from Adrian Loeff about setting up a linux machine at the lab as a mail server:
Hi Tom,

I hear you're making great progress with the Linux computers for the Casting furnace!

It was also mentioned in today's Casting Furnace Upgrade meeting that you're trying to set up the Linux system as an email server.  I had a little bit of experience doing this back in 2014, so I thought I should get in touch with you with details about what I did in case this helps.

I set up one of our Linux computers (called "thermo") to be able to send out email to external users.  Daily emails are sent out each morning to a list of individuals containing plots of the Mirror Lab temperature and humidity.  Other "alert" emails are sent out to a different list of individuals if certain monitored data stops coming in or if the data values exceed some allowable threshold.  Both the daily and alert emails are sent out using the "mutt" command called from shell scripts that are constantly running in the background.  The thermo computer does not receive any incoming email.

Emails are sent out through the University email gateway at smtpgate.email.arizona.edu, so thermo has to have visibility of the Internet.  It was also necessary to register thermo with UITS as a permitted email sender.  I believe I had to contact UITS to do this, but I don't have any record of doing this and I can't recall whether it was via phone, email, or their website.  It was back in 2014 so the process may be different now anyway.

Occasionally (maybe once or twice a year) the emails stop going out.  This usually clears up by itself after a few days - I suspect the problem may be at the UA SMTP gateway.

The email system was set up on thermo using the exim4 package.  Here are the steps I needed to perform:
  - login as root
  - install exim4 package (if not already installed)
  - edit /etc/exim4/update-exim4.conf.conf
    - change these two parameters:
      - dc_eximconfig_configtype='smarthost'
      - dc_smarthost='smtpgate.email.arizona.edu'
    - I think I also changed this parameter (was it just 'thermo'?):
      - dc_other_hostnames='thermo.as.arizona.edu'
  - edit /etc/mailname
    - Change the line from thermo to thermo.as.arizona.edu
    - This sets the name of the sending system in the emails.
  - run update-exim4.conf
    - This parses the new configuration.
    - This is found in /usr/sbin, so it can be called by root from anywhere.
    - There should be no response.
  - run /etc/init.d/exim4 restart
    - This restarts exim4.
    - It should respond with:
      - [ ok ] Restarting exim4 (via systemctl): exim4.service.

thermo is running Debian "jessie" Linux, kernel 3.16.0.
I don't know if this package or these instructions will work on other versions of Linux.
The following is how this went on Fedora 32. First of all there is no exim4 package, but the exim package is version 4.94 so corresponds to the same thing (I think).
su
dnf install -y exim
dnf install -y system-switch-mail
vi /etc/exim/exim.conf
The configuration file setup is entirely different. I see the following files in /sbin (/usr/sbin and /sbin are the same under Fedora).
ls -l /usr/sbin/*exim*
-rwsr-xr-x 1 root root 1626360 Jun  1  2020 /usr/sbin/exim
-rwxr-xr-x 1 root root    4819 Jun  1  2020 /usr/sbin/exim_checkaccess
-rwxr-xr-x 1 root root   25072 Jun  1  2020 /usr/sbin/exim_dbmbuild
-rwxr-xr-x 1 root root   34040 Jun  1  2020 /usr/sbin/exim_dumpdb
-rwxr-xr-x 1 root root   38304 Jun  1  2020 /usr/sbin/exim_fixdb
-rwxr-xr-x 1 root root   25112 Jun  1  2020 /usr/sbin/exim_lock
-rwxr-xr-x 1 root root  151533 Jun  1  2020 /usr/sbin/eximstats
-rwxr-xr-x 1 root root   34088 Jun  1  2020 /usr/sbin/exim_tidydb
lrwxrwxrwx 1 root root       4 Jun  1  2020 /usr/sbin/sendmail.exim -> exim
All of these are ELF executables except eximstats which is a perl script and exim_checkaccess which is a bash script. Note that Evolution is patterned after Microsoft Outlook.

Mail lingo

An "MUA" is a mail user agent, i.e. a mail client like Thunderbird.
A "MTA" is a mail transfer agent (such as sendmail, postfix or exim).
An "MDA" is a mail delivery agent (such as procmail). It gets mail from the MTA and filters it on its way to the MUA. This may be optional or may be part of the MUA.

What about postfix

Given that the exim "recipe" is was given simply won't work with my Fedora Exim setup, perhaps I should consider postfix. It almost "feels" like the path of least resistance under Fedora (there certainly is a lack of exim tutorials for Fedora). And consider this quote:
For beginner admins, Postfix would be easier to set up than any other MTA. Besides, it implements the Sendmail CLI and is compatible with Sendmail mail filters.
Interestingly though, an estimate (in late 2019) was that Exim was used on 57 percent of servers worldwide, Postfix on 35 percent, and Sendmail on 4 percent. And this claim is made:
Most Linux distributions that come with Exim, come with sane Exim default configurations. Changing default values and slightly adjusting configuration is relatively easy.
Finally, there is this comment:
Postfix. Exim is the devil's work.
So -- I am going with postfix. 57 percent of servers worldwide can't be wrong. Or can they?

Give postfix a whirl

dnf -y install postfix
Then study /etc/postfix/main.cf


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org