From 4ef5bfaf8ee0279453d32bbcfee9d696e0eb16fe Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 27 Aug 2002 09:19:09 +0000
Subject: [PATCH] Added char* smbmsg_t.reverse_path: stores the SMTP reverse
 path (if specified by a header field), or the SENDERNETADDR otherwise.

---
 src/smblib/smblib.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/smblib/smblib.c b/src/smblib/smblib.c
index 1ada197181..30817df428 100644
--- a/src/smblib/smblib.c
+++ b/src/smblib/smblib.c
@@ -807,6 +807,9 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
 			case RFC822REPLYID:
 				msg->reply_id=msg->hfield_dat[i];
 				break;
+			case SMTPREVERSEPATH:
+				msg->reverse_path=msg->hfield_dat[i];
+				break;
 			case USENETPATH:
 				msg->path=msg->hfield_dat[i];
 				break;
@@ -838,6 +841,11 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
 		smb_freemsgmem(msg);
 		return(-7); 
 	}
+
+	/* If no reverse path specified, use sender's address */
+	if(msg->reverse_path == NULL)
+		msg->reverse_path = msg->from_net.addr;
+
 	return(0);
 }
 
-- 
GitLab