Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 24 Apr 2012 09:45:28 +0000 (11:45 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 24 Apr 2012 09:45:28 +0000 (11:45 +0200)
citadel/context.h
citadel/modules/smtp/serv_smtpeventclient.c
citadel/modules/smtp/smtp_clienthandlers.c
citadel/sysdep.c
citadel/user_ops.c

index 5e9d998acb9d8a9e4798da2e6a4fc9df15ae9636..c2578036035f92bc73062aaf81566b8912a6a43e 100644 (file)
@@ -129,6 +129,7 @@ struct CitContext {
        struct cit_ical *CIT_ICAL;              /* calendaring data */
        struct ma_info *ma;                     /* multipart/alternative data */
        const char *ServiceName;                /* readable purpose of this session */
+       long tcp_port;
        void *openid_data;                      /* Data stored by the OpenID module */
        char *ldap_dn;                          /* DN of user when using AUTHMODE_LDAP */
 
index 05b06aac4c8328c123557c12de61f4f86875623b..1698ab74773c1886d7152a3e6b088f1594b12abc 100644 (file)
@@ -136,7 +136,25 @@ eNextState FinalizeMessageSend_DB4(AsyncIO *IO);
  ******************************************************************************/
 inline void FinalizeMessageSend_1(AsyncIO *IO)
 {
+       const char *Status;
        SmtpOutMsg *Msg = IO->Data;
+       
+       if (Msg->MyQEntry->Status == 2) 
+               Status = "Delivery Successfull.";
+       else if (Msg->MyQEntry->Status == 5) 
+               Status = "Delivery failed permanently; giving up.";
+       else
+               Status = "Delivery failed temporarily; will retry later.";
+                       
+       EVS_syslog(LOG_INFO,
+                  "SMTP: %s Recipient <%s> @ <%s> (%s) Statusmessage: %s\n",
+                  Status,
+                  Msg->user,
+                  Msg->node,
+                  Msg->name,
+                  ChrPtr(Msg->MyQEntry->StatusMessage));
+
+
        Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem);
 
        Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem);
index 30f6a6f50df5fa26c7153e0dafb1aa955af6273f..09a1bd881b1bf1162ca43b3bb6f059e2f452a257 100644 (file)
@@ -373,7 +373,7 @@ eNextState SMTPC_read_QUIT_reply(SmtpOutMsg *Msg)
        AsyncIO *IO = &Msg->IO;
        SMTP_DBG_READ();
 
-       EVS_syslog(LOG_INFO,
+       EVS_syslog(LOG_DEBUG,
                   "SMTP client[%ld]: delivery to <%s> @ <%s> (%s) succeeded\n",
                   Msg->n,
                   Msg->user,
index 2b83270c01c7d1e10fb0f5036c9be522aba084a7..422370772fddd851f50735d7dd10f53147f7ded7 100644 (file)
@@ -1271,6 +1271,7 @@ do_select:        force_purge = 0;
                                        con = CreateNewContext();
 
                                        /* Assign our new socket number to it. */
+                                       con->tcp_port = serviceptr->tcp_port;
                                        con->client_socket = ssock;
                                        con->h_command_function = serviceptr->h_command_function;
                                        con->h_async_function = serviceptr->h_async_function;
index 370d00811f55022adf025fc9bf89b287597e41aa..7bc53ce36f6488016388c92b3ca68bb5c5dae0a0 100644 (file)
@@ -934,16 +934,17 @@ void start_chkpwd_daemon(void) {
 int CtdlTryPassword(const char *password, long len)
 {
        int code;
+       CitContext *CCC = CC;
 
-       if ((CC->logged_in)) {
+       if ((CCC->logged_in)) {
                syslog(LOG_WARNING, "CtdlTryPassword: already logged in\n");
                return pass_already_logged_in;
        }
-       if (!strcmp(CC->curr_user, NLI)) {
+       if (!strcmp(CCC->curr_user, NLI)) {
                syslog(LOG_WARNING, "CtdlTryPassword: no user selected\n");
                return pass_no_user;
        }
-       if (CtdlGetUser(&CC->user, CC->curr_user)) {
+       if (CtdlGetUser(&CCC->user, CCC->curr_user)) {
                syslog(LOG_ERR, "CtdlTryPassword: internal error\n");
                return pass_internal_error;
        }
@@ -953,7 +954,7 @@ int CtdlTryPassword(const char *password, long len)
        }
        code = (-1);
 
-       if (CC->is_master) {
+       if (CCC->is_master) {
                code = strcmp(password, config.c_master_pass);
        }
 
@@ -961,7 +962,7 @@ int CtdlTryPassword(const char *password, long len)
 
                /* host auth mode */
 
-               if (validpw(CC->user.uid, password)) {
+               if (validpw(CCC->user.uid, password)) {
                        code = 0;
 
                        /*
@@ -972,9 +973,9 @@ int CtdlTryPassword(const char *password, long len)
                         * this is a security hazard, comment it out.
                         */
 
-                       CtdlGetUserLock(&CC->user, CC->curr_user);
-                       safestrncpy(CC->user.password, password, sizeof CC->user.password);
-                       CtdlPutUserLock(&CC->user);
+                       CtdlGetUserLock(&CCC->user, CCC->curr_user);
+                       safestrncpy(CCC->user.password, password, sizeof CCC->user.password);
+                       CtdlPutUserLock(&CCC->user);
 
                        /*
                         * (sooper-seekrit hack ends here)
@@ -991,7 +992,7 @@ int CtdlTryPassword(const char *password, long len)
 
                /* LDAP auth mode */
 
-               if ((CC->ldap_dn) && (!CtdlTryPasswordLDAP(CC->ldap_dn, password))) {
+               if ((CCC->ldap_dn) && (!CtdlTryPasswordLDAP(CCC->ldap_dn, password))) {
                        code = 0;
                }
                else {
@@ -1008,11 +1009,11 @@ int CtdlTryPassword(const char *password, long len)
                pw = (char*) malloc(len + 1);
                memcpy(pw, password, len + 1);
                strproc(pw);
-               strproc(CC->user.password);
-               code = strcasecmp(CC->user.password, pw);
+               strproc(CCC->user.password);
+               code = strcasecmp(CCC->user.password, pw);
                strproc(pw);
-               strproc(CC->user.password);
-               code = strcasecmp(CC->user.password, pw);
+               strproc(CCC->user.password);
+               code = strcasecmp(CCC->user.password, pw);
                free (pw);
        }
 
@@ -1020,7 +1021,16 @@ int CtdlTryPassword(const char *password, long len)
                do_login();
                return pass_ok;
        } else {
-               syslog(LOG_WARNING, "Bad password specified for <%s>\n", CC->curr_user);
+               syslog(LOG_WARNING, "Bad password specified for <%s> Service <%s> Port <%ld> Remote <%s / %s>\n",
+                      CCC->curr_user,
+                      CCC->ServiceName,
+                      CCC->tcp_port,
+                      CCC->cs_host,
+                      CCC->cs_addr);
+
+
+//citserver[5610]: Bad password specified for <willi> Service <citadel-TCP> Remote <PotzBlitz / >
+
                return pass_wrong_password;
        }
 }