Commit e4a5afe2 authored by rswindell's avatar rswindell
Browse files

Allow an added or modified message header to have to/from/reply-to "net type"...

Allow an added or modified message header to have to/from/reply-to "net type" values of NET_NONE. This is a weird scenario, but it is technically possible (e.g. for nntpservice.js) to save a message with a to/from/treply-to "net address" header, but an associated net-type of NET_NONE. By saving the net-type NET_NONE, when saving a modified header, if the associated net address header field value cannot be parsed into a valid network address, there won't be any error reported, e.g.
Error -110 adding SENDERNETADDR field to message header
parent 026e9133
......@@ -260,7 +260,7 @@ static BOOL parse_recipient_object(JSContext* cx, private_t* p, JSObject* hdr, s
}
free(cp);
if(nettype!=NET_UNKNOWN && nettype!=NET_NONE) {
if(nettype!=NET_UNKNOWN) {
if((p != NULL) && (p->smb.status.attr&SMB_EMAIL)) {
if(nettype==NET_QWK && msg->idx.to==0) {
char fulladdr[128];
......@@ -425,7 +425,7 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
}
}
if(nettype!=NET_UNKNOWN && nettype!=NET_NONE) {
if(nettype!=NET_UNKNOWN) {
if((p != NULL) && (p->smb.status.attr&SMB_EMAIL))
msg->idx.from=0;
if((smb_result = smb_hfield_bin(msg, SENDERNETTYPE, nettype))!=SMB_SUCCESS) {
......@@ -592,7 +592,7 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
goto err;
}
}
if(nettype!=NET_UNKNOWN && nettype!=NET_NONE) {
if(nettype!=NET_UNKNOWN) {
if((smb_result = smb_hfield_bin(msg, REPLYTONETTYPE, nettype))!=SMB_SUCCESS) {
JS_ReportError(cx, "Error %d adding REPLYTONETTYPE field to message header", smb_result);
goto err;
......
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