Hi,

Just an test release, would be nice if it goes to the development server..
I did not test it a whole lot, but it was not a complex patch..

Default authentication is enabled, to disable
put export AUTH_DISABLED=1 in your run file to disable authentication.

Download for now at 
http://iserve01.i-serve.net/qmail-toaster-1.03-1.3.16.src.rpm

JP

--- qmail-1.03.1.3.15/qmail-smtpd.c     2007-11-22 02:39:38.000000000 +0100
+++ qmail-1.03/qmail-smtpd.c    2007-11-22 03:01:12.000000000 +0100
@@ -58,6 +58,7 @@
 int timeout = 1200;
 unsigned int spfbehavior = 0;
 unsigned int require_auth = 0;
+unsigned int auth_disabled = 0;
 int flagauth = 0;


@@ -275,6 +276,9 @@
   x = env_get("REQUIRE_AUTH");
   if(x) { scan_ulong(x,&u); if (u>0) require_auth = 1; }

+  x = env_get("AUTH_DISABLED");
+  if(x) { scan_ulong(x,&u); if (u>0) auth_disabled = 1; }
+
 #ifdef TLS
   if (env_get("SMTPS")) { smtps = 1; tls_init(); }
   else
@@ -494,11 +498,13 @@
 #endif
   out("\r\n250-PIPELINING\r\n250-8BITMIME\r\n");
   out("250-SIZE "); out(size); out("\r\n");
+  if (!auth_disabled) {
 #ifdef CRAM_MD5
-  out("250 AUTH LOGIN PLAIN CRAM-MD5\r\n");
+       out("250 AUTH LOGIN PLAIN CRAM-MD5\r\n");
 #else
-  out("250 AUTH LOGIN PLAIN\r\n");
+       out("250 AUTH LOGIN PLAIN\r\n");
 #endif
+  }
   seenmail = 0; dohelo(arg);
   if (bhelook) flagbarfbhelo = bmcheck(BMCHECK_BHELO);
 }
@@ -980,6 +986,8 @@
 {
   int r;

+  if (auth_disabled) return err_noauth();
+
   if (*arg) {
     if (r = b64decode(arg,str_len(arg),&user) == 1) return err_input();
   }
@@ -1004,6 +1012,7 @@
 {
   int r, id = 0;

+  if (auth_disabled) return err_noauth();
   if (*arg) {
     if (r = b64decode(arg,str_len(arg),&resp) == 1) return err_input();
   }
@@ -1030,6 +1039,8 @@
   int i, r;
   char *s;

+  if (auth_disabled) return err_noauth();
+
   s = unique;                                           /* generate challenge 
*/
   s += fmt_uint(s,getpid());
   *s++ = '.';

Reply via email to