summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
Diffstat (limited to 'pith')
-rw-r--r--pith/pine.hlp2
-rw-r--r--pith/reply.c27
-rw-r--r--pith/reply.h2
-rw-r--r--pith/save.c4
-rw-r--r--pith/send.c2
5 files changed, 21 insertions, 16 deletions
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 37858460..7219dd14 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 472 2020-06-29 12:37:24
+Alpine Commit 473 2020-06-29 14:06:21
============= h_news =================
<HTML>
<HEAD>
diff --git a/pith/reply.c b/pith/reply.c
index 702832a0..534497de 100644
--- a/pith/reply.c
+++ b/pith/reply.c
@@ -1313,7 +1313,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
/*--- The second part, what ever it is ---*/
part->next = mail_newbody_part();
part = part->next;
- part->body.id = generate_message_id();
+ part->body.id = generate_message_id(NULL);
copy_body(&(part->body), orig_body);
/*
@@ -2199,7 +2199,7 @@ forward_mime_msg(MAILSTREAM *stream, long int msgno, char *section, ENVELOPE *en
*partp = mail_newbody_part();
b = &(*partp)->body;
b->type = TYPEMESSAGE;
- b->id = generate_message_id();
+ b->id = generate_message_id(NULL);
b->description = cpystr("Forwarded Message");
b->nested.msg = mail_newmsg();
b->disposition.type = cpystr("inline");
@@ -2550,7 +2550,7 @@ forward_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_bod
/*--- The second part, what ever it is ---*/
part->next = mail_newbody_part();
part = part->next;
- part->body.id = generate_message_id();
+ part->body.id = generate_message_id(NULL);
copy_body(&(part->body), orig_body);
/*
@@ -2596,7 +2596,6 @@ bounce_msg_body(MAILSTREAM *stream,
gf_io_t pc;
*outgoingp = mail_newenvelope();
- (*outgoingp)->message_id = generate_message_id();
(*outgoingp)->subject = cpystr(subject ? subject : "Resent mail....");
/*
@@ -3108,7 +3107,7 @@ fetch_contents(MAILSTREAM *stream, long int msgno, char *section, struct mail_bo
int got_one = 0;
if(!body->id)
- body->id = generate_message_id();
+ body->id = generate_message_id(NULL);
if(body->type == TYPEMULTIPART){
char subsection[256], *subp;
@@ -3344,17 +3343,22 @@ Uniqueness is guaranteed by using the host name, process id, date to the
second and a single unique character
*----------------------------------------------------------------------*/
char *
-generate_message_id(void)
+generate_message_id(ACTION_S *role)
{
- char *id;
- char *leftpart;
- char *hostpart;
+ char *id, *leftpart, *hostpart, *prehostpart;
+
+ if(role && role->from)
+ prehostpart = cpystr(role->from->host ? role->from->host : "huh");
+ else if(ps_global->maildomain) /* as in generate_from() */
+ prehostpart = cpystr(ps_global->maildomain);
+ else
+ prehostpart = cpystr(ps_global->hostname);
if(F_ON(F_ROT13_MESSAGE_ID, ps_global)){
- hostpart = rot13(ps_global->hostname);
+ hostpart = rot13(prehostpart);
leftpart = rot13(oauth2_generate_state());
} else {
- hostpart = cpystr(ps_global->hostname);
+ hostpart = prehostpart;
leftpart = oauth2_generate_state();
}
@@ -3363,6 +3367,7 @@ generate_message_id(void)
fs_give((void **) &hostpart);
fs_give((void **) &leftpart);
+ prehostpart = NULL;
return(id);
}
diff --git a/pith/reply.h b/pith/reply.h
index c911b88e..ce1f9f79 100644
--- a/pith/reply.h
+++ b/pith/reply.h
@@ -92,7 +92,7 @@ BODY *copy_body(BODY *, BODY *);
PARAMETER *copy_parameters(PARAMETER *);
ENVELOPE *copy_envelope(ENVELOPE *);
char *reply_in_reply_to(ENVELOPE *);
-char *generate_message_id(void);
+char *generate_message_id(ACTION_S *);
char *generate_user_agent(void);
char *rot13(char *);
char *rot5n(char *);
diff --git a/pith/save.c b/pith/save.c
index 4592a949..2d74d544 100644
--- a/pith/save.c
+++ b/pith/save.c
@@ -572,9 +572,9 @@ save(struct pine *state, MAILSTREAM *stream, CONTEXT_S *context, char *folder,
p = flags + strlen(flags);
snprintf(p, newlen+1, "%s", "\\DELETED");
- id = generate_message_id();
+ id = oauth2_generate_state();
idused = id ? id : "<xyz>";
- snprintf(dummymsg, sizeof(dummymsg), "Date: Thu, 18 May 2006 00:00 -0700\r\nFrom: dummy@example.com\r\nSubject: dummy\r\nMessage-ID: %s\r\n\r\ndummy\r\n", idused);
+ snprintf(dummymsg, sizeof(dummymsg), "Date: Thu, 18 May 2006 00:00 -0700\r\nFrom: dummy@example.com\r\nSubject: dummy\r\nMessage-ID: %s@example.com\r\n\r\ndummy\r\n", idused);
/*
* We need to get the uid of the message we are about to
diff --git a/pith/send.c b/pith/send.c
index 80db83f8..8d4d419a 100644
--- a/pith/send.c
+++ b/pith/send.c
@@ -826,7 +826,7 @@ redraft_work(MAILSTREAM **streamp, long int cont_msg, ENVELOPE **outgoing,
if((*outgoing)->message_id)
fs_give((void **)&(*outgoing)->message_id);
- (*outgoing)->message_id = generate_message_id();
+ (*outgoing)->message_id = generate_message_id(role ? *role : NULL);
}
if(b && b->type != TYPETEXT){