From: Art Cancro Date: Wed, 16 Feb 2000 04:42:02 +0000 (+0000) Subject: * More addressing hacks X-Git-Tag: v7.86~7304 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=2579891f090700c01844dff9a29e249eece3e529 * More addressing hacks --- diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 94c2e8fce..e18784239 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -367,7 +367,10 @@ int convert_field(struct CtdlMessage *msg, int beg, int end) { int colonpos = (-1); int processed = 0; char buf[256]; - char *user, *node, *name; + char user[1024]; + char node[1024]; + char name[1024]; + char addr[1024]; time_t parsed_date; rfc822 = msg->cm_fields['M']; /* M field contains rfc822 text */ @@ -404,23 +407,14 @@ int convert_field(struct CtdlMessage *msg, int beg, int end) { } else if (!strcasecmp(key, "From")) { - user = mallok(1024); - node = mallok(1024); - name = mallok(1024); process_rfc822_addr(value, user, node, name); lprintf(9, "Converted to <%s@%s> (%s)\n", user, node, name); + sprintf(addr, "%s@%s", user, node); if (msg->cm_fields['A'] == NULL) - msg->cm_fields['A'] = user; - else - phree(user); - if (msg->cm_fields['N'] == NULL) - msg->cm_fields['N'] = node; - else - phree(node); - if (msg->cm_fields['H'] == NULL) - msg->cm_fields['H'] = name; - else - phree(name); + msg->cm_fields['A'] = strdoop(name); + processed = 1; + if (msg->cm_fields['F'] == NULL) + msg->cm_fields['F'] = strdoop(addr); processed = 1; } diff --git a/citadel/messages.c b/citadel/messages.c index a396be0d1..aea57cde6 100644 --- a/citadel/messages.c +++ b/citadel/messages.c @@ -403,6 +403,15 @@ int read_message(long int num, char pagin) /* Read a message from the server */ } if (!struncmp(buf,"subj=",5)) strcpy(m_subject,&buf[5]); + + if (!struncmp(buf,"rfca=",5)) { + color(DIM_WHITE); + printf("<"); + color(BRIGHT_BLUE); + printf("%s",&buf[5]); + color(DIM_WHITE); + printf("> "); + } if ((!struncmp(buf,"hnod=",5)) && (strucmp(&buf[5],serv_info.serv_humannode))) { color(DIM_WHITE); diff --git a/citadel/msgbase.c b/citadel/msgbase.c index c09821091..6b4e645a4 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -49,7 +49,8 @@ char *msgkeys[] = { "from", "", "", "", "exti", - "", "", + "rfca", + "", "hnod", "msgn", "", "", "", @@ -759,6 +760,7 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ /* buffers needed for RFC822 translation */ char suser[256]; char luser[256]; + char fuser[256]; char snode[256]; char lnode[256]; char mid[256]; @@ -897,6 +899,7 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ strcpy(suser, ""); strcpy(luser, ""); + strcpy(fuser, ""); strcpy(snode, NODENAME); strcpy(lnode, HUMANNODE); if (mode == MT_RFC822) { @@ -943,7 +946,14 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ } cprintf("Message-ID: <%s@%s>%s", mid, snode, nl); PerformUserHooks(luser, (-1L), EVT_OUTPUTMSG); - cprintf("From: %s@%s (%s)%s", suser, snode, luser, nl); + + if (strlen(fuser) > 0) { + cprintf("From: %s (%s)%s", fuser, luser, nl); + } + else { + cprintf("From: %s@%s (%s)%s", suser, snode, luser, nl); + } + cprintf("Organization: %s%s", lnode, nl); } diff --git a/citadel/server.h b/citadel/server.h index 757858aad..10a6f853b 100644 --- a/citadel/server.h +++ b/citadel/server.h @@ -413,7 +413,7 @@ struct ser_ret { /* Preferred field order */ -/* ********* Important fields */ -/* **************** Semi-important fields */ +/* ********** Important fields */ +/* *************** Semi-important fields */ /* * Message text (MUST be last) */ -#define FORDER "IPTAONHRDBCEFGJKLQSUVWXYZM" +#define FORDER "IPTAFONHRDBCEGJKLQSUVWXYZM" diff --git a/citadel/techdoc/hack.txt b/citadel/techdoc/hack.txt index 6218a80a4..4028ccecc 100644 --- a/citadel/techdoc/hack.txt +++ b/citadel/techdoc/hack.txt @@ -90,6 +90,8 @@ E Extended ID A persistent alphanumeric Message ID used for message should be deleted. If there exist any messages with the same Extended ID that are *newer*, then this message should be dropped. +F rFc821 address For Internet mail, this is the delivery address of the + message author. G Gateway domain This field is provided solely for the implementation of C86Net gateways, and holds the C86Net domain of the system this message originated on. Unless you're