use uuids for qwk message ids

This commit is contained in:
Andrew Pamment 2018-11-01 13:55:51 +10:00
parent 876037e0ac
commit 18443d247e
3 changed files with 21 additions and 7 deletions

View File

@ -592,8 +592,9 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
s_JamSubfield jsf; s_JamSubfield jsf;
int z; int z;
char buffer[256]; char buffer[256];
char qwkuuid[38];
uuid_t magi_msgid; uuid_t magi_msgid;
uuid_t qwk_msgid;
struct mail_area *ma = get_area(confr, area); struct mail_area *ma = get_area(confr, area);
jb = open_jam_base(ma->path); jb = open_jam_base(ma->path);
if (!jb) { if (!jb) {
@ -701,7 +702,10 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.external_address != NULL) { if (conf.external_address != NULL) {
snprintf(buffer, sizeof buffer, "<%lx.%s@%s>", generate_msgid(), basename(ma->path), conf.external_address);
uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0; jsf.HiID = 0;

View File

@ -1388,6 +1388,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
s_JamLastRead jlr; s_JamLastRead jlr;
char buffer[256]; char buffer[256];
char qwkuuid[38];
int z, z2; int z, z2;
struct tm msg_date; struct tm msg_date;
@ -1411,6 +1412,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
int position; int position;
int y; int y;
uuid_t magi_msgid; uuid_t magi_msgid;
uuid_t qwk_msgid;
struct ptr_vector msg_lines; struct ptr_vector msg_lines;
init_ptr_vector(&msg_lines); init_ptr_vector(&msg_lines);
@ -1734,7 +1736,9 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.external_address != NULL) { if (conf.external_address != NULL) {
snprintf(buffer, sizeof buffer, "<%lx.%s@%s>", generate_msgid(), basename(ma->path), conf.external_address); uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0; jsf.HiID = 0;
@ -2027,11 +2031,12 @@ void post_message(struct user_record *user) {
struct fido_addr *from_addr = NULL; struct fido_addr *from_addr = NULL;
char buffer[256]; char buffer[256];
char buffer2[256]; char buffer2[256];
char qwkuuid[38];
int z; int z;
int sem_fd; int sem_fd;
char *bbsname; char *bbsname;
uuid_t magi_msgid; uuid_t magi_msgid;
uuid_t qwk_msgid;
s_JamBase *jb; s_JamBase *jb;
s_JamMsgHeader jmh; s_JamMsgHeader jmh;
s_JamSubPacket *jsp; s_JamSubPacket *jsp;
@ -2203,7 +2208,9 @@ void post_message(struct user_record *user) {
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.external_address != NULL) { if (conf.external_address != NULL) {
snprintf(buffer, sizeof buffer, "<%lx.%s@%s>", generate_msgid(), basename(ma->path), conf.external_address); uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0; jsf.HiID = 0;

View File

@ -945,6 +945,7 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference,
int max_len; int max_len;
int len; int len;
char buffer[256]; char buffer[256];
char qwkuuid[38];
char *body2; char *body2;
char *tagline; char *tagline;
struct utsname name; struct utsname name;
@ -956,7 +957,7 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference,
size_t sz; size_t sz;
char *inbuf, *oubuf; char *inbuf, *oubuf;
uuid_t magi_msgid; uuid_t magi_msgid, qwk_msgid;
if (subj == NULL || to == NULL || body == NULL) { if (subj == NULL || to == NULL || body == NULL) {
return 0; return 0;
@ -1086,7 +1087,9 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference,
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
if (conf.external_address != NULL) { if (conf.external_address != NULL) {
snprintf(buffer, sizeof buffer, "<%lx.%s@%s>", generate_msgid(), basename(ma->path), conf.external_address); uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0; jsf.HiID = 0;