merge hcoop maildrop/local user routing rules
[hcoop/zz_old/config/exim4-hopper.git] / conf.d / auth / 30_exim4-config_examples
index fdb35c2..576d260 100644 (file)
@@ -6,7 +6,7 @@
 # local exim is SMTP server and clients authenticate to the local exim.
 
 # They allow two styles of plain-text authentication against an
-# CONFDIR/passwd file whose syntax is described in exim_passwd(5).
+# CONFDIR/passwd file whose syntax is described in exim4_passwd(5).
 
 # Hosts that are allowed to use AUTH are defined by the
 # auth_advertise_hosts option in the main configuration. The default is
@@ -210,20 +210,34 @@ cram_md5:
   client_name = ${extract{1}{:}{${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}}}
   client_secret = ${extract{2}{:}{${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}}}
 
-# hcoop-change: Authenticate against /etc/courier/exim.dat
-userdb_plain:
+# hcoop-change: Authenticate against either /etc/courier/exim.dat or
+# SASL for plain and login authenticators
+
+hcoop_plain:
   driver = plaintext
   public_name = PLAIN
+  server_prompts = :
+  server_condition = \
+    ${if or {{crypteq {$auth3} \
+                      {${extract{systempw}{${tr{${lookup{$auth2} \
+                                 dbm{/etc/courier/exim.dat} \
+                           }}{|}{ }}}}}} \
+             {saslauthd {{$auth2}{$auth3}{exim4}}}}}
+  server_set_id = $auth2
+  server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
+
+hcoop_login:
+  driver = plaintext
+  public_name = LOGIN
+  server_prompts = "Username:: : Password::"
   server_condition = \
-    ${if \
-      crypteq {$3} \
-              {${extract{systempw}{${tr{${lookup{$2} \
+    ${if or {{crypteq {$auth2} \
+                      {${extract{systempw}{${tr{${lookup{$auth1} \
                                  dbm{/etc/courier/exim.dat} \
-                           }}{|}{ }}}}} \
-      {yes} \
-      {no} \
-    }
-  server_set_id = $2
+                           }}{|}{ }}}}}} \
+             {saslauthd {{$auth1}{$auth2}{exim4}}}}}
+  server_set_id = $auth1
+  server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
 
 # this returns the matching line from passwd.client and doubles all ^
 PASSWDLINE=${sg{\
@@ -233,8 +247,8 @@ PASSWDLINE=${sg{\
                {^^}\
            }
 
-# hcoop-change: Comment out plain authenticator
-#
+# hcoop-change: Comment out plain and login authenticators
+
 # plain:
 #   driver = plaintext
 #   public_name = PLAIN
@@ -248,24 +262,24 @@ PASSWDLINE=${sg{\
 #                  ^${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
 # .endif
 
-login:
-  driver = plaintext
-  public_name = LOGIN
-.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
-  # Return empty string if not non-TLS AND looking up $host in passwd-file
-  # yields a non-empty string; fail otherwise.
-  client_send = "<; ${if and{\
-                          {!eq{$tls_cipher}{}}\
-                          {!eq{PASSWDLINE}{}}\
-                         }\
-                      {}fail}\
-                 ; ${extract{1}{::}{PASSWDLINE}}\
-                ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
-.else
-  # Return empty string if looking up $host in passwd-file yields a
-  # non-empty string; fail otherwise.
-  client_send = "<; ${if !eq{PASSWDLINE}{}\
-                      {}fail}\
-                 ; ${extract{1}{::}{PASSWDLINE}}\
-                ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
-.endif
+login:
+  driver = plaintext
+  public_name = LOGIN
+.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
+  # Return empty string if not non-TLS AND looking up $host in passwd-file
+  # yields a non-empty string; fail otherwise.
+  client_send = "<; ${if and{\
+                          {!eq{$tls_cipher}{}}\
+                          {!eq{PASSWDLINE}{}}\
+                         }\
+                      {}fail}\
+                 ; ${extract{1}{::}{PASSWDLINE}}\
+#               ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
+.else
+  # Return empty string if looking up $host in passwd-file yields a
+  # non-empty string; fail otherwise.
+  client_send = "<; ${if !eq{PASSWDLINE}{}\
+                      {}fail}\
+                 ; ${extract{1}{::}{PASSWDLINE}}\
+#               ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
+.endif