{"id":2898,"date":"2023-07-17T18:51:13","date_gmt":"2023-07-17T16:51:13","guid":{"rendered":"http:\/\/fliegerhorst.dyndns.org\/?p=2898"},"modified":"2023-07-21T15:41:44","modified_gmt":"2023-07-21T13:41:44","slug":"postfix-und-imap","status":"publish","type":"post","link":"https:\/\/fliegerhorst.dyndns.org\/index.php\/2023\/07\/17\/postfix-und-imap\/","title":{"rendered":"Postfix und IMAP"},"content":{"rendered":"\n<p>Die Postfix Installation ist so ziemlich die umfangreichste Installation des ganzen Servers. Das ist deshalb so weil die Installation des eigentlichen MTA (MAil Transport Agent) nur sinnvoll mit einem IMAP Server ist mit dem man Emails \u00fcber einen beliebigen Client (Outlook o.\u00e4.) auch abholen oder empfangen kann. Schwierig ist dabei immer die Verbindung des IMAP Servers mit dem MTA. Ich habe eine Anleitung im Netz gefunden die das mit LMTP macht. <br>Eine weitere Schwierigkeit besteht auch darin dass man bei einem privaten Homeserver die Emails leider auch nicht eifach so an einen SMTP Server senden kann, damit der diese dann dem Empf\u00e4nger weiterleiten kann. Das liegt daran dass die Serverbetreiber keine Lust haben eine Spamschleuder zu betreiben. Deshalb gibt es Bezahlserver die das gegen Geld dann doch wieder machen, sogenannte &#8218;Smarthosts&#8216;. Diese nehmen dann oft auch nur eine bestimmt Anzahl Mails pro Tag an, je nachdem wie viel man bezahlt. Fr\u00fcher hat das mal der DynDns-Service von DynDns.org (mit-)gemacht aber dann wurde der Email Teil ausgegliedert und hei\u00dft nun DuoCircle. So kann man doppelt abkassieren: einmal f\u00fcr den DynDns-Service und einmal f\u00fcr die EMails. Bei dem Anbieter kostet das Senden von 200Mails\/Tag 50Eur pro Jahr.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Postfix MTA Installation<\/h2>\n\n\n\n<p>Die Installation von dem MTA ist sehr schnell erledigt. Per Kommandozeile einfach folgendes eingeben:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# apt-get update\n\nroot@fliegerhost:\/# apt-get install postfix<\/pre><\/div>\n\n\n\n<p>Man sollte auch m\u00f6glichst die Installation von der Kommandozeile vornehmen da w\u00e4hrend der Installation ein Auswahldialog aufpoppt wo man folgendes ausw\u00e4hlen mu\u00df:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2021\/11\/grafik-1.png\" alt=\"\" class=\"wp-image-2469\" width=\"295\" height=\"237\"\/><figcaption class=\"wp-element-caption\">Auswahlmen\u00fc &#8211; Postfix Installation<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Hier dann &#8222;Internet with Smarthost&#8220; ausw\u00e4hlen und mit ENTER best\u00e4tigen. Der Smarthost ist der Server der dann &#8211; wie oben schon erw\u00e4hnt &#8211; gesendete EMails entgegen nimmt.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Installation von Mailutils<\/h2>\n\n\n\n<p>Am Besten auch gleich die &#8218;mailutils&#8216; gleich mit installieren. Diese beinhalten unter anderen das Programm &#8218;Sendmail&#8216; das wir zum Testen ben\u00f6tigen.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# apt-get install mailutils<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">1.1&nbsp;&nbsp;&nbsp; Postfix Grundkonfiguration<\/h2>\n\n\n\n<p>Postfix hat im Grunde zwei Konfigurationsdateien:<br><code>1. \/etc\/postfix\/main.cf<br>2. \/etc\/postfix\/master.cf<\/code><\/p>\n\n\n\n<p>Als erstes passen wir die Datei <code>\/etc\/postfix\/main.cf<\/code> folgenderma\u00dfen an:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># The domain and all hosts where postfix try to deliver emails locally\n# !! Alle anderen EMails werden versucht weiter zu leiten !!\n#\n# ACHTUNG!! : Eintr\u00e4ge in 'virtual_mailbox_domains' d\u00fcrfen hier nicht\n# noch einmal auftauchen.\nmydestination = localhost<\/pre><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Diese Einstellung definiert wohin Postfix eingehende Mails weiterleiten soll. Da wir ja nur EMails empfangen, die f\u00fcr den Server selbst bestimmt sind, tragen wir hier nur <code>localhost<\/code> ein. Diese Einstellung ist extrem wichtig da man so ganz leicht versehentlkich ein EMail Relay bauen kann. EMail Relays sind im Grunde Spam Schleudern die EMails einfach wieder &#8222;nach drau\u00dfen&#8220; leiten die nicht f\u00fcr den Server selbst bestimmt sind. Deshalb hier nur <code>localhost<\/code> eintragen. <\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># Trust email from this networks without any checks.\n# The parameter smtp_relay_restrictions will be skipped for this network(s)\nmynetworks = 192.168.2.0\/24 127.0.0.0\/8<\/pre><\/div>\n\n\n\n<p><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Das ist so ziemlich die zweitwichtigste Einstellung des MTA: Hier werden nur EMails vom Subnetz <code>192.168.2.0\/24<\/code> und nat\u00fcrlich auch von <code>localhost (127.0.0.1)<\/code> <span class=\"has-inline-color has-vivid-red-color\"><strong>ohne irgendwelche Checks<\/strong><\/span> akzeptiert. Das hei\u00dft umgekehrt: EMails, die von einer anderen IP-Adresse als den angegebenen hereinkommen, m\u00fcssen noch bestimmte Checks bestehen um akzeptiert zu werden.<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># The internet domain name of this mail system.\nmydomain = fliegerhorst.dyndns.org\n\n# The name of this host\n# Im Grunde ist das der Hostname zusammen mit der Domain\nmyhostname = Fliegerhost.$mydomain\n\n# Das ist die Domain hinter dem &quot;@&quot; einer Email Adresse.\n# Dadurch wird eine EMail an einen Systembenutzer um die Domain erweitert.\n# Beispiel: myorign = domain.com --&gt; Mail an &quot;Hans&quot; wird expandiert zu &quot;Hans@domain.com&quot;\nmyorigin = $mydomain<\/pre><\/div>\n\n\n\n<p><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Als n\u00e4chstes folgen die Namensanteile des MTA auf die der Server bei eigehenden EMails h\u00f6ren soll.  Die Domain, in der der Server l\u00e4uft, hei\u00dft ja <code>fliegerhorst.dyndns.org<\/code> und wir tragen das so in <code>mydomain<\/code> ein. Und der Name des Servers selbst hei\u00dft <code>Fliegerhost<\/code>. Im Grunde wird der volle Name des Servers aus <code>myhostname@mydomain<\/code> zusammen gesetzt.<\/p>\n\n\n\n<p>Dann gibt es noch einen speziellen Namen &#8211; <code>myorigin <\/code>&#8211; der immer dem Absendenamen von EMails die von diesem Server ausgehen hinten an gestellt werden wenn die Absenderadresse keine Domain enth\u00e4lt.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p>Editor nun verlassen und Postfix neu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service postfix restart<\/pre><\/div>\n\n\n\n<h6 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">Test<\/mark> der Grundkonfiguration<\/strong><\/h6>\n\n\n\n<p>Mit exit zum Login user wechseln falls Ihr jetzt mit dem root user arbeitet. Falls Ihr Euch mit dem root user angemeldet habt dann bitte mit einem anderen user anmelden.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"213\" height=\"65\" src=\"http:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2021\/11\/grafik-2.png\" alt=\"\" class=\"wp-image-2483\"\/><figcaption class=\"wp-element-caption\">Aufruf &#8218;Mail&#8216; Programm<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Programm &#8218;mail&#8216; aufrufen und alle Mails mit d * l\u00f6schen und anschliessend mail mit q verlassen.<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"390\" height=\"65\" src=\"http:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2021\/11\/grafik-3.png\" alt=\"\" class=\"wp-image-2484\" srcset=\"https:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2021\/11\/grafik-3.png 390w, https:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2021\/11\/grafik-3-300x50.png 300w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Email von einem externen Email account an den user senden mit dem man sich anmeldet. Es erscheint eine Nachricht wenn die mail eintrifft.<\/p>\n\n\n\n<p>Mit mail kann man nun pr\u00fcfen ob dies die EMail ist die man vom externen Account gesendet hat. Man kann die Mail dann wieder mit &#8218;d *&#8216; l\u00f6schen und das Programm mit &#8218;q&#8216; verlassen.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p>Auf Seite 2 geht es dann mit der Einrichtung des Mail-Relays weiter&#8230;<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<h2 class=\"wp-block-heading\">1.2 Mail Relay einrichten (Smarthost)<\/h2>\n\n\n\n<p>Jetzt wird die Verbindung zu dem weiter oben schon genannten Smarthost f\u00fcr ausgehende Mails eingerichtet. Bei dem Smarthost-Anbieter hat man sich mit einem Usernamen und einem Passwort identifiziert. Genau diese &#8222;User&#8220;\/&#8220;Passwort&#8220;-Kombination wird im fogenden Abschnitt gebraucht. Sonst nimmt der Smarthost keine Mails an.<\/p>\n\n\n\n<p><strong>1.2.1 SASL-Lib installieren<\/strong><br>Als erstes mu\u00df man die<strong> sasl2 (Simple Authoritation and Security Layer 2) <\/strong>Library installieren.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# apt-get install libsasl2-modules<\/pre><\/div>\n\n\n\n<p>Dies sasl2 Bibliothek ben\u00f6tigt dann die Passwortdatei in <code>\/etcpostfix\/sasl_passwd<\/code>. Wir legen also eine solche Datei mit folgendem Inhalt an:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">[outbound.mailhop.org]:25 user:password<\/pre><\/div>\n\n\n\n<p>Als &#8222;user&#8220;\/&#8220;Password&#8220;-Kombination dann also die nehmen bei der man sich bei dem Smarthost-Anbieter angemeldet hat (und auch Geld daf\u00fcr bezahlt).<\/p>\n\n\n\n<p>Mit dem Befehl <kbd>postmap<\/kbd> wird dann eine verschl\u00fcsselte Datenbank angelegt (Datei <code>\/etc\/postfix\/sasl_passwd.db<\/code>), die dann zur Autentifizierung dient. Deshalb bei jeder \u00c4nderung der Datei <code>\/etc\/postfix\/sasl_passwd<\/code> nicht vergessen den <kbd>postmap<\/kbd> Befehl erneut aufzurufen.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# postmap \/etc\/postfix\/sasl_passwd\nroot@fliegerhost:\/# chown root:root \/etc\/postfix\/sasl_passwd \/etc\/postfix\/sasl_passwd.db\nroot@fliegerhost:\/# chmod 0600 \/etc\/postfix\/sasl_passwd \/etc\/postfix\/sasl_passwd.db<\/pre><\/div>\n\n\n\n<p><strong>1.2.2 &#8218;main.cf&#8216; \u00e4ndern<\/strong><br>Die Datei \/etc\/postfix\/main.cf ist eine der beiden Konfigurationsdateien von Postfix. In dieser Datei wird folgender Abschnitt eingetragen:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># --------------------------------------------------------------------------\n#                           MAIL RELAY\n# Specifies the server the so called relay host\n# i.e. &quot;outbound.mailhop.org&quot; is the mail relay of DouCircle\n# Unbedingt die eckigen Klammern und die Port Nummer nicht vergessen\nrelayhost = [outbound.mailhop.org]:25\n\n# erlaube sasl authentication f\u00fcr ausgehende Mails\nsmtp_sasl_auth_enable = yes\n\n# Verhindere anonyme Authentifizierung\nsmtp_sasl_security_options = noanonymous\n\n# Wo\/In welcher Datei ist das SASL-Passwort\n# Dateiangabe ohne Dateiendung (.db) !!\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd\n\n# schalte TLS ein f\u00fcr ausgehende Nachrichten\n# 'yes' bedeutet hier dass TLS m\u00f6glich ist, aber kein mu\u00df (Zwang w\u00e4re 'smtp_enforce_tls=yes')\n# Parameter ist veraltet und sollte gegen 'smtp_tls_security_level' ausgetauscht werden\nsmtp_use_tls = yes\n\n# Wo\/In welcher Datei befinden sich die CA Zertifikate f\u00fcr das TLS Handshaking\nsmtp_tls_CAfile = \/etc\/ssl\/certs\/ca-certificates.crt<\/pre><\/div>\n\n\n\n<p>Falls einige der Schl\u00fcsselw\u00f6rter bereitsvorhanden sind m\u00fcssen diese zusammen mit dem Inhalt entsprechend ausgetauscht werden. Jedes Schl\u00fcsselwort sollte nur einmal vorhanden sein.<\/p>\n\n\n\n<p>Zum Schlu\u00df nicht vergessen: Bei jeder \u00c4nderung der Konfigurationsdateien mu\u00df Postfix neu gestartet werden damit die neu eingestellte Konfiguration auch \u00fcbernommen wird. Daher rufen wir noch einmal auf:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service postfix restart<\/pre><\/div>\n\n\n\n<p><strong>Test<\/strong><br>Jetzt ist es wieder an der Zeit f\u00fcr einen kleinen Test. Dazu versuchen wir eine Mail \u00fcber den Smarthost zu versenden. Das geht ganz einfach mit dem Befehl <kbd>mail<\/kbd> folgenderma\u00dfen:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# echo &quot;body of your email&quot; | mail -s &quot;This is a subject&quot; -a &quot;From: you@example.com&quot; recipient@elsewhere.com<\/pre><\/div>\n\n\n\n<p>Die Absenderadresse und die Empf\u00e4ngeradresse sind dabei entsprechend zu \u00e4ndern. Als Empf\u00e4ngeradresse am besten einen externen Mailaccount w\u00e4hlen (Arbeit o.\u00e4.) um zu sehen dass die Mail auch tats\u00e4chlich \u00fcber den Smarthost Relay Server gesendet wird.<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<h2 class=\"wp-block-heading\">1.3 Der IMAP-Server \/ Dovecot Installation<\/h2>\n\n\n\n<p>Im letzten Abschnitt haben wir die Grundkonfiguration von Postfix abgeschlossen. Wir k\u00f6nnennun EMails senden und empfangen und eigentlich haben wir nun schon alles was wir brauchen. Der Nachteil ist nur dass wir von der Kommandozeile aus EMails, empfangen, lesen, schreiben und auch absenden m\u00fcssen was nat\u00fcrlich sehr umst\u00e4ndlich ist. Wir m\u00f6chten daher lieber auf Mail-Client Programme wie z.B. Outlook nicht verzichten. Moderne EMail Clients reden meistens \u00fcber die sogenannte IMAP-Schnittstelle mit dem Server. Etwas \u00e4lter ist die POP3 Schnittstelle die heute nicht mehr so gebr\u00e4uchlich ist.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1.3.1 Dovecot Grundconfiguration<\/h3>\n\n\n\n<p>Dovecot ist in den DebianRepositories enthalten und wenn die Repositories richtig eingerichtet sind, dann wird Dovecot so installiert (wobei man pop3 nicht unbedingt ben\u00f6tigt wenn man es nicht braucht):<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# apt-get install dovecot-core dovecot-imapd dovecot-pop3d<\/pre><\/div>\n\n\n\n<p><strong>1.3.1.1 Festlegung der Logging Datei<\/strong><br>In der Datei <kbd>\/etc\/dovecot\/conf.d\/10-logging.conf<\/kbd> kann man die Datei f\u00fcr die Log-Eintr\u00e4ge festlegen.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">##\n## Log destination.\n##\n\n# Log file to use for error messages. &quot;syslog&quot; logs to syslog,\n# \/dev\/stderr logs to stderr.\nlog_path = \/var\/log\/mail.log\n:\n:<\/pre><\/div>\n\n\n\n<p><strong>1.3.1.1 Standard Mailausgabeformat<\/strong><br>Nach der Installation von Postfix unterst\u00fctzt Postfix standardm\u00e4ssig das sogenannte <code>mbox<\/code> Mailausgabeformat. Dieses m\u00fcssen wird nun in Dovecot konfigurieren. Die entsprechende Konfigurationsdatei lautet <kbd>\/etc\/dovecot\/conf.d\/10-mail.conf<\/kbd>.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># Location for users' mailboxes. The default is empty, which means that Dovecot\n# tries to find the mailboxes automatically. This won't work if the user\n# doesn't yet have any mail, so you should explicitly tell Dovecot the full\n# location.\n#\n# If you're using mbox, giving a path to the INBOX file (eg. \/var\/mail\/%u)\n# isn't enough. You'll also need to tell Dovecot where the other mailboxes are\n# kept. This is called the &quot;root mail directory&quot;, and it must be the first\n# path given in the mail_location setting.\n#\n# There are a few special variables you can use, eg.:\n#\n#   %u - username\n#   %n - user part in user@domain, same as %u if there's no domain\n#   %d - domain part in user@domain, empty if there's no domain\n#   %h - home directory\n#\n# See doc\/wiki\/Variables.txt for full list. Some examples:\n#\n#   mail_location = maildir:~\/Maildir\n#   mail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u\n#   mail_location = mbox:\/var\/mail\/%d\/%1n\/%n:INDEX=\/var\/indexes\/%d\/%1n\/%n\n#\n# &lt;doc\/wiki\/MailLocation.txt&gt;\n#\nmail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u\n\n# Group to enable temporarily for privileged operations. Currently this is\n# used only with INBOX when either its initial creation or dotlocking fails.\n# Typically this is set to &quot;mail&quot; to give access to \/var\/mail.\nmail_privileged_group = mail<\/pre><\/div>\n\n\n\n<p><strong>1.3.1.2 Abstellen aller Klartext Autentifizierungen<\/strong><br>In der Datei <kbd>\/etc\/dovecot\/conf.d\/10-auth.conf<\/kbd> stellen wir Logins im Klartextformat ab:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\"># Disable LOGIN command and all other plaintext authentications unless\n# SSL\/TLS is used (LOGINDISABLED capability). Note that if the remote IP\n# matches the local IP (ie. you're connecting from the same computer), the\n# connection is considered secure and plaintext authentication is allowed.\n# See also ssl=required setting.\ndisable_plaintext_auth = no<\/pre><\/div>\n\n\n\n<p><strong>1.3.1.3 Konfigurieren von PAM f\u00fcr Dovecot<\/strong><br>Dovecot authentifiziert seine Clients standardm\u00e4ssig per PAM (Pluggable Authentication Modules). Dovecot hat bei der Installation eine Datei <kbd>\/etc\/pam.d\/dovecot<\/kbd> angelegt die die Autentifizierungsmethode entsprechend konfiguriert. Das PAM-Modul mu\u00df f\u00fcr Dovecot in der Datei folgenderma\u00dfen konfiguriert werden:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">#%PAM-1.0\n\n#@include common-auth\n#@include common-account\n#@include common-session\n\nauth    required pam_unix.so nullok\naccount required pam_unix.so<\/pre><\/div>\n\n\n\n<p>Es ist sehr wichtig auch die Includes auszukommetieren wie oben dargestellt.<\/p>\n\n\n\n<p>Wie bei Postfix gilt auch hier bei Dovecot da\u00df man bei jeder Konfigurations\u00e4nderung Dovecot neu starten mu\u00df:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service dovecot restart<\/pre><\/div>\n\n\n\n<p><strong>Test: Anmeldung am IMAP-Server mit einem Client<\/strong><br>F\u00fcr diesen Test bitte sicherstellen dass IMAP Pakete nicht in der Firewall gefiltert werden. Wir hatten zu diesem Zweck den IMAP Port bereits freigeschaltet. <br>Um sich bei dem IMAP-Server anmelden zu k\u00f6nnen ben\u00f6tigen wir einen telnet Client auf einen anderen Rechner in demselben Subnetz. Unter der Annahme dass wir einen Windows-Rechner als Telnet-Client benutzen, geben wir nun folgendes ein: (bei &#8222;a1 login username passwort&#8220; nat\u00fcrlich den echten Nutzernamen und das Passwort eingeben)<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">C:\\Users\\Nutzername&gt; telnet fliegerhorst imap\n\n* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN] Dovecot (Debian) ready.\na1 login username passwort\na1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY LITERAL+ NOTIFY SPECIAL-USE] Logged in\na1 logout\n* BYE Logging out\na1 OK Logout completed (0.001 + 3.218 + 3.217 secs).\n\nVerbindung zu Host verloren.\n\nC:\\Users\\Nutzername&gt;<\/pre><\/div>\n\n\n\n<!--nextpage-->\n\n\n\n<h3 class=\"wp-block-heading\">1.3.2 Virtuelle Nutzer und Gruppen f\u00fcr f\u00fcr Dovecot und Postfix einrichten<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1.3.2.1 Virtuelle Nutzer f\u00fcr Postfix einrichten<\/h4>\n\n\n\n<p><em>Erkl\u00e4rung:<\/em> Jeder Nutzer hat auf dem Server ein eigenes Verzeichnis in dem dessen EMails gespeichert sind. Es mu\u00df eine Datei erstellt werden die im Grunde die Schreibweise <code>\"&lt;Nutzer&gt;@&lt;Servername&gt;.&lt;Domainname&gt;.de\"<\/code> in <code>\"&lt;Servername&gt;.&lt;Domainname&gt;.de\/&lt;Nutzer&gt;\"<\/code>. Die Datei wird im Ordner <code>etc\/postfix<\/code> erstellt.<br><br>Wir erstellen dort die Datei <code>\/etc\/postfix\/virtual_users_list<\/code>.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@Fliegerhost:\/etc\/postfix# touch virtual_users_list<\/pre><\/div>\n\n\n\n<p>Die Datei hat folgendes Format: (dabei nat\u00fcrlich <kbd>&lt;Nutzer&gt;<\/kbd> durch den echten <kbd>Nutzer<\/kbd> ersetzen)<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhorst.dyndns.org   fliegerhorst.dyndns.org\/root\/\nroot@Fliegerhost.fliegerhorst.dyndns.org   fliegerhorst.dyndns.org\/root\/\n&lt;Nutzer&gt;@fliegerhorst.dyndns.org   fliegerhorst.dyndns.org\/&lt;Nutzer&gt;\/\n&lt;Nutzer&gt;@Fliegerhost.fliegerhorst.dyndns.org   fliegerhorst.dyndns.org\/&lt;Nutzer&gt;\/<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">1.3.2.2 Nutzerpasswort f\u00fcr das IMAP-Login vergeben<\/h4>\n\n\n\n<p>Jeder Nutzer mu\u00df ein PAsswort haben mit dem dieser sich am IMAP-Server einlaggen kann. Die entsprechende Passwortdatei mu\u00df im Verzeichnis <code>\/etc\/dovecot\/users<\/code> angelegt werden. Der Inhalt der Datei hat folgendes Format (hier auch unbedingt das <code>{Plain}<\/code> genauso hinschreiben):<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhorst.dyndns.org:{Plain}passwort\n&lt;Nutzer&gt;@fliegerhorst.dyndns.org:{Plain}passwort<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">1.3.2.3 LOCALHOST als Auslieferungspfad setzen<\/h4>\n\n\n\n<p>Als n\u00e4chstes weisen wir Postfix an EMAils nur auf den lokalen Server auszuliefern. Das macht man mit dem Parameter <code>mydestination<\/code> in der Postfix-Konfigurationsdatei <code>\/etc\/postfix\/main.cf<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">mydestination = localhost<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">1.3.2.4 Pfade zu den virtuellen Postf\u00e4cher f\u00fcr Postfix festlegen<\/h4>\n\n\n\n<p>Postfix mu\u00df nat\u00fcrlich auch noch wissen wo es die Pfade findet in denen die EMails der Nutzer einsortiert werden m\u00fcssen. Auch diese Einstellung findet man in der Datei \/etc\/postfix\/main.cf:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">#Virtual domains\nvirtual_mailbox_domains = $myorigin, $myhostname, localhost.$myorigin\nvirtual_mailbox_base = \/var\/mail\/vhosts\nvirtual_mailbox_maps = hash:\/etc\/postfix\/virtual_users_list\nvirtual_minimum_uid = 100\nvirtual_uid_maps = static:5000\nvirtual_gid_maps = static:5000<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">1.3.2.5 Liste der virtuellen User an Postfix \u00fcbergeben<\/h4>\n\n\n\n<p>Die Liste der Nutzer die wir im Kapitel 1.3.2.1 erstellt haben m\u00fcssen nun ebenfalls Postfix bekannt gemacht werden. Dazu dient der Befehl <code>postmap<\/code>. Er wird wie folgt aufgerufen:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# postmap \/etc\/postfix\/virtual_users_list<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">1.3.2.6 Neuen Nutzer &#8218;vmail&#8216; anlegen, Verzeichnis erstellen und Rechte apassen<\/h4>\n\n\n\n<p>F\u00fcr die Verwaltung der virtuellen Nutzer ben\u00f6tigt Postfix den Nutzer vmail. Dieser mu\u00df manuell eingerichtet werden:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# groupadd -g 5000 vmail\nroot@fliegerhost:\/# useradd -g vmail -u 5000 vmail -d \/var\/mail<\/pre><\/div>\n\n\n\n<p>Und nat\u00fcrlich m\u00fcssen die virtuellen Verzeichnisse f\u00fcr jeden einzelnen Nutzer ebenfalls manuell angelegt werden und die Rechte entsprechend angepasst werden:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# mkdir \/var\/mail\nroot@fliegerhost:\/# mkdir \/var\/mail\/vhosts\nroot@fliegerhost:\/# mkdir \/var\/mail\/vhosts\/fliegerhorst.dyndns.org\/\nroot@fliegerhost:\/# mkdir \/var\/mail\/vhosts\/fliegerhorst.dyndns.org\/Nutzer1 \nroot@fliegerhost:\/# mkdir \/var\/mail\/vhosts\/fliegerhorst.dyndns.org\/Nutzer2 \nroot@fliegerhost:\/# chown -R vmail:vmail \/var\/mail<\/pre><\/div>\n\n\n\n<p>Jetzt postfix neu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service postfix restart<\/pre><\/div>\n\n\n\n<p><strong>Test: Hat Postfix die EMails virtuell zugestellt<\/strong> ?<br>Hierzu einfach eine EMail von einem externen EMail Account an den Server senden. Die Mail mu\u00df in das richtige Postfach zugestellt werden. Au\u00dferdem bitte einmal pr\u00fcfen ob auch tats\u00e4chlich <code>'relay=virtual'<\/code> beim Empfang der EMail gesetzt wurde. Das sieht man wenn man sich den entsprechenden Eintrag f\u00fcr die empfangene EMail im postfix Log-File in der Datei <code>\/var\/log\/mail.log<\/code> anschaut.<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<h2 class=\"wp-block-heading\">1.3.3 Userformat an Dovecot \u00fcbergeben<\/h2>\n\n\n\n<p>Nachdem wir Postfix gesagt haben dass wir die EMails in virtuelle Postf\u00e4cher zugestellt bekommen wollen und Postfix auch mitgeteilt haben wo sich die Ordner daf\u00fcr befinden und welche Nutzer das genau sind, mu\u00df das genauso nocheinmal f\u00fcr die andere Seite getan werden, f\u00fcr Dovecot. Dazu m\u00fcssen wir das Dovecot Konfigurationsfile anpassen welches f\u00fcr die EMails zust\u00e4ndig ist <code>\/etc\/dovecot\/conf.d\/10-mail.conf<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">mail_location = maildir:\/var\/mail\/vhosts\/%d\/%n<\/pre><\/div>\n\n\n\n<p>Auch die Art und Weise der Authentifizierung mu\u00df entsprechend angepasst werden:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">passdb {\n  driver = passwd-file\n  args = username_format=%u \/etc\/dovecot\/users\n}\nuserdb {\n  driver = static\n  args = uid=vmail gid=vmail home=\/var\/mail\/vhosts\/%d\/%n\n}<\/pre><\/div>\n\n\n\n<p>Nun m\u00fcssen wir Dovecot noch sagen nach welchem Schema die Passw\u00f6rter verschl\u00fcsselt sind:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">#!include auth-system.conf.ext\n!include auth-passwdfile.conf.ext<\/pre><\/div>\n\n\n\n<p>Zum Schlu\u00df nicht vergessen Dovecot neu zu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service dovecot restart<\/pre><\/div>\n\n\n\n<p><strong>Test: Anmeldung an Dovecot und INBOX checken<\/strong><br>F\u00fcr diesen Test senden wir wieder eine EMail von einem externen Account zu unserem Server. Wir schauen dann ob die INBOX von Dovecot diese EMail enth\u00e4lt. Ausgehend davon dass wir unseren Telnet Client von unserem Windows PC nutzen geben wir folgendes ein (von dem Windows PC ist der Server momentan leider nur \u00fcber seine IP-Adresse erreichbar): <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">C:\\Users\\Nutzername&gt; telnet 192.168.2.1 imap\n\n* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN] Dovecot (Debian) ready.\na1 Login scotty@fliegerhorst.dyndns.org password\na1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY STATUS=SIZE SAVEDATE LITERAL+ NOTIFY SPECIAL-USE] Logged in\na2 list &quot;&quot; &quot;*&quot;\n* LIST (\\HasNoChildren) &quot;.&quot; INBOX\na2 OK List completed (0.005 + 8.920 + 8.923 secs).\na3 examine INBOX\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft $Forwarded Junk)\n* OK [PERMANENTFLAGS ()] Read-only mailbox.\n* 65 EXISTS\n* 1 RECENT\n* OK [UNSEEN 65] First unseen.\n* OK [UIDVALIDITY 1612115650] UIDs valid\n* OK [UIDNEXT 5862] Predicted next UID\n* OK [HIGHESTMODSEQ 17786] Highest\na3 OK [READ-ONLY] Examine completed (0.005 + 9.386 + 9.390 secs).\na4 fetch 1 body[]\n* 1 FETCH (BODY ((&quot;text&quot; &quot;plain&quot; (&quot;charset&quot; &quot;UTF-8&quot;) NIL NIL &quot;8bit&quot; 1274 30)(&quot;text&quot; &quot;html&quot; (&quot;boundary&quot; &quot;mimepart_5e5c86fb26ce8_566a311c79dc44a&quot; &quot;charset&quot; &quot;UTF-8&quot;) NIL NIL &quot;quoted-printable&quot; 3049 89) &quot;alternative&quot;))\na4 OK Fetch completed (0.006 + 7.474 + 0.005 secs).\na5 logout\n* BYE Logging out\na5 OK Logout completed (0.001 + 4.363 + 4.362 secs).\n\n\nVerbindung zu Host verloren.\n\nC:\\Users\\Nutzername&gt;<\/pre><\/div>\n\n\n\n<p>Wie man sieht braucht man gar keinen IMAP Client, denn mit Telnet geht das ganz wunderbar wenn man die IMAP Kommandos kennt. Nein, kleiner Scherz&#8230;. Aber hier noch eine kleine Befehlsreferenz f\u00fcr einen IMAP Server:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>User anmelden: <code>a1 login name@eigener-server.de passwort123<\/code><\/li>\n\n\n\n<li>Postf\u00e4cher ansehen mit <code>a2 list&nbsp;\"\" \"*\"<\/code><\/li>\n\n\n\n<li>Zum Postfach wechseln: <code>a3 examine inbox<\/code><\/li>\n\n\n\n<li>Email ansehen: <code>a4 fetch 1 body[]<\/code><\/li>\n\n\n\n<li>abmelden mit <code>a5 logout<\/code><\/li>\n<\/ul>\n\n\n\n<!--nextpage-->\n\n\n\n<h2 class=\"wp-block-heading\">1.4 Dovecot mit Postfix \u00fcber LMTP verbinden<\/h2>\n\n\n\n<p>Das was jetzt kommt ist eigentlich optional aber es ist sinnvoll Dovecot und Postfix \u00fcber einen Unix Socket anzubinden. Das ist sicherer und auch schneller. LMTP ist von SMTP abgeleitet und ist im Prinzip ein etwas vereinfachtes &#8218;Mail Transfer Protocol&#8216;. Aber eben nicht mehr &#8218;Simple&#8216; sondern &#8218;Light&#8216;. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1.4.1 Dovecot \u00c4nderungen f\u00fcr LMTP Unterst\u00fctzung<\/h4>\n\n\n\n<p>a) Zun\u00e4chst mu\u00df die LMTP-Erweiterung f\u00fcr Dovecot installiert werden:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# apt-get install dovecot-lmtpd<\/pre><\/div>\n\n\n\n<p>b) Die Datei <code>\/etc\/dovecot\/dovecot.conf<\/code> mu\u00df hinter dem Eintrag <code>!include_try \/usr\/share\/dovecot\/protocols.d\/*.protocol<\/code> folgenderma\u00dfen erweitert werden:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">!include_try \/usr\/share\/dovecot\/protocols.d\/*.protocol\nprotocols = imap lmtp<\/pre><\/div>\n\n\n\n<p>c) Als n\u00e4chstes m\u00fcssen wir in der Datei den UNIX-Socket f\u00fcr den LMTP Service korrekt definieren:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">service lmtp {\n unix_listener \/var\/spool\/postfix\/private\/dovecot-lmtp {\n   mode = 0600\n   user = postfix\n   group = postfix\n  }\n  # Create inet listener only if you can't use the above UNIX socket\n  #inet_listener lmtp {\n    # Avoid making LMTP visible for the entire internet\n    #address =\n    #port =\n  #}\n}<\/pre><\/div>\n\n\n\n<p>Hier wirklich darauf achten dass die hier auskommentierten Zeilen auch tats\u00e4chlich auskommentiert werden.<\/p>\n\n\n\n<p>Anschlie\u00dfend den Dovecot neu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service dovecot restart<\/pre><\/div>\n\n\n\n<p><strong>Test:<\/strong> <strong>Pr\u00fcfe ob der UNIX-Socket <code>\/var\/spool\/postfix\/private\/dovecot-lmtp<\/code> existiert.<\/strong> <br>Dieser sollte auch nur f\u00fcr den Nutzer <code>postfix<\/code> entsprechende Rechte besitzen.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1.4.2 Postfix \u00c4nderungen f\u00fcr LMTP Unterst\u00fctzung<\/h4>\n\n\n\n<p>Nun m\u00fcssen wir noch Postfix sagen dass wir die EMails per LMPT zum IMAP Server schieben wollen. Dazu m\u00fcssen wir am Ende der Datei <code>\/etc\/postfix\/main.cf<\/code> folgende Zeile anf\u00fcgen:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">virtual_transport = lmtp:unix:private\/dovecot-lmtp<\/pre><\/div>\n\n\n\n<p>Und auch hier nicht vergessen postfix neu zu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service postfix restart<\/pre><\/div>\n\n\n\n<p><strong>Test: Anmeldung an Dovecot und INBOX checken<\/strong><br>Jetzt wiederholen wir einfach nochmal den Test aus dem Kapitel 1.3.3.. Alles mu\u00df genauso wieder funktionieren wie vorher. Wir k\u00f6nnen ruhig ein paar externe EMails mehr schicken und schauen wie viele EMails in der INBOX sind (<code>a1 examine INBOX<\/code>) und auch mal die letzte oder eine bestimmte EMail anzeigen (<code>a2 fetch 3 body[]<\/code>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.5 EMails versenden \u00fcber Dovecot<\/h2>\n\n\n\n<p>In den vorherigen Kapiteln haben wir alles f\u00fcr die Empfangsrichtung fertig gestellt. Aber das ist ja nur die halbe Miete. Jetzt kommt die Senderichtung denn wir wollen ja auch selbst EMails verschicken k\u00f6nnen.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1.5.1 Dovecot \u00c4nderungen um EMails an Postfix zu senden<\/h4>\n\n\n\n<p>Zun\u00e4chst passen wir den Authentication Service f\u00fcr Dovecot an. Wir wollen nur eingeschr\u00e4nkten Zugriff <code>0600<\/code> f\u00fcr den Nutzer <code>vmail<\/code> der den UNIX-Socket <code>\/var\/spool\/postfix\/private\/auth<\/code> nutzt. Auch hier unbedingt wieder die alten Eintr\u00e4ge auskommentieren.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">service auth {\n  unix_listener auth-userdb {\n    mode = 0600\n    user = vmail\n    #group =\n  }\n\n  unix_listener \/var\/spool\/postfix\/private\/auth {\n    mode = 0666\n    user = postfix\n    group = postfix\n  }\n\n  # Postfix smtp-auth\n  #unix_listener \/var\/spool\/postfix\/private\/auth {\n  #  mode = 0666\n  #}\n\n  # Auth process is run as this user.\n  #user = $default_internal_user\n}<\/pre><\/div>\n\n\n\n<p>In derselben Datei mu\u00df noch der korrekte Nutzer vmail f\u00fcr den Authentication Worker angepasst werden. Hier entfernen wir das <code>#<\/code> und \u00e4ndern den Nutzer in <code>vmail<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">service auth-worker {\n  # Auth worker process is run as root by default, so that it can access\n  # \/etc\/shadow. If this isn't necessary, the user should be changed to\n  # $default_internal_user.\n  user = vmail\n}<\/pre><\/div>\n\n\n\n<p>Zum Abschlu\u00df Dovecot wieder neu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service dovecot restart<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">1.5.2 Postfix \u00c4nderungen um Emails von Dovecot entgegen zu nehmen<\/h4>\n\n\n\n<p>Bei Postfix ist das wieder einfacher denn hier sind nur drei Zeilen der Datei \/etc\/postfix\/main.cf hinzu zu f\u00fcgen:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">smtpd_sasl_type = dovecot\nsmtpd_sasl_path = private\/auth\nsmtpd_sasl_auth_enable = yes<\/pre><\/div>\n\n\n\n<p>Das war es dann auch schon. Wir vergessen zum Schlu\u00df auch nicht Postfix neu zu starten:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;liquibyte&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">root@fliegerhost:\/# service postfix restart<\/pre><\/div>\n\n\n\n<p><strong>Test: Der Empfang externer EMails mu\u00df immer noch funktionieren<\/strong><br>Jetzt wiederholen wir einfach nochmal den Test aus dem Kapitel 1.3.3.. Alles mu\u00df genauso wieder funktionieren wie vorher. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.6 Client Konfiguration (MS Outlook)<\/h2>\n\n\n\n<p>Die Konfiguration am Beispiel des Clients MS Outlook k\u00f6nnte folgenderma\u00dfen aussehen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"427\" src=\"http:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2023\/02\/grafik-1.png\" alt=\"\" class=\"wp-image-2567\" srcset=\"https:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2023\/02\/grafik-1.png 353w, https:\/\/fliegerhorst.dyndns.org\/wp-content\/uploads\/2023\/02\/grafik-1-248x300.png 248w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Die Postfix Installation ist so ziemlich die umfangreichste Installation des ganzen Servers. Das ist deshalb so weil die Installation des eigentlichen MTA (MAil Transport Agent) nur sinnvoll mit einem IMAP Server ist mit dem man Emails \u00fcber einen beliebigen Client (Outlook o.\u00e4.) auch abholen oder empfangen kann. Schwierig ist dabei immer die Verbindung des IMAP[&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3033,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_general_container_width":0,"zakra_general_content_width":0,"zakra_general_sidebar_width":0,"zakra_sticky_header":"customizer","zakra_header_main_area":true,"zakra_site_logo_width":0,"zakra_header_top_enabled":"customizer","zakra_header_top_style":"customizer","zakra_primary_menu_item_style":"customizer","zakra_page_header_text_color":"","zakra_page_header_layout":"customizer","zakra_page_title_bg":"","zakra_footer_widgets_bg_image":0,"zakra_page_title_bg_repeat":"customizer","zakra_page_title_bg_position":"customizer","zakra_page_title_bg_size":"customizer","zakra_page_title_bg_attachment":"customizer","zakra_breadcrumbs_enabled":"customizer","zakra_breadcrumbs_text_color":"","zakra_breadcrumbs_separator_color":"","zakra_breadcrumbs_link_color":"","zakra_breadcrumbs_link_hover_color":"","zakra_page_title_bg_image":0,"zakra_footer_widgets_enabled":"customizer","zakra_footer_column_layout_1_style":"customizer","zakra_footer_widgets_bg":"","zakra_footer_widgets_bg_repeat":"customizer","zakra_footer_widgets_bg_position":"customizer","zakra_footer_widgets_bg_size":"customizer","zakra_footer_widgets_bg_attachment":"customizer","zakra_footer_bar_enabled":"customizer","zakra_footer_bar_style":"customizer","zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[13],"class_list":["post-2898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux"],"_links":{"self":[{"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/posts\/2898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/comments?post=2898"}],"version-history":[{"count":0,"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/posts\/2898\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/media\/3033"}],"wp:attachment":[{"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=2898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/categories?post=2898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fliegerhorst.dyndns.org\/index.php\/wp-json\/wp\/v2\/tags?post=2898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}