Updated the comments in serv_smtp.c to reflect that it is strictly a server now.
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 Jun 2012 14:23:24 +0000 (10:23 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 Jun 2012 14:23:24 +0000 (10:23 -0400)
citadel/auth.c
citadel/modules/smtp/serv_smtp.c

index 89218b60df93d61a12b897ba7e8a6f1d0c2ead7c..ae09354f230627960660a8d44a9e0b4291c0a029 100644 (file)
@@ -110,7 +110,7 @@ int validate_password(uid_t uid, const char *pass)
 #endif
        struct passwd *pw;
        int retval = 0;
-       int flags;
+       int flags = 0;
 
 #ifdef PAM_DATA_SILENT
        flags = PAM_DATA_SILENT;
index 0219659b936993ae87199b7a68cd4dbf8b74c9eb..d6f8e2a30e72ace82cfa10d1287a976d684a8a6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * This module is an SMTP and ESMTP implementation for the Citadel system.
+ * This module is an SMTP and ESMTP server for the Citadel system.
  * It is compliant with all of the following:
  *
  * RFC  821 - Simple Mail Transfer Protocol
  *  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.
  *  
- *  
- *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *
- *  
- *  
- *  
  */
 
 #include "sysdep.h"
@@ -102,14 +96,6 @@ enum {                              /* Command states for login authentication */
 };
 
 
-
-
-
-/*****************************************************************************/
-/*                      SMTP SERVER (INBOUND) STUFF                          */
-/*****************************************************************************/
-
-
 /*
  * Here's where our SMTP session begins its happy day.
  */
@@ -590,11 +576,11 @@ void smtp_rcpt(char *argbuf) {
                }
        }
 
-       valid = validate_recipients(recp, 
-                                   smtp_get_Recipients (),
-                                   (sSMTP->is_lmtp)? POST_LMTP:
-                                      (CC->logged_in)? POST_LOGGED_IN:
-                                                       POST_EXTERNAL);
+       valid = validate_recipients(
+               recp, 
+               smtp_get_Recipients(),
+               (sSMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
+       );
        if (valid->num_error != 0) {
                cprintf("550 %s\r\n", valid->errormsg);
                free_recipients(valid);
@@ -730,11 +716,11 @@ void smtp_data(void) {
        msg->cm_fields['V'] = strdup(sSMTP->recipients);
 
        /* Submit the message into the Citadel system. */
-       valid = validate_recipients(sSMTP->recipients, 
-                                   smtp_get_Recipients (),
-                                   (sSMTP->is_lmtp)? POST_LMTP:
-                                      (CC->logged_in)? POST_LOGGED_IN:
-                                                       POST_EXTERNAL);
+       valid = validate_recipients(
+               sSMTP->recipients,
+               smtp_get_Recipients(),
+               (sSMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
+       );
 
        /* If there are modules that want to scan this message before final
         * submission (such as virus checkers or spam filters), call them now
@@ -766,7 +752,7 @@ void smtp_data(void) {
                }
        }
 
-       /* For SMTP and ESTMP, just print the result message.  For LMTP, we
+       /* For SMTP and ESMTP, just print the result message.  For LMTP, we
         * have to print one result message for each recipient.  Since there
         * is nothing in Citadel which would cause different recipients to
         * have different results, we can get away with just spitting out the
@@ -802,7 +788,7 @@ void smtp_data(void) {
 
 
 /*
- * implements the STARTTLS command (Citadel API version)
+ * implements the STARTTLS command
  */
 void smtp_starttls(void)
 {
@@ -810,20 +796,16 @@ void smtp_starttls(void)
        char nosup_response[SIZ];
        char error_response[SIZ];
 
-       sprintf(ok_response,
-               "220 Begin TLS negotiation now\r\n");
-       sprintf(nosup_response,
-               "554 TLS not supported here\r\n");
-       sprintf(error_response,
-               "554 Internal error\r\n");
+       sprintf(ok_response, "220 Begin TLS negotiation now\r\n");
+       sprintf(nosup_response, "554 TLS not supported here\r\n");
+       sprintf(error_response, "554 Internal error\r\n");
        CtdlModuleStartCryptoMsgs(ok_response, nosup_response, error_response);
        smtp_rset(0);
 }
 
 
-
 /* 
- * Main command loop for SMTP sessions.
+ * Main command loop for SMTP server sessions.
  */
 void smtp_command_loop(void) {
        char cmdbuf[SIZ];
@@ -914,12 +896,6 @@ void smtp_command_loop(void) {
 }
 
 
-
-
-
-
-
-
 /*****************************************************************************/
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/