summaryrefslogtreecommitdiff
path: root/alpine/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'alpine/send.c')
-rw-r--r--alpine/send.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/alpine/send.c b/alpine/send.c
index 79b6f295..2853b86a 100644
--- a/alpine/send.c
+++ b/alpine/send.c
@@ -1,10 +1,6 @@
-#if !defined(lint) && !defined(DOS)
-static char rcsid[] = "$Id: send.c 1142 2008-08-13 17:22:21Z hubert@u.washington.edu $";
-#endif
-
/*
* ========================================================================
- * Copyright 2013-2021 Eduardo Chappa
+ * Copyright 2013-2022 Eduardo Chappa
* Copyright 2006-2008 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -522,7 +518,7 @@ compose_mail(char *given_to, char *fcc_arg, ACTION_S *role_arg,
if((exists=postponed_stream(&stream,
ps_global->VAR_POSTPONED_FOLDER,
- "Postponed", 0)) & FEX_ISFILE){
+ "Postponed", 1)) & FEX_ISFILE){
if(F_ON(F_ALT_COMPOSE_MENU, ps_global) ||
(ret = redraft_prompt("Postponed",PSTPND_PMT,'n')) == 'y'){
if(!redraft(&stream, &outgoing, &body, &fcc, &lcc, &reply,
@@ -548,8 +544,11 @@ compose_mail(char *given_to, char *fcc_arg, ACTION_S *role_arg,
}
}
}
- else if(F_ON(F_ALT_COMPOSE_MENU, ps_global))
+ else if(F_ON(F_ALT_COMPOSE_MENU, ps_global)){
+ q_status_message(SM_ORDER, 3, 3,
+ _("No postponed messages found!"));
done++;
+ }
if(done)
return;
@@ -1047,7 +1046,7 @@ pine_simple_send(ENVELOPE *outgoing, /* envelope for outgoing message */
char **tobufp, *p, tmp[MAILTMPLEN];
void *messagebuf;
int done = 0, retval = 0, x;
- int lastrc, rc = 0, ku, i, resize_len, result, fcc_result;
+ int lastrc, rc = 0, ku, i, resize_len, result, fcc_result = 0;
int og2s_done = 0;
HelpType help;
static HISTORY_S *history = NULL;
@@ -1821,12 +1820,12 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body,
char *start_here_name = NULL;
char *suggested_nntp_server = NULL;
char *title = NULL;
- struct headerentry *he, *headents, *he_to, *he_fcc, *he_news = NULL, *he_lcc = NULL,
+ struct headerentry *he, *headents, *he_to = NULL, *he_fcc = NULL, *he_news = NULL, *he_lcc = NULL,
*he_from = NULL;
PINEFIELD *pfields, *pf, *pf_nobody = NULL, *pf_to = NULL,
- *pf_smtp_server, *pf_nntp_server,
- *pf_fcc = NULL, *pf_err, *pf_uid, *pf_mbox, *pf_curpos,
- *pf_ourrep, *pf_ourhdrs, **sending_order;
+ *pf_smtp_server = NULL, *pf_nntp_server = NULL,
+ *pf_fcc = NULL, *pf_err = NULL, *pf_uid = NULL, *pf_mbox = NULL, *pf_curpos = NULL,
+ *pf_ourrep = NULL, *pf_ourhdrs = NULL, **sending_order;
METAENV header;
ADDRESS *lcc_addr = NULL;
ADDRESS *nobody_addr = NULL;
@@ -3139,6 +3138,22 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body,
outgoing->sender->host = cpystr(ps_global->hostname);
}
+ /* To protect the privacy of the user, make sure that the domain
+ * part in the message id matches the domain in the from, so that
+ * the user does not disclose more than they are already willing
+ * to disclose.
+ */
+
+ if(outgoing->message_id && outgoing->from && !role){
+ fs_give((void **) &outgoing->message_id);
+ role = (ACTION_S *) fs_get(sizeof(ACTION_S)); /* create fake role */
+ memset((void *) role, 0, sizeof(ACTION_S));
+ role->from = outgoing->from; /* and fill the from field only */
+ outgoing->message_id = generate_message_id(role); /* new message id */
+ role->from = NULL; /* disconnect the from part */
+ fs_give((void **) &role); /* the fake role can be discarded */
+ }
+
if(ps_global->newthread){
if(outgoing->in_reply_to) fs_give((void **)&outgoing->in_reply_to);
if(outgoing->references) fs_give((void **)&outgoing->references);
@@ -3202,6 +3217,7 @@ pine_send(ENVELOPE *outgoing, struct mail_bodystruct **body,
* In the Postpone case, just create it if the user wants to
* and create a temporary storage object to write into. */
fake_hup:
+ fcc_result = 0;
lmc.all_written = lmc.text_only = lmc.text_written = 0;
if(editor_result & (COMP_GOTHUP | COMP_CANCEL)){
int newfile = 1;
@@ -5285,7 +5301,7 @@ filter_message_text(char *fcmd, ENVELOPE *outgoing, struct mail_bodystruct *body
? &body->nested.part->body.contents.text.data
: &body->contents.text.data),
*tmp_so = NULL, *tmpf_so,
- *save_local_so, *readthis_so, *our_tmpf_so = NULL;
+ *save_local_so, *readthis_so = NULL, *our_tmpf_so = NULL;
#define DO_HEADERS 1
if(fcmd