UUCP mail

I’m doing a bit more open source development and some projects insist on updating code bases on mailing lists with patches. And they generally react badly to html email.

Using mutt works best with them. And that’s fine, it’s not too hard to get mutt working with gmail. And you can use pass to pull in the password in your .muttrc like so:

password=`pass gmail/acct/mutt`

So no need to keep a password resting in cleartext in your homedir. And on a desktop with a reliable net connection this works fine. Couple it in with IMAP and you’re doing fine.

UUCP Hub

But I’ve been using laptops for my main development machines for well over a decade now and generally I like using uucp to send mail from laptops. They’re not always connected so it’s nice to have something that won’t hang on DNS lookups when you’re not connected. And this is exactly what UUCP does very well. UUCP handles queuing, retrying, time limits and so on. First though you need a UUCP hub to connect to.

UUCP is from a more naive time so security is… interesting. However running it over stunnel or ssh can hide most of those problem. I went with UUCP over SSH and made use of this article and this one. The one problem I had was that on Ubuntu 16.04 it seems that installing uucp replaces postfix with sendmail. Which wasn’t a nostalgia I really wanted. So I built uucp from source.

UUCP Leaf

Some changes to those articles I made was for configuring postfix. For the leaf nodes you merely need to run this one postconf command:

postconf "default_transport = uucp:your-uucp-hub-here"

I also only use UUCP to send email, not receive it. That’s possible, but not what I did. I have a few laptops I use depending on the project I’m working on so the traditional “workstation” model isn’t valid. Instead I have postfix deliver to ~/Maildir and then have that dir committed into git. This article Goes over how to have git commit your email as it’s received. I modify this to use vcsh in a mail repo.

UUCP Leaf (OS X)

So it turns out OS X has a UUCP install already there. Unfortunately due to Apple’s System Integrity Protection it’s not possible to change its default spot to put configuration. But you can pass UUCP commands (uux and uucico in this case) a --config flag and get it to read your config. But be aware it will run as you.

So I ended up with this in /Users/kevin/.config/uucp/leaf/config:

nodename leaf

spool /Users/kevin/.config/uucp/leaf/spool
lockdir /Users/kevin/.config/uucp/leaf/lock
pubdir /Users/kevin/.config/uucp/leaf/spool/public
logfile /Users/kevin/.config/uucp/leaf/logs/Log
statfile /Users/kevin/.config/uucp/leaf/logs/Stats
debugfile /Users/kevin/.config/uucp/leaf/logs/Debug
callfile /Users/kevin/.config/uucp/leaf/call

# Hub config
sysfile /Users/kevin/.config/uucp/leaf/sys
portfile /Users/kevin/.config/uucp/leaf/port

To get mail out this is in my personal crontab (add with crontab -e):

*/30 * * * * uucico -I $HOME/.config/uucp/leaf/config -r1

Oddly SIP still allows postfix config. So the postconf "default_transport = uucp:your-uucp-hub-here" works here as well. However uucp is disabled by default in /etc/postfix/master.cf and you need to make it run as you. So you need to append this to master.cf:

uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=kevin argv=uux -I /Users/kevin/.config/uucp/leaf/config -r -n -z -a$sender - $nexthop!rmail ($recipient)