OpenBSD has introduced a new utility in the most recent version (6.6 – now in -current). This is sysupgrade, which makes upgrading the system even more painless than it was previously.
sysupgrade downloads the necessary files to /home/_sysupgrade, verifies them with signify(1), and copies bsd.rd to /bsd.upgrade.
sysupgrade by default then reboots the system. The bootloader will automatically choose /bsd.upgrade, triggering a one-shot upgrade using the files in /home/_sysupgrade.
This is brilliant. I do upgrades to -current about once a week. Previously I had to reboot with a new bsd.rd and connect to a mirror to do the upgrade. Downloading the files took some time (more than 20 min) during which the computer was not available for work. Now I just run sysupgrade and everything happens automatical. I can continue to use the computer while the files are being downloaded, after which the system reboots with the new upgrade. This is a major advance in ease of use – congratulations to OpenBSD!
Incidentally it also works for upgrading -release versions; it knows whether you are using -release or -current.
Everything has gone wrong and you have to reinstall from scratch. It shouldn’t happen but it may if you do something silly – I once acccidentally deleted /etc! But you have all sorts of stuff in $HOME that you don’t want to lose. Can you preserve it?
Well, of course, you should have a backup. I save one nightly on Tarsnap. But it may take a long time to restore from backup and it would be better if you didn’t have to.
Fortunately you can save your $HOME quite easily. Here’s how.
- When the Install process asks you to use disklabel, choose either OpenBSD or Whole Disk.
2. See which partition contains /home. Suppose it is ‘k’. Type ‘m -k’ (without the quotes). Choose ‘No mount point’.
Complete the Install process. When the system restarts, edit /etc/fstab to mount the ‘k’ partition as /home.
It should work – it has worked for me. But if at all possible make a backup first, just in case it doesn’t.
There are plenty of spam filters available for OpenBSD and other BSD systems such as bogofilter or spambayes, but these tend to be overkill for a single user system like mine. Another possibility is bmf, which is described as aiming to be faster, smaller and more versatile than similar Bayesian filters. However, it doesn’t seem to have been updated since 2002 and I didn’t like it too much when I tried it out..
I prefer Quick Spam Filter (QSF), which I have used for a good many years – in fact, since before I changed from Linux to OpenBSD four years ago. Its last update was in 2015. I find that after training it is reliable, with only occasional false positives or negatives. It hasn’t been ported to OpenBSD but it compiles easily. It is available from its author.
The qsf documentation describes how to integrate it with procmail. I have a separate post with details of doing this with fdm.
Procmail is still widely used although it is no longer maintained. Its former maintainer on OpenBSD, Philip Gunther, has said that it should be removed from the ports list because of security vulnerability, although it is still there. A suggested alternative is fdm, which both fetches the mail from a POP3 server and filters it, thus cutting out the need for fetchmail.
I’d been using procmail with fetchmail for a long time but I thought perhaps I should switch to fdm. The main difficulty was that the documentation I found was less complete than what is available for procmail. Getting my mail filtering program to work was a particular problem.
I thought it might be worth posting my fdm.conf here for anyone who is thinking of making the same switch. I use qsf as my spam filter but it should be easy to adapt the script to work with a different filter. Qsf writes “SPAM” in the subject line of suspect emails so that’s what I filter on. I’ve posted more details about qsf in a separate entry.
# fdm.conf – see the fdm manual for explanations of the code.
# Set the maximum size of mail:
set maximum-size 128M
# connection settings for my ISP’s mail server:
account “<my POP3 account>”
pop3 server “<my POP3 server>”
user “<my email address>”
pass “<my password>”
# filtering rules (adapted from my .procmailrc:
match “^(To|Cc):.*email@example.com” action mbox “%h/Mail/lyx-users”
match “^(To|cc|Cc|Sender): .*firstname.lastname@example.org” action mbox “%h/Mail/openbsd”
match “^Subject:.*Sucuri Alert” action mbox “%h/Mail/sucuri” action pipe “cat > /dev/null”
# forward some mail to a different account (see “My foreward file” below):
match “^From:.*Facebook” action pipe “%h/.forward”
# Spam filter rules:
action “spamfilter” rewrite “/home/ac/bin/qsf -s”
match all action “spamfilter” continue
match “^Subject:.*SPAM” action mbox “%h/Mail/spam”
# Set spoolfile for incoming mail:
action “inbox” mbox “/var/mail/ac”
match all action “inbox”
My .forward file