commit 6da3e65be0062f919b9e6aa8af27db5e3304853c
parent de3d8c8f5f7a854d6a18f26900189d1d9a476b83
Author: Jacob R. Edwards <n/a>
Date: Tue, 19 Apr 2022 20:16:27 -0500
Update incmail to use my pop3 client
Diffstat:
1 file changed, 8 insertions(+), 21 deletions(-)
diff --git a/local/bin/bin/incmail b/local/bin/bin/incmail
@@ -1,25 +1,12 @@
-#!/bin/sh
+#!/bin/sh -e
# Copyright 2022 Jacob R. Edwards
-# Like pop3, but using sshd
+# Sync mail over ssh
#
-# There are a few reasons I'm using this instead of pop3:
+# If using a key, you may restrict it like so:
+# 'restrict,port-forwarding,permitopen="localhost:110"'
#
-# - I couldn't find a good pop3 client (though popa3d looks like a
-# good server, since I'd tunnel through ssh anyway)
-# - No extra network daemons running (assuming sshd is already)
-# - Uses a general purpose tool
-#
-# This requires rsync(1), here is the reasoning:
-#
-# sftp(1) could be used, but it can't be sufficiently restricted
-# for passwordless authentication. openrsync(1) would be great, but
-# it can't delete source files; rsync(1) it is.
-
-# Pick through ssh output and find the remote command run, then add
-# it to your authorized_keys like so:
-# restrict,command="rsync ... " ssh-rsa ...
-#rsync() command rsync -e 'ssh -v' "$@"
+# The pop3 that's used here is one of my programs, look for it where
+# you got this (assuming you got it from me).
-rsync -az --remove-source-files "${1:-mail}":Maildir "$HOME"
-# Comment if you use maildir
-sendmaildir
+ssh -f -L 10110:localhost:110 "${@:-mail}" sleep 10
+pop3 -sdp 10110 localhost sendmail "$USER" < "${XDG_CONFIG_HOME:-$HOME/.config}"/incmail