[snapshot]
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Thu, 20 Nov 2014 11:48:19 +0100
changeset 3 c12f0d93a45d
parent 2 65780c394ae8
child 4 e5b96f03fc29
[snapshot]
abstract
t/10-foo.t
--- a/abstract	Wed Nov 19 21:41:17 2014 +0100
+++ b/abstract	Thu Nov 20 11:48:19 2014 +0100
@@ -4,7 +4,9 @@
 # Welche Konfiguration wird eingelesen?
 
     > exim -bV | tail -n 1
-    TODO: exim -be '$config_file'
+    TODO: exim -be '$configure_file'
+
+    > exim -bP configure_file
 
 # Wann wird die Konfiguration eingelesen?
 
@@ -104,8 +106,15 @@
       - Whitespace der Felder wird gestrippt
       - leeres Feld in der Mitte: a: :b
       - leeres Felder am Anfang bleibt
+      - "Escapen" des Listentrenners durch Verdoppeln
 
-    > exim -be '${map{<, ,a,b,,, ,c,}{<$item>}}'
+      a : b::c : d -> (a) (b:c) (d)
+
+    > exim -be '${map{:a:b:c,}{<$item>}}'
+    > exim -be '${map{<,,a,b,c,}{<$item>}}'
+
+    > exim -C <(echo domainlist local_domains = 'a:b::c:d') -be '${listnamed:local_domains}'
+
 
 ### Regexp
     Format ^…
@@ -184,6 +193,8 @@
 
     Jeder Listtyp hat seine Eigenarten.
 
+    > exim -bP +<name>
+
 ### domainlist
 
     domainlist - @, @mx_primary, @mx_secondary, @mx_any, <pattern>, lookup, literal
@@ -275,6 +286,136 @@
             - defer   -> Semi-DONE (re-queue)
             - error   -> wie defer
 
+# Hint-Databases
+  
+  liegen in $spool_directory/db
+  - retry
+  - wait-<transport>
+  - callout
+  - ratelimit
+  - misc
+
+  Sind verzichtbar!
+
+## Wartung
+
+### Ansehen
+
+  > exim_dumpdb <spool_dir> <db>
+  eg: exim_dumpdb /var/spool/exim4 
+
+  Je nach DB unterschiedliches Format
+
+### Verändern
+
+  Aufräumen
+  > exim_tidyb <spool_dir> <db> (Cronjob)
+
+  Reparieren
+  > exim_fixdb <spool_dir> <db>
+
+  … that's it …
+
+# Acess Control Lists
+
+    acl_not_smtp       ACL for non-SMTP messages
+    acl_not_smtp_mime  ACL for non-SMTP MIME parts
+    acl_not_smtp_start ACL at start of non-SMTP message
+    acl_smtp_auth      ACL for AUTH
+    acl_smtp_connect   ACL for start of SMTP connection
+    acl_smtp_data      ACL after DATA is complete
+    acl_smtp_data_prdr ACL for each recipient, after DATA is complete
+    acl_smtp_etrn      ACL for ETRN
+    acl_smtp_expn      ACL for EXPN
+    acl_smtp_helo      ACL for HELO or EHLO
+    acl_smtp_mail      ACL for MAIL
+    acl_smtp_mailauth  ACL for the AUTH parameter of MAIL
+    acl_smtp_mime      ACL for content-scanning MIME parts
+    acl_smtp_notquit   ACL for non-QUIT terminations
+    acl_smtp_predata   ACL at start of DATA command
+    acl_smtp_quit      ACL for QUIT
+    acl_smtp_rcpt      ACL for RCPT
+    acl_smtp_starttls  ACL for STARTTLS
+    acl_smtp_vrfy      ACL for VRFY
+
+    acl_<hook> = <aclverb> | <filename> | <acl-name>
+    eg: acl_smtp_rcpt = acl_check_rcpt
+
+## Policies
+
+### acl_smtp_rcpt
+ 
+    Abweisung einzelner Empfänger, noch kein Content!
+
+### acl_smtp_data
+
+    Content-Scan. Nicht mehr für einzelne Empfänger,
+    $local_part, $domain steht nicht mehr zur Verfügung,
+    aber $recpients, $rcpt_count, …
+
+## Return-Values
+
+    - accept
+    - defer
+    - deny
+    - discard
+
+    default: "accept", ausser bei acl_smtp_rcpt, dort ist es "deny"
+    implizit "deny" am Ende jeder ACL!
+
+
+## Test
+
+   > exim -bh <ip>
+   > swaks --pipe 'exim -bh <ip> -C <config>' -f <sender> -t <rcpt>
+
+   exim -N hilft nicht, ist aber nicht für die SMTP acl
+   relevant!
+
+## Format
+
+   <aclverb>    [<condition>]
+                …
+                [<modifier]
+
+   Bedingungen müssen erfüllt sein, Order matters, Abbruch
+   bei nicht erfüllter Bedingung! Modifier sind immer "true"
+
+### Verb
+
+   accept, defer, deny, discard, drop, require, warn
+
+### Modifier
+
+    message = [code] text
+    log_message = text
+
+    Immediate:
+        logwrite = text
+        control = …
+        set = …
+        add_header = …
+        remove_header = …
+
+### Conditions
+
+    <condition> = <value>
+
+        eg: deny  hosts = !192.168.3.8  # neg. Liste
+            deny !hosts = 192.168.3.8   # neg. Resultat
+
+        vs: deny !verify = recipient    # works
+            deny  verify = !recipient   # FALSCH
+
+
+    Wert der Condition und von Modifiern wird expandiert.
+    Force Failure bedeutet: Condition war nicht anwesend!
+
+    Reihenfolge ist wichtig! Short Circuit.
+    Position der Modifier ist wichtig!
+
+
+
 # DNS Lookups
 
 ## DNSSEC
@@ -295,6 +436,7 @@
     - Operators:    /^\$\{<operator>    eg: ${hash:<string>} …
     - Condition:    /^<condition> \{    eg: eq {<string1>}{<string2>} …
     - Functions:    /^\$\{              eg: ${map{<string1>}{<string2>}} …
+    - ACL conditions /^[a-z]
 
 ## Liste globaler Optionen {{{
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/t/10-foo.t	Thu Nov 20 11:48:19 2014 +0100
@@ -0,0 +1,31 @@
+use Test::More;
+use Test::MTA::Exim4;
+use Data::Dumper;
+
+
+my @TESTS = (
+    [
+        'hans@foo.de' => {
+            transport => 'remote_smtp_submission',
+            router    => 'smart_smtp',
+        }
+    ],
+    [
+        'heiko@localhost' => {
+            transport => 'local_delivery',
+            router    => 'localuser',
+        },
+    ],
+);
+
+
+my $exim = Test::MTA::Exim4->new;
+#diag Dumper $exim->_run_exim_bt('hans@localhost');
+
+cmp_ok $exim->exim_version, '>=', 4 => 'Version ok';
+$exim->config_ok;
+
+
+$exim->routes_as_ok(@$_) foreach @TESTS;
+
+done_testing;