summary refs log tree commit diff
path: root/mcom
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-09-25 21:30:20 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-09-25 21:30:20 +0200
commitcd255e0bc65642975b8dcc02fe7b4e5215a60c18 (patch)
treebde1a6b17deba4b223abd68afd97b29e1d4e10ad /mcom
parentf7052abc8b0aff3abdb4d0ae6d53ddd1afe3e0d1 (diff)
downloadmblaze-cd255e0bc65642975b8dcc02fe7b4e5215a60c18.tar.gz
mblaze-cd255e0bc65642975b8dcc02fe7b4e5215a60c18.tar.xz
mblaze-cd255e0bc65642975b8dcc02fe7b4e5215a60c18.zip
mcom: very elementary NNTP posting support
Diffstat (limited to 'mcom')
-rwxr-xr-xmcom22
1 files changed, 17 insertions, 5 deletions
diff --git a/mcom b/mcom
index a282e34..ebbddbf 100755
--- a/mcom
+++ b/mcom
@@ -59,12 +59,19 @@ fi
 		;;
 	*mrep*)
 		[ "$#" -eq 0 ] && set -- .
-		to=$(mhdr -h reply-to "$1")
-		[ -z "$to" ] && to=$(mhdr -h from "$1")
-		echo "To: $to"
-		echo "Cc: $(mhdr -d -A -h to:cc: "$1" | commajoin)"
-		echo "Bcc: "
+		ng=$(mhdr -h newsgroups "$1")
+		if [ "$ng" ]; then
+			echo "Newsgroups: $ng"
+		else
+			to=$(mhdr -h reply-to "$1")
+			[ -z "$to" ] && to=$(mhdr -h from "$1")
+			echo "To: $to"
+			echo "Cc: $(mhdr -d -A -h to:cc: "$1" | commajoin)"
+			echo "Bcc: "
+		fi
 		echo "Subject: Re: $(mscan -f '%S' "$1")"
+		from=$(mhdr -h local-mailbox "$MBLAZE/profile")
+		[ "$from" ] && echo "From: $from"
 		cat "$MBLAZE/headers" 2>/dev/null
 		mid=$(mhdr -h message-id "$1")
 		if [ "$mid" ]; then
@@ -99,6 +106,11 @@ c=e
 while :; do
 	case "$c" in
 	s|send)
+		case "$(mhdr -h newsgroups "$draft")" in
+			*gmane.*) sendmail="mblow -s news.gmane.org";;
+			*.*) sendmail="mblow";;
+		esac
+
 		if [ -e $draftmime ]; then
 			if [ $draft -ot $draftmime ]; then
 				if $sendmail <$draftmime; then