frames/smart.tex
changeset 14 0f80f11be279
parent 12 e3ac4157aae4
child 30 ac1700753eea
equal deleted inserted replaced
13:234207b61f7c 14:0f80f11be279
       
     1 \subsection{Viele Smarthosts}
       
     2 
       
     3 \begin{frame}[<+->][fragile]{Beispiel}{Smarthost - Vorversuche}
       
     4 \begin{block}{Aufgabe}
       
     5 Wir haben mehrere Smarthosts und müssen je nach Sender-Adresse über
       
     6 einen anderen Smarthost versenden.
       
     7 \end{block}
       
     8 \begin{scriptsize}
       
     9 \verbatiminput{smart-config/smarthosts.example}
       
    10 \end{scriptsize}
       
    11 \begin{block}{Lösung}
       
    12 Wir müssen beim Routing die Sender-Adresse als Kriterium verwenden, nicht die Zieladresse!
       
    13 \begin{alltt}
       
    14 	$ exim -be\pause
       
    15 	> $\{lookup\{foo@example.org\}lsearch*@\{smarthosts\}\{$value\}\}
       
    16 	smtp.km21.com             km433221                zecrit\pause
       
    17 	> $\{sg\{smtp.km21.com             km433221 zecrit\}\{\BS\BS{}s+\}\{\BS{}t\}\}
       
    18 	smtp.km21.com	km433221	secrit\pause
       
    19 	> $\{extract\{1\}\{\BS{}t\}\{smtp.km21.com	km433221	secrit\}\}
       
    20 	smtp.km21.com\pause
       
    21 \pause
       
    22 \end{alltt}
       
    23 \end{block}
       
    24 \end{frame}
       
    25 
       
    26 \begin{frame}[<+->][fragile]{Beispiel}{Viele Smarthosts - Config}
       
    27 Das kann jetzt schön in Macros verpackt werden, damit es übersichtlich
       
    28 wird:
       
    29 \begin{verbatim}
       
    30 	ADDRESS_DATA = ${lookup{foo@example.org}\
       
    31 	                        lsearch*@{smarthosts}\
       
    32 	                        {${sg{$value}{\\s+}{\t}}}}
       
    33 	SMARTHOST    = ${extract{1}{\t}{$address_data}}
       
    34 	USER         = ${extract{2}{\t}{$address_data}}
       
    35 	PASS         = ${extract{3}{\t}{$address_data}}
       
    36 \end{verbatim}
       
    37 \end{frame}
       
    38 
       
    39 \begin{frame}[<+->][fragile]{Beispiel}{Viele Smarthosts - Config 2}
       
    40 \begin{small}
       
    41 \begin{verbatim}
       
    42 	begin routers
       
    43 
       
    44 	  smarthosts:
       
    45 	    driver = manualroute
       
    46 	    address_data = ADDRESS_DATA
       
    47 	    route_data = SMARTHOST
       
    48 	    transport = smtpa
       
    49 	    no_more
       
    50 
       
    51 	begin transports
       
    52 
       
    53 	  smtpa:
       
    54 	    driver = smtp
       
    55 	    port = submission
       
    56 	    hosts_require_auth = *
       
    57 
       
    58 	begin authenticators
       
    59 
       
    60 	  plain:
       
    61 	    driver = plaintext
       
    62 	    public_name = PLAIN
       
    63 	    client_send = ^USER^PASS
       
    64 \end{verbatim}
       
    65 \end{small}
       
    66 \end{frame}
       
    67 
       
    68 \begin{frame}[<+->][fragile]{Beispiel}{Viele Smarthosts - Test}
       
    69 Das Routing können wir wieder relativ einfach testen:
       
    70 \pause
       
    71 \begin{alltt}
       
    72 $ exim -f hans@example.com -t nobody@discworld.com
       
    73 nobody@discworld.com
       
    74   router = smarthosts, transport = smtpa
       
    75   host mx.freenet.de [2001:748:100:40::8:112]  port=25
       
    76   host mx.freenet.de [195.4.92.212]            port=25
       
    77 \pause
       
    78 $ exim -f fred@example.com -t …
       
    79 nobody@nowhere
       
    80   router = smarthosts, transport = smtpa
       
    81   host ssl.schlittermann.de [212.80.235.130] 
       
    82 \pause
       
    83 $ exim -f fred@foobar.com -t …
       
    84 nobody@nowhere
       
    85   router = smarthosts, transport = smtpa
       
    86   host smtp.km21.com [54.209.129.218] 
       
    87 \end{alltt}
       
    88 
       
    89 Und natürlich haben wir die ganzen Debug-Optionen noch, für
       
    90 Expansion, DNS, …
       
    91 
       
    92 \end{frame}