summaryrefslogtreecommitdiff
path: root/alpine
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-06-29 03:19:56 -0600
committerEduardo Chappa <chappa@washington.edu>2020-06-29 03:19:56 -0600
commit4d77713f495bc1e797393cb05e88f17f78ff91d1 (patch)
tree1850ff02995d4c70ab32e3b125a39dff7c1414ab /alpine
parentac3618ca9d4d5136b8e231c6de23b2da6add204f (diff)
downloadalpine-4d77713f495bc1e797393cb05e88f17f78ff91d1.tar.xz
* Modifications to protect the privacy of users:
+ Alpine does not generate Sender or X-X-Sender by default by making [X] Do Not Generate Sender Header the default. + Alpine does not disclose User Agent by default by making [X] Suppress User Agent When Sending the default. + Alpine uses the domain in the From: header of a message to generate a message-id and suppresses all information about Alpine, version, revision, and time of generation of the message-id from this header. This information is replaced by a random string.
Diffstat (limited to 'alpine')
-rw-r--r--alpine/send.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/alpine/send.c b/alpine/send.c
index b4e2322..2e6eace 100644
--- a/alpine/send.c
+++ b/alpine/send.c
@@ -603,6 +603,7 @@ compose_mail(char *given_to, char *fcc_arg, ACTION_S *role_arg,
int impl, template_len = 0;
long rflags = ROLE_COMPOSE;
PAT_STATE dummy;
+ char *hostpart;
/*================= Compose new message ===============*/
body = mail_newbody();
@@ -611,8 +612,6 @@ compose_mail(char *given_to, char *fcc_arg, ACTION_S *role_arg,
if(given_to)
rfc822_parse_adrlist(&outgoing->to, given_to, ps_global->maildomain);
- outgoing->message_id = generate_message_id();
-
/*
* Setup possible role
*/
@@ -646,6 +645,24 @@ compose_mail(char *given_to, char *fcc_arg, ACTION_S *role_arg,
role->nick);
/*
+ * set ps_global->hostname to something sensible, if possible,
+ * for purposes of generating a message id
+ */
+ hostpart = cpystr(ps_global->hostname);
+ fs_give((void **) &ps_global->hostname);
+ if(role && role->from)
+ ps_global->hostname = cpystr(role->from->host ? role->from->host : "huh");
+ else if(ps_global->maildomain) /* as in generate_from() */
+ ps_global->hostname = cpystr(ps_global->maildomain);
+ else
+ ps_global->hostname = cpystr(hostpart); /* all for nothing */
+ outgoing->message_id = generate_message_id();
+ /* undo the changes above */
+ fs_give((void **) &ps_global->hostname);
+ ps_global->hostname = cpystr(hostpart);
+ fs_give((void **) &hostpart);
+
+ /*
* The type of storage object allocated below is vitally
* important. See SIMPLIFYING ASSUMPTION #37
*/