X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=b4ed04e1f26fad003dfeb477b0cbb07de4d17d53;hb=7e06cf0ca1c9821277a625fe63f77e4a286c6759;hp=9dde1f53549da3d3844011ac017237296eec50a6;hpb=a47ba867a090bf443d5a9752298d8f6cc39dfb38;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 9dde1f535..b4ed04e1f 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -29,6 +29,7 @@ #include "mime_parser.h" #include "html.h" #include "genstamp.h" +#include "internet_addressing.h" #define desired_section ((char *)CtdlGetUserData(SYM_DESIRED_SECTION)) #define ma ((struct ma_info *)CtdlGetUserData(SYM_MA_INFO)) @@ -129,6 +130,16 @@ int alias(char *name) fclose(fp); lprintf(7, "Mail is being forwarded to %s\n", name); + /* Change "user @ xxx" to "user" if xxx is an alias for this host */ + for (a=0; a\n", name); + } + } + } + /* determine local or remote type, see citadel.h */ for (a = 0; a < strlen(name); ++a) if (name[a] == '!') @@ -155,7 +166,7 @@ int alias(char *name) fp = fopen("network/mail.sysinfo", "r"); if (fp == NULL) return (MES_ERROR); - GETSN:do { +GETSN: do { a = getstring(fp, aaa); } while ((a >= 0) && (strcasecmp(aaa, bbb))); a = getstring(fp, aaa); @@ -675,12 +686,10 @@ void CtdlFreeMessage(struct CtdlMessage *msg) for (i = 0; i < 256; ++i) if (msg->cm_fields[i] != NULL) { - lprintf(9, "phreeing %c\n", i); phree(msg->cm_fields[i]); } msg->cm_magic = 0; /* just in case */ - lprintf(9, "phreeing msg\n"); phree(msg); } @@ -783,7 +792,7 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ return(om_not_logged_in); } - /* FIX ... small security issue + /* FIXME ... small security issue * We need to check to make sure the requested message is actually * in the current room, and set msg_ok to 1 only if it is. This * functionality is currently missing because I'm in a hurry to replace @@ -979,7 +988,7 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ return(om_ok); } else if (mode == MT_RFC822) { /* unparsed RFC822 dump */ - /* FIX ... we have to put some code in here to avoid + /* FIXME ... we have to put some code in here to avoid * printing duplicate header information when both * Citadel and RFC822 headers exist. Preference should * probably be given to the RFC822 headers. @@ -1134,7 +1143,7 @@ void cmd_msg3(char *cmdbuf) /* - * display a message (mode 4 - MIME) (FIX ... still evolving, not complete) + * display a message (mode 4 - MIME) (FIXME ... still evolving, not complete) */ void cmd_msg4(char *cmdbuf) { @@ -1517,11 +1526,25 @@ long CtdlSaveMsg(struct CtdlMessage *msg, /* message to save */ strcpy(force_room, force); /* Strip non-printable characters out of the recipient name */ + lprintf(9, "Checking recipient (if present)\n"); strcpy(recipient, rec); for (a = 0; a < strlen(recipient); ++a) if (!isprint(recipient[a])) strcpy(&recipient[a], &recipient[a + 1]); + /* Change "user @ xxx" to "user" if xxx is an alias for this host */ + for (a=0; a\n", recipient); + } + } + } + + lprintf(9, "Recipient is <%s>\n", recipient); + /* Learn about what's inside, because it's what's inside that counts */ lprintf(9, "Learning what's inside\n"); if (msg->cm_fields['M'] == NULL) {