Lists: don't overwrite from: header. this only needs to be done for participates.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 24 Feb 2013 11:38:12 +0000 (12:38 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 24 Feb 2013 11:38:12 +0000 (12:38 +0100)
citadel/modules/network/serv_netmail.c
citadel/modules/smtp/smtp_clienthandlers.c
citadel/modules/smtp/smtp_clienthandlers.h
citadel/netconfig.c

index 733a6ae37db66ac141972ae6dd47b3b33a994af1..a04bcfb12719aed29726c6a83410af3724d4c2b6 100644 (file)
@@ -322,7 +322,6 @@ void network_process_list(SpoolControl *sc, struct CtdlMessage *omsg, long *dele
 
 
        CtdlMsgSetCM_Fields(msg, 'K', SKEY(sc->Users[roommailalias]));
 
 
        CtdlMsgSetCM_Fields(msg, 'K', SKEY(sc->Users[roommailalias]));
-       CtdlMsgSetCM_Fields(msg, 'F', SKEY(sc->Users[roommailalias]));
 
        /* if there is no other recipient, Set the recipient
         * of the list message to the email address of the
 
        /* if there is no other recipient, Set the recipient
         * of the list message to the email address of the
index b3de3ae1ee0acac10af62d859bc44d98f17ca795..6762016c5bd11fd1f1fb125c35909ef6ab5f60b0 100644 (file)
@@ -157,6 +157,11 @@ eNextState SMTPC_read_EHLO_reply(SmtpOutMsg *Msg)
                if ((Msg->pCurrRelay == NULL) ||
                    (Msg->pCurrRelay->User == NULL))
                        Msg->State ++; /* Skip auth... */
                if ((Msg->pCurrRelay == NULL) ||
                    (Msg->pCurrRelay->User == NULL))
                        Msg->State ++; /* Skip auth... */
+               if (Msg->pCurrRelay != NULL)
+               {
+                       if (strstr(ChrPtr(Msg->IO.IOBuf), "LOGIN") != NULL)
+                               Msg->SendLogin = 1;
+               }
        }
        /* else we fall back to 'helo' */
        return eSendReply;
        }
        /* else we fall back to 'helo' */
        return eSendReply;
@@ -184,6 +189,11 @@ eNextState SMTPC_read_HELO_reply(SmtpOutMsg *Msg)
                else
                        SMTP_VERROR(5);
        }
                else
                        SMTP_VERROR(5);
        }
+       if (Msg->pCurrRelay != NULL)
+       {
+               if (strstr(ChrPtr(Msg->IO.IOBuf), "LOGIN") != NULL)
+                       Msg->SendLogin = 1;
+       }
        if ((Msg->pCurrRelay == NULL) ||
            (Msg->pCurrRelay->User == NULL))
                Msg->State ++; /* Skip auth... */
        if ((Msg->pCurrRelay == NULL) ||
            (Msg->pCurrRelay->User == NULL))
                Msg->State ++; /* Skip auth... */
@@ -202,17 +212,44 @@ eNextState SMTPC_send_auth(SmtpOutMsg *Msg)
                Msg->State ++; /* Skip auth, shouldn't even come here!... */
        else {
                /* Do an AUTH command if necessary */
                Msg->State ++; /* Skip auth, shouldn't even come here!... */
        else {
                /* Do an AUTH command if necessary */
-               sprintf(buf, "%s%c%s%c%s",
-                       Msg->pCurrRelay->User, '\0',
-                       Msg->pCurrRelay->User, '\0',
-                       Msg->pCurrRelay->Pass);
-
-               CtdlEncodeBase64(encoded, buf,
-                                strlen(Msg->pCurrRelay->User) * 2 +
-                                strlen(Msg->pCurrRelay->Pass) + 2, 0);
-
-               StrBufPrintf(Msg->IO.SendBuf.Buf,
-                            "AUTH PLAIN %s\r\n", encoded);
+               if (Msg->SendLogin)
+               {
+                       sprintf(buf, "%s",
+                               Msg->pCurrRelay->User);
+
+                       CtdlEncodeBase64(encoded, buf,
+                                        strlen(Msg->pCurrRelay->User) * 2 +
+                                        strlen(Msg->pCurrRelay->Pass) + 2, 0);
+                       
+                       StrBufPrintf(Msg->IO.SendBuf.Buf,
+                                    "AUTH LOGIN %s\r\n",
+                                    encoded);
+                       sprintf(buf, "%s",
+                               Msg->pCurrRelay->Pass);
+                       
+                       CtdlEncodeBase64(encoded, buf,
+                                        strlen(Msg->pCurrRelay->User) * 2 +
+                                        strlen(Msg->pCurrRelay->Pass) + 2, 0);
+                       
+                       StrBufAppendPrintf(Msg->IO.SendBuf.Buf,
+                                          "%s\r\n",
+                                          encoded);
+               }
+               else
+               {
+                       sprintf(buf, "%s%c%s%c%s",
+                               Msg->pCurrRelay->User, '\0',
+                               Msg->pCurrRelay->User, '\0',
+                               Msg->pCurrRelay->Pass);
+                       
+                       CtdlEncodeBase64(encoded, buf,
+                                        strlen(Msg->pCurrRelay->User) * 2 +
+                                        strlen(Msg->pCurrRelay->Pass) + 2, 0);
+                       
+                       StrBufPrintf(Msg->IO.SendBuf.Buf,
+                                    "AUTH PLAIN %s\r\n",
+                                    encoded);
+               }
        }
        SMTP_DBG_SEND();
        return eReadMessage;
        }
        SMTP_DBG_SEND();
        return eReadMessage;
index 3cbcb6d4a39881083aaf5d503c1480e880171826..64a405d99b6923e91617e22640a612cf758912ab 100644 (file)
@@ -66,7 +66,7 @@ typedef struct _stmp_out_msg {
        char node[1024];
        char name[1024];
        char mailfrom[1024];
        char node[1024];
        char name[1024];
        char mailfrom[1024];
-
+       long SendLogin;
        long Flags;
 } SmtpOutMsg;
 
        long Flags;
 } SmtpOutMsg;
 
index a086fea44a92da0cd401b1f9b15a7f97c571223a..1b2e974aa6b42ad137397438dec0c7f620fbf27d 100644 (file)
@@ -29,7 +29,7 @@
 #include <libcitadel.h>
 
 #include "include/ctdl_module.h"
 #include <libcitadel.h>
 
 #include "include/ctdl_module.h"
-
+#include "serv_extensions.h"
 
 void vFreeRoomNetworkStruct(void *vOneRoomNetCfg);
 void FreeRoomNetworkStructContent(OneRoomNetCfg *OneRNCfg);
 
 void vFreeRoomNetworkStruct(void *vOneRoomNetCfg);
 void FreeRoomNetworkStructContent(OneRoomNetCfg *OneRNCfg);
@@ -576,7 +576,6 @@ const ConstStr ForceAliases[nForceAliases] = {
        {HKEY("postmaster,")},
        {HKEY("abuse,")}
 };
        {HKEY("postmaster,")},
        {HKEY("abuse,")}
 };
-
 void cmd_snet(char *argbuf)
 {
        struct CitContext *CCC = CC;
 void cmd_snet(char *argbuf)
 {
        struct CitContext *CCC = CC;
@@ -726,6 +725,8 @@ void cmd_snet(char *argbuf)
                        ReadRoomNetConfigFile(&RNCfg, filename);
                        Put(RoomConfigs, LKEY(CCC->room.QRnumber), RNCfg, vFreeRoomNetworkStruct);
                }
                        ReadRoomNetConfigFile(&RNCfg, filename);
                        Put(RoomConfigs, LKEY(CCC->room.QRnumber), RNCfg, vFreeRoomNetworkStruct);
                }
+
+               PerformRoomHooks(&CCC->room);
        }
        end_critical_section(S_NETCONFIGS);
 }
        }
        end_critical_section(S_NETCONFIGS);
 }