Commit 3af11b68 authored by rswindell's avatar rswindell
Browse files

Added support for defined net_types without correspoding net_addr hdr field.

parent 1162ff03
......@@ -391,11 +391,11 @@ int main(int argc, char **argv)
,msg.hdr.number,msg.offset+1);
printf("%-20s: %s\n","Subject",msg.subj);
printf("%-20s: %s","To",msg.to);
if(msg.to_net.type)
if(msg.to_net.type && msg.to_net.addr)
printf(" (%s)",msg.to_net.type==NET_FIDO
? faddrtoa(*(fidoaddr_t *)msg.to_net.addr) : msg.to_net.addr);
printf("\n%-20s: %s","From",msg.from);
if(msg.from_net.type)
if(msg.from_net.type && msg.from_net.addr)
printf(" (%s)",msg.from_net.type==NET_FIDO
? faddrtoa(*(fidoaddr_t *)msg.from_net.addr)
: msg.from_net.addr);
......
......@@ -412,7 +412,7 @@ static ulong sockmsgtxt(SOCKET socket, smbmsg_t* msg, char* msgtxt, char* fromad
else
sockprintf(socket,"From: \"%s\" <%s>",msg->from,fromaddr);
sockprintf(socket,"Subject: %s",msg->subj);
if(strchr(msg->to,'@')!=NULL)
if(strchr(msg->to,'@')!=NULL || msg->to_net.addr==NULL)
sockprintf(socket,"To: %s",msg->to); /* Avoid double-@ */
else if(msg->to_net.type==NET_INTERNET || msg->to_net.type==NET_QWK) {
if(*((char*)msg->to_net.addr)=='<')
......@@ -915,9 +915,9 @@ static void pop3_thread(void* arg)
}
sockprintf(socket,"+OK message follows");
if(msg.from_net.type==NET_INTERNET)
if(msg.from_net.type==NET_INTERNET && msg.from_net.addr!=NULL)
strcpy(fromaddr,msg.from_net.addr);
else if(msg.from_net.type==NET_QWK)
else if(msg.from_net.type==NET_QWK && msg.from_net.addr!=NULL)
sprintf(fromaddr,"\"%s@%s\"@%s"
,msg.from,(char*)msg.from_net.addr,scfg.sys_inetaddr);
else
......@@ -2193,7 +2193,7 @@ BOOL bounce(smb_t* smb, smbmsg_t* msg, char* err, BOOL immediate)
}
smb_hfield(&newmsg, RECIPIENTAGENT, sizeof(ushort), &newmsg.from_agent);
smb_hfield(&newmsg, RECIPIENTNETTYPE, sizeof(newmsg.from_net.type), &newmsg.from_net.type);
if(newmsg.from_net.type)
if(newmsg.from_net.type && newmsg.from_net.addr!=NULL)
smb_hfield(&newmsg, RECIPIENTNETADDR, (ushort)strlen(newmsg.from_net.addr)
,newmsg.from_net.addr);
strcpy(str,"Mail Delivery Subsystem");
......@@ -2344,7 +2344,7 @@ static void sendmail_thread(void* arg)
}
smb_unlockmsghdr(&smb,&msg);
if(msg.to_net.type!=NET_INTERNET)
if(msg.to_net.type!=NET_INTERNET || msg.to_net.addr==NULL)
continue;
active_sendmail=1;
......@@ -2473,7 +2473,7 @@ static void sendmail_thread(void* arg)
continue;
}
/* MAIL */
if(msg.from_net.type==NET_INTERNET)
if(msg.from_net.type==NET_INTERNET && msg.from_net.addr!=NULL)
strcpy(fromaddr,msg.from_net.addr);
else
usermailaddr(&scfg,fromaddr,msg.from);
......
......@@ -354,15 +354,15 @@ void sbbs_t::readmail(uint usernumber, int which)
quotemsg(&msg,1);
if(msg.from_net.type==NET_FIDO) /* FidoNet type */
if(msg.from_net.addr==NULL)
strcpy(str,msg.from);
else if(msg.from_net.type==NET_FIDO) /* FidoNet type */
sprintf(str,"%s @%s",msg.from
,faddrtoa((faddr_t *)msg.from_net.addr,tmp));
else if(msg.from_net.type==NET_INTERNET)
strcpy(str,(char *)msg.from_net.addr);
else if(msg.from_net.type)
else
sprintf(str,"%s@%s",msg.from,msg.from_net.addr);
else /* No net */
strcpy(str,msg.from);
strcpy(str2,str);
......
......@@ -657,15 +657,15 @@ int sbbs_t::scanposts(uint subnum, long mode, char *find)
sprintf(str2,text[Regarding]
,msg.subj
,timestr((time_t *)&msg.hdr.when_written.time));
if(msg.from_net.type==NET_FIDO)
if(msg.from_net.addr==NULL)
strcpy(str,msg.from);
else if(msg.from_net.type==NET_FIDO)
sprintf(str,"%s @%s",msg.from
,faddrtoa((faddr_t *)msg.from_net.addr,tmp));
else if(msg.from_net.type==NET_INTERNET)
strcpy(str,(char *)msg.from_net.addr);
else if(msg.from_net.type)
sprintf(str,"%s@%s",msg.from,(char *)msg.from_net.addr);
else
strcpy(str,msg.from);
sprintf(str,"%s@%s",msg.from,(char *)msg.from_net.addr);
bputs(text[Email]);
if(!getstr(str,60,K_EDIT|K_AUTODEL))
break;
......@@ -673,8 +673,7 @@ int sbbs_t::scanposts(uint subnum, long mode, char *find)
LFREE(post);
post=NULL;
quotemsg(&msg,1);
if(msg.from_net.type==NET_INTERNET
&& (!strcmp(str,(char *)msg.from_net.addr) || strchr(str,'@')))
if(msg.from_net.type==NET_INTERNET && strchr(str,'@'))
inetmail(str,msg.subj,WM_QUOTE|WM_NETMAIL);
else {
p=strrchr(str,'@');
......
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