Commit cbda86ec authored by Rob Swindell's avatar Rob Swindell 💬

Fix netmail forwarding (new feature)

The recipient net-addr/type was always being over-ridden a bit further down in the code. Don't do that.

Also, log a message (sbbsecho.log) indicating that a message was forwarded ("Forwarding message ...").

For geneb.
parent acdd7086
Pipeline #762 passed with stage
in 17 minutes and 12 seconds
......@@ -3325,6 +3325,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint usernumber, uint subnum)
uint16_t nettype;
if((scfg.sys_misc&SM_FWDTONET) && (user.misc&NETMAIL)
&& (nettype = smb_netaddr_type(user.netmail)) >= NET_UNKNOWN) {
lprintf(LOG_INFO, "Forwarding message from %s to %s", hdr->from, user.netmail);
smb_hfield_netaddr(&msg, RECIPIENTNETADDR, user.netmail, &nettype);
smb_hfield_bin(&msg, RECIPIENTNETTYPE, nettype);
} else {
......@@ -3596,7 +3597,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint usernumber, uint subnum)
if(subnum==INVALID_SUB) {
smbfile=email;
if(net) {
if(net && msg.to_net.type == NET_NONE) {
smb_hfield(&msg,RECIPIENTNETTYPE,sizeof(ushort),&net);
smb_hfield(&msg,RECIPIENTNETADDR,sizeof(fidoaddr_t),&destaddr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment