[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cyrus-devel
Subject:    Patch: Allow deliver working with tcp
From:       Thomas Lußnig <lussnig () smcc ! de>
Date:       2006-06-20 10:46:08
Message-ID: 4497D1F0.1000007 () smcc ! de
[Download RAW message or body]

Problem: if you simply enter the Servername as lmtpscoket and it is
preauth it fail to connect.
Because sasl could not handle the announced EXTERNAL mech.

diff -ubr cyrus-imapd-2.3.6/imap/backend.c
cyrus-imapd-2.3.6.neu/imap/backend.c
--- cyrus-imapd-2.3.6/imap/backend.c    2006-05-22 22:54:17.000000000 +0200
+++ cyrus-imapd-2.3.6.neu/imap/backend.c        2006-06-20
12:21:00.000000000 +0200
@@ -396,14 +396,12 @@

     /* get the capabilities */
     mechlist = ask_capability(ret->out, ret->in, prot, &ret->capability);
     /* now need to authenticate to backend server,
        unless we're doing LMTP on a UNIX socket (deliver) */
-    if ((server[0] != '/') || strcmp(prot->sasl_service, "lmtp")) {
-       if ((r = backend_authenticate(ret, prot, &mechlist, userid,
-                                     cb, auth_status))) {
-           syslog(LOG_ERR, "couldn't authenticate to backend server: %s",
-                  sasl_errstring(r, NULL, NULL));
+    
+    if (((server[0] != '/') || strcmp(prot->sasl_service, "lmtp")) &&
(mechlist == NULL || 0 != strncmp(mechlist, "EXTERNAL",8)) ) {
+       if ((r = backend_authenticate(ret, prot, &mechlist, userid, cb,
auth_status))) {
+           syslog(LOG_ERR, "couldn't authenticate to backend server:
%s", sasl_errstring(r, NULL, NULL));
            if (!ret_backend) free(ret);
            close(sock);
            ret = NULL;
diff -ubr cyrus-imapd-2.3.6/imap/xversion.sh
cyrus-imapd-2.3.6.neu/imap/xversion.sh
--- cyrus-imapd-2.3.6/imap/xversion.sh  2003-10-22 20:03:00.000000000 +0200
+++ cyrus-imapd-2.3.6.neu/imap/xversion.sh      2006-06-20
12:06:04.000000000 +0200
@@ -22,4 +22,4 @@
        match ($0, pattern) {
            printf "\"%s\"\n", substr($0, RSTART, RLENGTH)
        }' pattern="$DATEPAT $TIMEPAT" | \
-       sort | tail -1 >> xversion.h
+       sort | tail -n1 >> xversion.h


To allow Postfix to send to cyrus with preauth this patch is needed.

diff -ubr postfix-2.3-20060615-nonprod/src/smtp/smtp_proto.c
postfix-2.3-20060615-nonprod.p/src/smtp/smtp_proto.c
--- postfix-2.3-20060615-nonprod/src/smtp/smtp_proto.c  2006-06-15
02:50:02.000000000 +0200
+++ postfix-2.3-20060615-nonprod.p/src/smtp/smtp_proto.c       
2006-06-16 13:51:03.000000000 +0200
@@ -1177,7 +1177,12 @@
 #ifdef USE_SASL_AUTH
            if (var_smtp_sasl_enable
                && (session->features & SMTP_FEATURE_AUTH))
+                       if (session->sasl_username != NULL)
+                               // Make Cyrus-Lmtp Happy
+                               vstring_sprintf_append(next_command, "
AUTH=<%s>", session->sasl_username);
+                       else
                vstring_strcat(next_command, " AUTH=<>");
+
 #endif
            next_state = SMTP_STATE_RCPT;
            break;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic