Hi Clark,
Some time ago, I wrote a shell script that I think does what you are looking for.
To use this script on a Pi, install dos2unix:
sudo apt update
sudo apt install dos2unix
The script itself is at
https://github.com/AG7GN/nexus-utilities/blob/master/patmail.sh
Here’s the help screen for the script. Use the ‘-f’ option to attach an XML file to your message:
pi@nexus-ag7gn:~ $ patmail.sh -h
SYNOPSIS
patmail.sh [-hv]
patmail.sh TO SUBECT TRANSPORT
patmail.sh [-d DIRECTORY] [-l FILE] [-f FILE] TO SUBECT TRANSPORT
DESCRIPTION
This script allows sending Winlink messages via the command line or script.
It requires pat (a Winlink client) and the dos2unix program.
The body of the message is supplied to the script from STDIN. See EXAMPLES below.
OPTIONS
-h, --help Print this help
-v, --version Print script information
-d, --dir=DIRECTORY Path to directory containing config.json file
and mailbox directory. Default: $HOME/.wl2k
-l FILE, --log=FILE Send pat diagnostic output to FILE. FILE will be
overwritten if it exists. To send output to stdout,
use /dev/stdout. Default: /dev/null
-f FILE, --file=FILE Attach file to message where file is full path to
file. To attach multiple files, use multiple -f FILE
arguments, one per attached file.
COMMANDS (All 3 COMMANDS are required)
TO One or more recipient email addresses
(comma separated). Winlink email addresses
(
CA...@winlink.org) do not need to include
'@
winlink.org', just the call sign.
SUBJECT Email subject enclosed in "double quotes".
TRANSPORT pat transport method. For example:
telnet
ax25://portname/call-ssid
where portname is as defined in /etc/ax25/axports
and the same as the ax25 port in
~/.wl2k/config.json. This is usually 'wl2k'.
where call-ssid is the RMS gateway. Example:
ax25://wl2k/W7ECG-10
Run 'pat connect help' to see more transport
types.
EXAMPLES
Send two lines of text to callsign
N0...@winlink.org via telnet:
echo -e "1st line\n2nd line" | patmail.sh N0ONE "My Subject" telnet
Send the contents of file 'myfile.txt' to
m...@example.com and
W7...@winlink.org
via telnet:
cat myfile.txt | patmail.sh
m...@example.com,W7ABC "My Important Message" telnet
Send the contents of file 'myfile.txt' to
W7...@winlink.org via telnet and log
output to stdout:
cat myfile.txt | patmail.sh -l /dev/stdout
m...@example.com,W7ABC "My Important Message" telnet
Send the contents of 'myfile.txt' to
m...@example.com and
W7...@winlink.org using
packet radio via RMS gateway ax25://wl2k/W7ECG-10
patmail.sh
m...@example.com,W7ABC "My Important Message" ax25://wl2k/W7ECG-10 < myfile.txt
> --
> You received this message because you are subscribed to the Google Groups "pat-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
pat-users+...@googlegroups.com.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/pat-users/0e673c4e-d0f9-4210-8834-87a718e02751n%40googlegroups.com.