config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 683fe42c8d092949cd9a97d17cab861e732dcdd2
parent 38a5bff46e4b5790123dbd9e765cd22367b5d1f7
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Fri,  2 Jun 2023 13:59:37 -0700

Add port option to incmail

This fixes the fetchmail and Inc scripts

Diffstat:
Mlocal/bin/bin/incmail | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/local/bin/bin/incmail b/local/bin/bin/incmail @@ -9,10 +9,11 @@ # you got this (assuming you got it from me). usage() { - echo "usage: ${0##*/} [-q] [-to user] [user@]host" 1>&2 + echo "usage: ${0##*/} [-q] [-p port] [-to user] [user@]host" 1>&2 exit 1 } +port=10110 flags=v while test $# -gt 0 do @@ -21,6 +22,10 @@ do to="$2" shift ;; + (-p) + port="$2" + shift + ;; (-q) flags= ;; @@ -36,6 +41,6 @@ done test $# -ne 1 && usage -ssh -o ConnectTimeout=5 -o ExitOnForwardFailure=yes -f -L 10110:localhost:110 "$1" sleep 6 || +ssh -o ConnectTimeout=5 -o ExitOnForwardFailure=yes -f -L "$port":localhost:110 "$1" sleep 1.5 || exit -pop3 -sdp 10110 ${flags:+-"$flags"} localhost sendmail "${to:-"$USER"}" +pop3 -sdp "$port" ${flags:+-"$flags"} localhost sendmail "${to:-"$USER"}"