Re: [Exim] How to mark authenticated senders in the header?

Top Page
Delete this message
Reply to this message
Author: michael
Date:  
To: exim-users
Subject: Re: [Exim] How to mark authenticated senders in the header?
> > However is practice this does not happen and so the mess continues.
>
> I agree with your last clause!


That's why I asked in the beginning. If everbody obeyed the RFCs,
we would have much less of a mess.

I asked for multiple authenticators of one mechanism that would be tried
until one suceeds. This turned out easier than I thought, the patch
against 3.20 is appended. Without this patch, you have to squeeze all
lookups into one authenticator. I screwed up indentation, but that
makes the diff easier to read.

Philip: Any chance to get this or an equivalent patch into the next release? :)
It really helps me a lot.

Michael
----------------------------------------------------------------------
--- src/smtp_in.c.orig    Wed Jan 10 15:38:50 2001
+++ src/smtp_in.c    Wed Jan 10 15:44:48 2001
@@ -1816,6 +1816,7 @@
   #ifdef HAVE_AUTH
   auth_instance *au;
   int c;
+  int foundAuthenticator;
   #endif


   switch(smtp_read_command())
@@ -1872,17 +1873,12 @@
     /* Search for an authentication mechanism which is configured for use
     as a server. */


-    for (au = auths; au != NULL; au = au->next)
+    for (foundAuthenticator = 0, au = auths; au != NULL; au = au->next)
       {
-      if (strcmpic(s, au->public_name) == 0 && au->server) break;
-      }
-
-    if (au == NULL)
-      {
-      smtp_printf("504 %s mechanism not supported\r\n", s);
-      break;
-      }
+      if (strcmpic(s, au->public_name) == 0 && au->server)
+        {


+        foundAuthenticator=1;
     /* Run the checking code, passing the remainder of the command
     line as data. Initialize $0 empty. The authenticator may set up
     other numeric variables. If authentication succeeds, expand the
@@ -1913,6 +1909,16 @@
       }


     expand_nmax = -1;  /* Reset numeric variables */
+
+      if (c!=FAIL) break;
+    }
+    }
+    if (!foundAuthenticator)
+      {
+      smtp_printf("504 %s mechanism not supported\r\n", s);
+      break;
+      }
+


     switch(c)
       {