summaryrefslogtreecommitdiff
path: root/alpine
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-06-29 14:23:13 -0600
committerEduardo Chappa <chappa@washington.edu>2020-06-29 14:23:13 -0600
commit8657ba4f3d3b83e9c854f0cd5792d3d88592bfc6 (patch)
tree14e560df10122ee4f5cd496fd91522c28ba0a876 /alpine
parentc6a938d3f92a03764408db0fe3526a781002913e (diff)
downloadalpine-8657ba4f3d3b83e9c854f0cd5792d3d88592bfc6.tar.xz
* Extension of the privacy changes to the generation of message-id when replying,
forwarding and bouncing.
Diffstat (limited to 'alpine')
-rw-r--r--alpine/adrbkcmd.c4
-rw-r--r--alpine/help.c10
-rw-r--r--alpine/mailpart.c10
-rw-r--r--alpine/mailview.c2
-rw-r--r--alpine/reply.c9
-rw-r--r--alpine/send.c17
6 files changed, 30 insertions, 22 deletions
diff --git a/alpine/adrbkcmd.c b/alpine/adrbkcmd.c
index a0d1c10..5979fa9 100644
--- a/alpine/adrbkcmd.c
+++ b/alpine/adrbkcmd.c
@@ -4528,7 +4528,6 @@ ab_forward(struct pine *ps, long int cur_line, int agg)
}
outgoing = mail_newenvelope();
- outgoing->message_id = generate_message_id();
if(agg && as.selections > 1)
outgoing->subject = cpystr("Forwarded address book entries from Alpine");
else
@@ -4586,13 +4585,14 @@ ab_forward(struct pine *ps, long int cur_line, int agg)
goto bomb;
}
+ outgoing->message_id = generate_message_id(role);
/*---- create the attachment, and write abook entry into it ----*/
*pp = mail_newbody_part();
pb = &((*pp)->body);
pb->type = TYPETEXT;
pb->encoding = ENCOTHER; /* let data decide */
- pb->id = generate_message_id();
+ pb->id = generate_message_id(role);
pb->subtype = cpystr("DIRECTORY");
if(agg && as.selections > 1)
pb->description = cpystr("Alpine addressbook entries");
diff --git a/alpine/help.c b/alpine/help.c
index 8321176..574f4a7 100644
--- a/alpine/help.c
+++ b/alpine/help.c
@@ -973,7 +973,7 @@ gripe_gripe_to(url)
*optstr++ = '\0';
outgoing = mail_newenvelope();
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(NULL);
if((outgoing->to = gripe_token_addr(url_copy)) != NULL){
composer_title = _("COMPOSE TO LOCAL SUPPORT");
@@ -1078,7 +1078,7 @@ gripe_newbody(ps, body, msgno, flags)
pb = &((*pp)->body);
pp = &((*pp)->next);
pb->type = TYPETEXT;
- pb->id = generate_message_id();
+ pb->id = generate_message_id(NULL);
pb->description = cpystr("Alpine Configuration Data");
pb->parameter = mail_newbody_parameter();
pb->parameter->attribute = cpystr("name");
@@ -1114,7 +1114,7 @@ gripe_newbody(ps, body, msgno, flags)
pb = &((*pp)->body);
pp = &((*pp)->next);
pb->type = TYPETEXT;
- pb->id = generate_message_id();
+ pb->id = generate_message_id(NULL);
pb->description = cpystr("Recent User Input");
pb->parameter = mail_newbody_parameter();
pb->parameter->attribute = cpystr("name");
@@ -1151,7 +1151,7 @@ gripe_newbody(ps, body, msgno, flags)
pb = &((*pp)->body);
pp = &((*pp)->next);
pb->type = TYPETEXT;
- pb->id = generate_message_id();
+ pb->id = generate_message_id(NULL);
pb->description = cpystr("Local Configuration Data");
pb->parameter = mail_newbody_parameter();
pb->parameter->attribute = cpystr("name");
@@ -1200,7 +1200,7 @@ gripe_newbody(ps, body, msgno, flags)
pb = &((*pp)->body);
pp = &((*pp)->next);
pb->type = TYPEMESSAGE;
- pb->id = generate_message_id();
+ pb->id = generate_message_id(NULL);
snprintf(tmp, sizeof(tmp), "Problem Message (%ld of %ld)",
mn_get_cur(ps->msgmap), mn_get_total(ps->msgmap));
tmp[sizeof(tmp)-1] = '\0';
diff --git a/alpine/mailpart.c b/alpine/mailpart.c
index 0e742fc..5e1cac9 100644
--- a/alpine/mailpart.c
+++ b/alpine/mailpart.c
@@ -3489,7 +3489,6 @@ forward_attachment(MAILSTREAM *stream, long int msgno, ATTACH_S *a)
PAT_STATE dummy;
outgoing = mail_newenvelope();
- outgoing->message_id = generate_message_id();
outgoing->subject = cpystr("Forwarded attachment...");
if(nonempty_patterns(rflags, &dummy)){
@@ -3514,6 +3513,7 @@ forward_attachment(MAILSTREAM *stream, long int msgno, ATTACH_S *a)
q_status_message1(SM_ORDER, 3, 4,
_("Forwarding using role \"%s\""), role->nick);
+ outgoing->message_id = generate_message_id(role);
/*
* as with all text bound for the composer, build it in
* a storage object of the type it understands...
@@ -3561,7 +3561,7 @@ forward_attachment(MAILSTREAM *stream, long int msgno, ATTACH_S *a)
/*---- The corresponding things we're attaching ----*/
body->nested.part->next = mail_newbody_part();
- body->nested.part->next->body.id = generate_message_id();
+ body->nested.part->next->body.id = generate_message_id(role);
copy_body(&body->nested.part->next->body, a->body);
if(fetch_contents(stream, msgno, a->number,
@@ -3604,8 +3604,6 @@ forward_msg_att(MAILSTREAM *stream, long int msgno, ATTACH_S *a)
REDRAFT_POS_S *redraft_pos = NULL;
outgoing = mail_newenvelope();
- outgoing->message_id = generate_message_id();
-
memset((void *)&reply, 0, sizeof(reply));
if((outgoing->subject = forward_subject(a->body->nested.msg->env, 0)) != NULL){
@@ -3640,6 +3638,8 @@ forward_msg_att(MAILSTREAM *stream, long int msgno, ATTACH_S *a)
q_status_message1(SM_ORDER, 3, 4,
_("Forwarding using role \"%s\""), role->nick);
+ outgoing->message_id = generate_message_id(role);
+
if(role && role->template){
char *filtered;
@@ -3919,7 +3919,7 @@ reply_msg_att(MAILSTREAM *stream, long int msgno, ATTACH_S *a)
outgoing->in_reply_to = reply_in_reply_to(a->body->nested.msg->env);
outgoing->references = reply_build_refs(a->body->nested.msg->env);
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(role);
if(!outgoing->to && !outgoing->cc
&& !outgoing->bcc && !outgoing->newsgroups)
diff --git a/alpine/mailview.c b/alpine/mailview.c
index d1ace2f..d5d6829 100644
--- a/alpine/mailview.c
+++ b/alpine/mailview.c
@@ -1741,7 +1741,6 @@ url_local_mailto_and_atts(char *url, PATMT *attachlist)
ACTION_S *role = NULL;
outgoing = mail_newenvelope();
- outgoing->message_id = generate_message_id();
body = mail_newbody();
body->type = TYPETEXT;
if((body->contents.text.data = (void *) so_get(PicoText,NULL,EDIT_ACCESS)) != NULL){
@@ -1833,6 +1832,7 @@ url_local_mailto_and_atts(char *url, PATMT *attachlist)
if(role)
q_status_message1(SM_ORDER, 3, 4, "Composing using role \"%s\"",
role->nick);
+ outgoing->message_id = generate_message_id(role);
if(!was_a_body && role && role->template){
char *filtered;
diff --git a/alpine/reply.c b/alpine/reply.c
index a35de1d..d7875a9 100644
--- a/alpine/reply.c
+++ b/alpine/reply.c
@@ -106,6 +106,7 @@ reply(struct pine *pine_state, ACTION_S *role_arg)
REPLY_S reply;
void *msgtext = NULL;
char *tmpfix = NULL, *prefix = NULL, *fcc = NULL, *errmsg = NULL;
+ char *hostpart;
long msgno, j, totalm, rflags, *seq = NULL;
int i, include_text = 0, times = -1, warned = 0, rv = 0,
flags = RSF_QUERY_REPLY_ALL, reply_raw_body = 0;
@@ -434,7 +435,7 @@ reply(struct pine *pine_state, ACTION_S *role_arg)
/*========== Other miscellaneous fields ===================*/
outgoing->in_reply_to = reply_in_reply_to(env);
outgoing->references = reply_build_refs(env);
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(role);
if(!outgoing->to &&
!outgoing->cc &&
@@ -1518,7 +1519,6 @@ forward(struct pine *ps, ACTION_S *role_arg)
memset((void *)&reply, 0, sizeof(reply));
outgoing = mail_newenvelope();
- outgoing->message_id = generate_message_id();
if(ps_global->full_header == 2
&& F_ON(F_ENABLE_FULL_HDR_AND_TEXT, ps_global))
@@ -1602,6 +1602,8 @@ forward(struct pine *ps, ACTION_S *role_arg)
q_status_message1(SM_ORDER, 3, 4,
_("Forwarding using role \"%s\""), role->nick);
+ outgoing->message_id = generate_message_id(role);
+
if(role && role->template){
char *filtered;
@@ -1887,7 +1889,6 @@ forward_text(struct pine *pine_state, void *text, SourceType source)
if((msgtext = so_get(PicoText, NULL, EDIT_ACCESS)) != NULL){
env = mail_newenvelope();
- env->message_id = generate_message_id();
body = mail_newbody();
body->type = TYPETEXT;
body->contents.text.data = (void *) msgtext;
@@ -1912,6 +1913,8 @@ forward_text(struct pine *pine_state, void *text, SourceType source)
q_status_message1(SM_ORDER, 3, 4, _("Composing using role \"%s\""),
role->nick);
+ env->message_id = generate_message_id(role);
+
sig = detoken(role, NULL, 2, 0, 1, NULL, NULL);
so_puts(msgtext, (sig && *sig) ? sig : NEWLINE);
so_puts(msgtext, NEWLINE);
diff --git a/alpine/send.c b/alpine/send.c
index 2e6eace..4d988a0 100644
--- a/alpine/send.c
+++ b/alpine/send.c
@@ -656,7 +656,7 @@ compose_mail(char *given_to, char *fcc_arg, ACTION_S *role_arg,
ps_global->hostname = cpystr(ps_global->maildomain);
else
ps_global->hostname = cpystr(hostpart); /* all for nothing */
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(role);
/* undo the changes above */
fs_give((void **) &ps_global->hostname);
ps_global->hostname = cpystr(hostpart);
@@ -1152,6 +1152,11 @@ pine_simple_send(ENVELOPE *outgoing, /* envelope for outgoing message */
while(!done){
int flags;
+ if(outgoing->message_id)
+ fs_give((void **) &outgoing->message_id);
+
+ outgoing->message_id = generate_message_id(role);
+
if(outgoing->remail){
if(role)
snprintf(tmp, sizeof(tmp), _("BOUNCE (redirect) message using role \"%s\" to : "), role->nick);
@@ -3827,7 +3832,7 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body,
if(outgoing->message_id)
fs_give((void **) &outgoing->message_id);
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(role);
continue;
}
@@ -3983,7 +3988,7 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body,
if(outgoing->message_id)
fs_give((void **) &outgoing->message_id);
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(role);
continue; /* if we got here, there was a prob */
}
@@ -4064,7 +4069,7 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body,
if(outgoing->message_id)
fs_give((void **) &outgoing->message_id);
- outgoing->message_id = generate_message_id();
+ outgoing->message_id = generate_message_id(role);
continue;
}
@@ -5684,7 +5689,7 @@ outgoing2strings(METAENV *header, struct mail_bodystruct *bod, void **text,
(*ppa)->size = cpystr(byte_string(
send_body_size(&part->body)));
if(!part->body.id)
- part->body.id = generate_message_id();
+ part->body.id = generate_message_id(NULL);
(*ppa)->id = cpystr(part->body.id);
(*ppa)->next = NULL;
@@ -6061,7 +6066,7 @@ create_message_body(struct mail_bodystruct **b, PATMT *attach, int flow_it)
p->next = mail_newbody_part();
p = p->next;
- p->body.id = generate_message_id();
+ p->body.id = generate_message_id(NULL);
p->body.contents.text.data = file_contents;
/*