From 0344887c2a5072662c7c6e602de443c2ce986589 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 18 Feb 2016 10:15:36 +0000
Subject: [PATCH] Fix bug reported by Ray Quinn: when replying to FidoNet
 NetMail, the destination address did not contain the "from" name of the
 original msg.

---
 web/root/msgs/reply.ssjs | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/web/root/msgs/reply.ssjs b/web/root/msgs/reply.ssjs
index 376e5868b4..866c77f0e2 100644
--- a/web/root/msgs/reply.ssjs
+++ b/web/root/msgs/reply.ssjs
@@ -44,12 +44,16 @@ template.subject=hdr.subject;
 if(template.subject.search(/^re:\s+/i)==-1)
 	template.subject='Re: '+template.subject;
 if(sub=='mail') {
-	if(hdr.replyto_net_addr!=undefined && hdr.replyto_net_addr != '')
+	if(hdr.replyto_net_addr!=undefined && hdr.replyto_net_addr != '') {
 		template.from=hdr.replyto_net_addr;
-	else {
-		if(hdr.from_net_addr != undefined && hdr.from_net_addr != '')
+        if(template.from.indexOf('@') < 0)
+            template.from=hdr.replyto+'@'+hdr.replyto_net_addr;
+	} else {
+		if(hdr.from_net_addr != undefined && hdr.from_net_addr != '') {
 			template.from=hdr.from_net_addr;
-		else
+            if(template.from.indexOf('@') < 0)
+                template.from=hdr.from+'@'+hdr.from_net_addr;
+		} else
 			template.from=hdr.from;
 	}
 }
-- 
GitLab