]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/smtp/serv_smtp.c
validate_recipients() - completed removal of unused param
[citadel.git] / citadel / server / modules / smtp / serv_smtp.c
index f5bcab98c70abad7b1d78bda330717775340e4da..b153207567cbf0aebb36357624d57e7cb2fe5b0d 100644 (file)
@@ -215,10 +215,12 @@ void smtp_hello(int which_command) {
                cprintf("250-SIZE %ld\r\n", CtdlGetConfigLong("c_maxmsglen"));
 
 #ifdef HAVE_OPENSSL
-               // Offer TLS, but only if TLS is not already active.
-               // Furthermore, only offer TLS when running on the SMTP-MSA port, not on the SMTP-MTA port,
-               // because if our server doesn't have a trusted certificate, some mailers will refuse to talk to it.
-               if ( (!CC->redirect_ssl) && (SMTP->is_msa) ) {
+               // Offer the STARTTLS option...
+               if (    (!CC->redirect_ssl)                                                     // not if we're already TLS
+                       && (    (SMTP->is_msa)                                                  // Always on port 587
+                               || (CtdlGetConfigInt("smtp_advertise_starttls") != 0)           // On port 25 only if enabled
+                       )
+               ) {
                        cprintf("250-STARTTLS\r\n");
                }
 #endif
@@ -248,8 +250,8 @@ void smtp_webcit_preferences_hack_backend(long msgnum, void *userdata) {
 
        if ( !CM_IsEmpty(msg, eMsgSubject) && (!strcasecmp(msg->cm_fields[eMsgSubject], "__ WebCit Preferences __"))) {
                // This is it!  Change ownership of the message text so it doesn't get freed.
-               *webcit_conf = (char *)msg->cm_fields[eMesageText];
-               msg->cm_fields[eMesageText] = NULL;
+               *webcit_conf = (char *)msg->cm_fields[eMessageText];
+               msg->cm_fields[eMessageText] = NULL;
        }
        CM_Free(msg);
 }
@@ -607,7 +609,6 @@ void smtp_rcpt(void) {
        // This is a *preliminary* call to validate_recipients() to evaluate one recipient.
        valid = validate_recipients(
                (char *)ChrPtr(SMTP->OneRcpt), 
-               smtp_get_Recipients(),
                (SMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
        );
 
@@ -782,7 +783,6 @@ void smtp_data(void) {
        // Submit the message into the Citadel system.
        valid = validate_recipients(
                (char *)ChrPtr(SMTP->recipients),
-               smtp_get_Recipients(),
                (SMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
        );