From 05104f134188b139a6f3e5bac95df8a9961cfa7f Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Wed, 9 Dec 2020 00:40:08 -0800 Subject: [PATCH] When a message has been forwarded, invalidate the "to" ext/net ptrs The convenience pointers to_ext and to_net need to be invalidated (nullified) if we are going to allow forwarding from local email boxes to network mail and keep all the original message header fields in tact. The "Forwarded" field must now be added *before* any new recipient information (local user extension or network address of the forwarding destination). This is part of the solution to request #83, #108, and #141. --- src/smblib/smblib.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/smblib/smblib.c b/src/smblib/smblib.c index b12d59177b..4c25378f59 100644 --- a/src/smblib/smblib.c +++ b/src/smblib/smblib.c @@ -1,8 +1,5 @@ /* Synchronet message base (SMB) library routines */ -/* $Id: smblib.c,v 1.209 2020/05/07 19:30:22 rswindell Exp $ */ -// vi: tabstop=4 - /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * @@ -16,21 +13,9 @@ * See the GNU Lesser General Public License for more details: lgpl.txt or * * http://www.fsf.org/copyleft/lesser.html * * * - * Anonymous FTP access to the most recent released source is available at * - * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * - * * - * Anonymous CVS access to the development source and modification history * - * is available at cvs.synchro.net:/cvsroot/sbbs, example: * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login * - * (just hit return, no password is necessary) * - * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src * - * * * For Synchronet coding style and modification guidelines, see * * http://www.synchro.net/source.html * * * - * You are encouraged to submit any modifications (preferably in Unix diff * - * format) via e-mail to mods@synchro.net * - * * * Note: If this box doesn't appear square, then you need to fix your tabs. * ****************************************************************************/ @@ -733,7 +718,9 @@ static void set_convenience_ptr(smbmsg_t* msg, uint16_t hfield_type, void* hfiel break; } case FORWARDED: /* fall through */ - msg->forwarded=TRUE; + msg->forwarded = TRUE; + msg->to_ext = NULL; + memset(&msg->to_net, 0, sizeof(msg->to_net)); break; case SENDERAGENT: if(!msg->forwarded) -- GitLab