From 507ca3a7e3f2d72e583bb26d6817f7deee9188ec Mon Sep 17 00:00:00 2001 From: Gab Virebent Date: Tue, 26 May 2026 00:06:05 +0200 Subject: update: real mail2news config with virebent.art onion addresses, add Tor profile and posting script - accounts/mail2news: real onion SMTP endpoint, ephemeral nobody@virebent.invalid From - scripts/m2n-prompt.sh: working interactive posting script (swaks + torsocks) - neomuttrc.tor: Tor profile sourcing mail2news account, F9 macro binding - neomuttrc.common: shared UI/GPG/sidebar base config - README: rewritten in English, documents actual setup and gateway address --- scripts/m2n-prompt.sh | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 scripts/m2n-prompt.sh (limited to 'scripts/m2n-prompt.sh') diff --git a/scripts/m2n-prompt.sh b/scripts/m2n-prompt.sh new file mode 100644 index 0000000..d57db96 --- /dev/null +++ b/scripts/m2n-prompt.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# Mail2News posting script — NeoMutt + torsocks + swaks +# Bind to F9 in neomuttrc.tor: +# macro index,pager "~/.config/neomutt/m2n-prompt.sh" "Post to Usenet" +set -euo pipefail + +M2N_TO="mail2news@xilb7y4kj6u6qfo45o3yk2kilfv54ffukzei3puonuqlncy7cn2afwyd.onion" +SMTP_HOST="xilb7y4kj6u6qfo45o3yk2kilfv54ffukzei3puonuqlncy7cn2afwyd.onion" +SMTP_PORT="25" +FROM="nobody@virebent.invalid" + +clear +echo "=== MAIL2NEWS — Usenet Post ===" +echo + +printf "Newsgroup(s) [comma-separated]: " +read -r NEWSGROUP +[ -z "$NEWSGROUP" ] && echo "Aborted." && exit 1 +NEWSGROUP=$(echo "$NEWSGROUP" | sed 's/ *, */,/g') + +printf "Subject: " +read -r SUBJECT +[ -z "$SUBJECT" ] && echo "Aborted." && exit 1 + +REFERENCES="" +if echo "$SUBJECT" | grep -qi "^re:"; then + printf "References (Message-ID of original): " + read -r REFERENCES +fi + +MSGFILE=$(mktemp /tmp/m2n-body.XXXXXX) +echo "" > "$MSGFILE" +echo "-- " >> "$MSGFILE" +echo "posted via virebent.art mail2news" >> "$MSGFILE" + +${EDITOR:-vim} "$MSGFILE" + +DRAFTFILE=$(mktemp /tmp/m2n-draft.XXXXXX) +{ + printf "To: %s\n" "$M2N_TO" + printf "From: %s\n" "$FROM" + printf "Subject: %s\n" "$SUBJECT" + [ -n "$REFERENCES" ] && printf "References: %s\n" "$REFERENCES" + printf "Newsgroups: %s\n" "$NEWSGROUP" + printf "\n" + cat "$MSGFILE" +} > "$DRAFTFILE" + +clear +echo "=== REVIEW ===" +cat "$DRAFTFILE" +echo +printf "[s]end [e]dit [q]uit: " +read -r CHOICE + +case "$CHOICE" in + e|E) ${EDITOR:-vim} "$DRAFTFILE" ;; + q|Q) rm -f "$MSGFILE" "$DRAFTFILE"; echo "Cancelled."; exit 0 ;; +esac + +echo +echo "Sending via Tor..." + +torsocks swaks \ + --server "${SMTP_HOST}:${SMTP_PORT}" \ + --from "$FROM" \ + --to "$M2N_TO" \ + --data "@${DRAFTFILE}" \ + --timeout 60 \ + 2>&1 | tee /tmp/m2n-smtp.log + +if grep -q "250 " /tmp/m2n-smtp.log; then + echo + echo "Sent to: $NEWSGROUP" +else + echo + echo "ERROR — check /tmp/m2n-smtp.log" +fi + +rm -f "$MSGFILE" "$DRAFTFILE" +printf "\nPress Enter to return to NeoMutt..." +read -r -- cgit v1.2.3