Removed some leftover dependencies on message fields which no longer exist
authorArt Cancro <ajc@citadel.org>
Sun, 5 Jul 2020 15:52:51 +0000 (11:52 -0400)
committerArt Cancro <ajc@citadel.org>
Sun, 5 Jul 2020 15:52:51 +0000 (11:52 -0400)
citadel/citserver.c
citadel/modules/calendar/serv_calendar.c
citadel/modules/imap/imap_fetch.c
citadel/modules/imap/imap_misc.c
citadel/modules/network/serv_netmail.c
citadel/modules/sieve/serv_sieve.c
citadel/modules/smtp/serv_smtp.c
citadel/msgbase.c
citadel/msgbase.h
citadel/server.h

index 3eb8cf2a7228c09e248555a0b4aa22c365d0d51f..b9648f6f70a3ba3b3b5759e992d1069477583070 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2019 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -189,12 +189,12 @@ char CtdlCheckExpress(void)
 void citproto_begin_session()
 {
        if (CC->nologin == 1) {
-               cprintf("%d %s: Too many users are already online (maximum is %d)\n",
-                       ERROR + MAX_SESSIONS_EXCEEDED, CtdlGetConfigStr("c_nodename"), CtdlGetConfigInt("c_maxsessions")
+               cprintf("%d Too many users are already online (maximum is %d)\n",
+                       ERROR + MAX_SESSIONS_EXCEEDED, CtdlGetConfigInt("c_maxsessions")
                    );
                CC->kill_me = KILLME_MAX_SESSIONS_EXCEEDED;
        } else {
-               cprintf("%d %s Citadel server ready.\n", CIT_OK, CtdlGetConfigStr("c_nodename"));
+               cprintf("%d %s Citadel server ready.\n", CIT_OK, CtdlGetConfigStr("c_fqdn"));
                CC->can_receive_im = 1;
        }
 }
@@ -203,7 +203,7 @@ void citproto_begin_session()
 void citproto_begin_admin_session()
 {
        CC->internal_pgm = 1;
-       cprintf("%d %s Citadel server ADMIN CONNECTION ready.\n", CIT_OK, CtdlGetConfigStr("c_nodename"));
+       cprintf("%d %s Citadel server ADMIN CONNECTION ready.\n", CIT_OK, CtdlGetConfigStr("c_fqdn"));
 }
 
 
index 02153287fd3996f8d19310e84ab945846f6b7124..c38ffd250b5c1103cff240adebe9f03be68f8929 100644 (file)
@@ -3,7 +3,7 @@
  * room on a Citadel server.  It handles iCalendar objects using the
  * iTIP protocol.  See RFCs 2445 and 2446.
  *
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -137,7 +137,6 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
                msg->cm_format_type = 4;
                CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
                CM_SetField(msg, eOriginalRoom, CCC->room.QRname, strlen(CCC->room.QRname));
-               CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
 
                MsgBody = NewStrBufPlain(NULL, serlen + 100);
                StrBufAppendBufPlain(MsgBody, HKEY("Content-type: text/calendar\r\n\r\n"), 0);
index 91cb398323268b149f82a3ead81abb0026adf31e..293fecca019eec5c160b7c7531a63cfd4c32f818 100644 (file)
@@ -2,7 +2,7 @@
  * Implements the FETCH command in IMAP.
  * This is a good example of the protocol's gratuitous complexity.
  *
- * Copyright (c) 2001-2017 by the citadel.org team
+ * Copyright (c) 2001-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -347,19 +347,14 @@ void imap_output_envelope_from(struct CtdlMessage *msg) {
 
        if (!CM_IsEmpty(msg, erFc822Addr)) {
                process_rfc822_addr(msg->cm_fields[erFc822Addr], user, node, name);
-               IPutStr(user, strlen(user));            /* mailbox name (user id) */
+               IPutStr(user, strlen(user));                    /* mailbox name (user id) */
                IAPuts(" ");
-               if (!strcasecmp(node, CtdlGetConfigStr("c_nodename"))) {
-                       IPutStr(CtdlGetConfigStr("c_fqdn"), strlen(CtdlGetConfigStr("c_fqdn")));
-               }
-               else {
-                       IPutStr(node, strlen(node));            /* host name */
-               }
+               IPutStr(node, strlen(node));                    /* host name */
        }
        else {
-               IPutMsgField(eAuthor); /* mailbox name (user id) */
+               IPutMsgField(eAuthor);                          /* Make up a synthetic address */
                IAPuts(" ");
-               IPutMsgField(eNodeName);        /* host name */
+               IPutStr(CtdlGetConfigStr("c_fqdn"), strlen(CtdlGetConfigStr("c_fqdn")));
        }
        
        IAPuts(")) "); /* close double-parens */
index 39ae34b82356cf43060f25a6462b698890979a55..6e68b6cbe7915fc3c4daf2d857677bc58d22269c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -275,7 +275,6 @@ void imap_do_append_flags(long new_msgnum, char *new_message_flags) {
  * This function is called by the main command loop.
  */
 void imap_append(int num_parms, ConstStr *Params) {
-       struct CitContext *CCC = CC;
        long literal_length;
        struct CtdlMessage *msg = NULL;
        long new_msgnum = (-1L);
@@ -366,19 +365,17 @@ void imap_append(int num_parms, ConstStr *Params) {
         * folder is selected, save its name so we can return there!!!!!)
         */
        if (Imap->selected) {
-               strcpy(savedroom, CCC->room.QRname);
+               strcpy(savedroom, CC->room.QRname);
        }
        CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /* If the user is locally authenticated, FORCE the From: header to
         * show up as the real sender.  (Configurable setting)
         */
-       if (CCC->logged_in) {
-               if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (CtdlGetConfigInt("c_imap_keep_from") == 0))
+       if (CC->logged_in) {
+               if ( ((CC->room.QRflags & QR_MAILBOX) == 0) && (CtdlGetConfigInt("c_imap_keep_from") == 0))
                {
-                       CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
-                       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
-                       CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
+                       CM_SetField(msg, eAuthor, CC->user.fullname, strlen(CC->user.fullname));
                }
        }
 
index 6ee61cfd57317c3aec1d45864541af63d07d2289..b4c5f713b8f9f6da65d7694b247e27b37564fa29 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This module handles network mail and mailing list processing.
  *
- * Copyright (c) 2000-2018 by the citadel.org team
+ * Copyright (c) 2000-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -269,11 +269,6 @@ void network_process_digest(SpoolControl *sc, struct CtdlMessage *omsg, long *de
                                "<%s> ",
                                msg->cm_fields[erFc822Addr]);
                }
-               else if (!CM_IsEmpty(msg, eNodeName)) {
-                       fprintf(sc->digestfp,
-                               "@%s ",
-                               msg->cm_fields[eNodeName]);
-               }
                fprintf(sc->digestfp, "\n");
                if (!CM_IsEmpty(msg, eMsgSubject)) {
                        fprintf(sc->digestfp,
@@ -397,12 +392,11 @@ void network_process_participate(SpoolControl *sc, struct CtdlMessage *omsg, lon
         * is rude...
         */
        ok_to_participate = 0;
-       if (!CM_IsEmpty(msg, eNodeName)) {
-               if (!strcasecmp(msg->cm_fields[eNodeName], CtdlGetConfigStr("c_nodename")))
-               {
-                       ok_to_participate = 1;
-               }
-       }
+
+       // FIXME -- After we removed CitaNet/IGnet support , we now need a new heuristic to determine
+       // whether a message originated locally.  This means the "participate" mode no longer works.
+       // We'll definitely need to refactor this when we do other federated stuff later.
+
        if (ok_to_participate)
        {
                /* Replace the Internet email address of the
index 30e03100759b8272827a7792facf871325be1b96..437bd662b8d37c7abcaa292578cf4cfcfe445803 100644 (file)
@@ -2,7 +2,7 @@
  * This module glues libSieve to the Citadel server in order to implement
  * the Sieve mailbox filtering language (RFC 3028).
  *
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -619,10 +619,6 @@ void sieve_do_msg(long msgnum, void *userdata) {
        }
        else if (!CM_IsEmpty(msg, eRecipient)) {
                safestrncpy(my.envelope_to, msg->cm_fields[eRecipient], sizeof my.envelope_to);
-               if (!CM_IsEmpty(msg, eDestination)) {
-                       strcat(my.envelope_to, "@");
-                       strcat(my.envelope_to, msg->cm_fields[eDestination]);
-               }
                stripallbut(my.envelope_to, '<', '>');
        }
        else {
index b7ee16a693da15c0fa14789e12ba67b041226b0f..5fbc5003c5592f46db2801b09a96c3fb9ab67622 100644 (file)
@@ -900,7 +900,6 @@ void smtp_data(long offset, long flags)
                        return;
                }
 
-               CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
                CM_SetField(msg, eOriginalRoom, HKEY(MAILROOM));
                if (sSMTP->preferred_sender_name != NULL)
                        CM_SetField(msg, eAuthor, SKEY(sSMTP->preferred_sender_name));
index 8421dfc1133789bfd14e1d4ad07761fd0b62fa21..d120ca41093bdf812d15535f95abfe2e9bbba1af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Implements the message store.
  *
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -38,7 +38,7 @@ struct addresses_to_be_filed *atbf = NULL;
  * These are the four-character field headers we use when outputting
  * messages in Citadel format (as opposed to RFC822 format).
  */
-char *msgkeys[91] = {
+char *msgkeys[] = {
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
@@ -48,34 +48,34 @@ char *msgkeys[91] = {
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
        NULL, 
-       "from", /* A -> eAuthor       */
-       NULL,   /* B -> eBig_message  */
-       NULL,   /* C -> eRemoteRoom   FIXME no more ignet */
-       NULL,   /* D -> eDestination  FIXME no more ignet */
-       "exti", /* E -> eXclusivID    */
-       "rfca", /* F -> erFc822Addr   */
-       NULL,   /* G */
-       "hnod", /* H -> eHumanNode    FIXME no more ignet */
-       "msgn", /* I -> emessageId    */
-       "jrnl", /* J -> eJournal      */
-       "rep2", /* K -> eReplyTo      */
-       "list", /* L -> eListID       */
-       "text", /* M -> eMesageText   */
-       "node", /* N -> eNodeName     FIXME no more ignet */
-       "room", /* O -> eOriginalRoom */
-       "path", /* P -> eMessagePath  */
-       NULL,   /* Q */
-       "rcpt", /* R -> eRecipient    */
-       "spec", /* S -> eSpecialField FIXME we might not be using this anymore */
-       "time", /* T -> eTimestamp    */
-       "subj", /* U -> eMsgSubject   */
-       "nvto", /* V -> eenVelopeTo   */
-       "wefw", /* W -> eWeferences   */
-       NULL,   /* X */
-       "cccc", /* Y -> eCarbonCopY   */
-       NULL   /* Z */
-
+       "from", // A -> eAuthor
+       NULL,   // B -> eBig_message
+       NULL,   // C (formerly used as eRemoteRoom)
+       NULL,   // D (formerly used as eDestination)
+       "exti", // E -> eXclusivID
+       "rfca", // F -> erFc822Addr
+       NULL,   // G
+       "hnod", // H (formerly used as eHumanNode)
+       "msgn", // I -> emessageId
+       "jrnl", // J -> eJournal
+       "rep2", // K -> eReplyTo
+       "list", // L -> eListID
+       "text", // M -> eMesageText
+       NULL,   // N (formerly used as eNodeName)
+       "room", // O -> eOriginalRoom
+       "path", // P -> eMessagePath
+       NULL,   // Q
+       "rcpt", // R -> eRecipient
+       NULL,   // S (formerly used as eSpecialField)
+       "time", // T -> eTimestamp
+       "subj", // U -> eMsgSubject
+       "nvto", // V -> eenVelopeTo
+       "wefw", // W -> eWeferences
+       NULL,   // X
+       "cccc", // Y -> eCarbonCopY
+       NULL    // Z
 };
+
 HashList *msgKeyLookup = NULL;
 
 int GetFieldFromMnemonic(eMsgField *f, const char* c)
@@ -109,21 +109,16 @@ eMsgField FieldOrder[]  = {
        eAuthor      ,
        erFc822Addr  ,
        eOriginalRoom,
-       eNodeName    ,
-       eHumanNode   ,
        eRecipient   ,
-       eDestination ,
 /* Semi-important fields */
        eBig_message ,
-       eRemoteRoom  ,
        eExclusiveID ,
        eWeferences  ,
        eJournal     ,
-/* G is not used yet, may become virus signature*/
+/* G is not used yet */
        eReplyTo     ,
        eListID      ,
 /* Q is not used yet */
-       eSpecialField,
        eenVelopeTo  ,
 /* X is not used yet */
 /* Z is not used yet */
@@ -1695,7 +1690,6 @@ void OutputCtdlMsgHeaders(
        int do_proto)           /* do Citadel protocol responses? */
 {
        int i;
-       int suppress_f = 0;
        char buf[SIZ];
        char display_name[256];
 
@@ -1722,14 +1716,6 @@ void OutputCtdlMsgHeaders(
                }
        }
 
-       /* Don't show Internet address for users on the
-        * local Citadel network.
-        */
-       suppress_f = 0;
-       if (!CM_IsEmpty(TheMessage, eNodeName) && (haschar(TheMessage->cm_fields[eNodeName], '.') == 0)) {
-               suppress_f = 1;
-       }
-
        /* Now spew the header fields in the order we like them. */
        for (i=0; i< NDiskFields; ++i) {
                eMsgField Field;
@@ -1747,9 +1733,6 @@ void OutputCtdlMsgHeaders(
                                                              msgkeys[Field],
                                                              display_name);
                                }
-                               else if ((Field == erFc822Addr) && (suppress_f)) {
-                                       /* do nothing */
-                               }
                                /* Masquerade display name if needed */
                                else {
                                        if (do_proto) {
@@ -1764,7 +1747,7 @@ void OutputCtdlMsgHeaders(
 
 void OutputRFC822MsgHeaders(
        struct CtdlMessage *TheMessage,
-       int flags,              /* should the bessage be exported clean */
+       int flags,              /* should the message be exported clean */
        const char *nl, int nlen,
        char *mid, long sizeof_mid,
        char *suser, long sizeof_suser,
@@ -1819,9 +1802,6 @@ void OutputRFC822MsgHeaders(
                                break;
                        case erFc822Addr:
                                safestrncpy(fuser, mptr, sizeof_fuser);
-                       case eNodeName:
-                               safestrncpy(snode, mptr, sizeof_snode);
-                               break;
                        case eRecipient:
                                if (haschar(mptr, '@') == 0) {
                                        sanitize_truncated_recipient(mptr);
@@ -1863,15 +1843,11 @@ void OutputRFC822MsgHeaders(
                                        cprintf("Reply-To: %s%s", mptr, nl);
                                break;
 
-                       case eRemoteRoom:
-                       case eDestination:
                        case eExclusiveID:
-                       case eHumanNode:
                        case eJournal:
                        case eMesageText:
                        case eBig_message:
                        case eOriginalRoom:
-                       case eSpecialField:
                        case eErrorMsg:
                        case eSuppressIdx:
                        case eExtnotify:
@@ -2165,7 +2141,6 @@ int CtdlOutputPreLoadedMsg(
        strcpy(suser, "");
        strcpy(luser, "");
        strcpy(fuser, "");
-       memcpy(snode, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")) + 1);
        if (mode == MT_RFC822) 
                OutputRFC822MsgHeaders(
                        TheMessage,
@@ -2185,12 +2160,8 @@ int CtdlOutputPreLoadedMsg(
        }
 
        if (mode == MT_RFC822) {
-               if (!strcasecmp(snode, NODENAME)) {
-                       safestrncpy(snode, FQDN, sizeof snode);
-               }
-
                /* Construct a fun message id */
-               cprintf("Message-ID: <%s", mid);/// todo: this possibly breaks threadding mails.
+               cprintf("Message-ID: <%s", mid);
                if (strchr(mid, '@')==NULL) {
                        cprintf("@%s", snode);
                }
@@ -2894,10 +2865,10 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        if ((recps != NULL) && (recps->bounce_to == NULL))
        {
                if (CC->logged_in) {
-                       snprintf(bounce_to, sizeof bounce_to, "%s@%s", CC->user.fullname, CtdlGetConfigStr("c_nodename"));
+                       strcpy(bounce_to, CC->user.fullname);
                }
                else {
-                       snprintf(bounce_to, sizeof bounce_to, "%s@%s", msg->cm_fields[eAuthor], msg->cm_fields[eNodeName]);
+                       strcpy(bounce_to, msg->cm_fields[eAuthor]);
                }
                recps->bounce_to = bounce_to;
        }
@@ -3042,7 +3013,6 @@ long quickie_message(const char *from,
 
        if (!IsEmptyStr(fromaddr)) CM_SetField(msg, erFc822Addr, fromaddr, strlen(fromaddr));
        if (!IsEmptyStr(room)) CM_SetField(msg, eOriginalRoom, room, strlen(room));
-       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
        if (!IsEmptyStr(to)) {
                CM_SetField(msg, eRecipient, to, strlen(to));
                recp = validate_recipients(to, NULL, 0);
@@ -3268,9 +3238,6 @@ struct CtdlMessage *CtdlMakeMessageLen(
                }
        }
 
-       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
-       CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
-
        if (rcplen > 0) {
                CM_SetField(msg, eRecipient, recipient, rcplen);
        }
@@ -3638,8 +3605,6 @@ void CtdlWriteObject(char *req_room,                      /* Room to stuff it in */
        msg->cm_format_type = 4;
        CM_SetField(msg, eAuthor, CC->user.fullname, strlen(CC->user.fullname));
        CM_SetField(msg, eOriginalRoom, req_room, strlen(req_room));
-       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
-       CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
        msg->cm_flags = flags;
        
        CM_SetAsFieldSB(msg, eMesageText, &encoded_message);
index 6ba7603ef5d1de5b257f64428fdc68f52a4ebde5..308c3aa335b8b4949b86b66343afcdecfa613d7c 100644 (file)
@@ -60,7 +60,6 @@ struct repl {                 /* Info for replication checking */
 };
 
 
-
 /*
  * This is a list of "harvested" email addresses that we might want to
  * stick into someone's address book.  But we defer this operaiton so
index cc262d51de035705242a83c82447777811bba2cc..e5e64539c0a7f6ca1012414b61ebc522c7c05c75 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main declarations file for the Citadel server
  *
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -309,21 +309,16 @@ struct UseTable {
 typedef enum _MsgField {
        eAuthor       = 'A',
        eBig_message  = 'B',
-       eRemoteRoom   = 'C',
-       eDestination  = 'D',
        eExclusiveID  = 'E',
        erFc822Addr   = 'F',
-       eHumanNode    = 'H',
        emessageId    = 'I',
        eJournal      = 'J',
        eReplyTo      = 'K',
        eListID       = 'L',
        eMesageText   = 'M',
-       eNodeName     = 'N',
        eOriginalRoom = 'O',
        eMessagePath  = 'P',
        eRecipient    = 'R',
-       eSpecialField = 'S',
        eTimestamp    = 'T',
        eMsgSubject   = 'U',
        eenVelopeTo   = 'V',