Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:mail_c7:dovecot_3 [21.07.2014 18:51. ] – [10-logging.conf] django | centos:mail_c7:dovecot_3 [18.11.2024 07:08. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== | + | ====== |
- | Dovecot | + | {{: |
+ | Zur Filtern von E-Mails auf IMAP-Servern wurde die Programmiersprache **SIEVE** konzipiert - die genaue Spezifikationen erfolgten hierzu | ||
- | ===== dovecot.conf ===== | + | Weitere Hintergrundinformationen finden man unter anderem in dem [[http://de.wikipedia.org/ |
- | Rufen wir die Prozessliste auf, sehen wir je nach Auslastung unseres Servers einen oder mehrere Dovecot-Prozesse. | + | \\ |
- | USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | + | Die Unterstützung und Implementierung von **SIEVE** erfolgt über das Projekt **managesieve** von //Stefan Bosch//. Detaillierte Informationen zum Protokoll **Managesieve** sowie zum RFC 5228 und den zahlreichen Erweiterungen RFCs findet man auf der [[http:// |
- | dovecot | + | |
- | Zieht jetzt ein Client mehr Ressourcen, als wir diesem zugestehen wollen, können | + | ===== Installation ===== |
+ | Am Einfachsten bedienen | ||
- | Über den Konfigurationsparameter | + | Die Installation des Paketes geht Dank des Repositories |
- | ps-Werten zusätzlich noch der Login-Name, die Client-IP-Adresse und auch noch der ausgeführte IMAP-Befehl angezeigt wird. | + | # yum install |
- | | + | |
- | | + | |
- | | + | |
- | Zum Aktivieren dieser | + | Was uns das Paket dovecot alles mit ins System bringt, zeigt uns der Befehl **rpm** mit der Option |
+ | # rpm -qil dovecot-pigeonhole | ||
+ | < | ||
+ | Epoch : 1 | ||
+ | Version | ||
+ | Release | ||
+ | Architecture: | ||
+ | Install Date: Mon 04 Aug 2014 11:01:38 PM CEST | ||
+ | Group : System Environment/ | ||
+ | Size : 1133200 | ||
+ | License | ||
+ | Signature | ||
+ | Source RPM : dovecot-2.2.13-2.el7.centos.src.rpm | ||
+ | Build Date : Fri 01 Aug 2014 08:52:54 PM CEST | ||
+ | Build Host : vml000200.dmz.nausch.org | ||
+ | Relocations : (not relocatable) | ||
+ | Packager | ||
+ | Vendor | ||
+ | URL : http:// | ||
+ | Summary | ||
+ | Description : | ||
+ | This package provides sieve and managesieve plug-in for dovecot LDA. | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ===== Konfiguration ===== | ||
+ | Die Konfiguration vom Managesieve-Plugin **dovecot-pigeonhole** erfolgt über die drei Konfigurationsdateien // | ||
+ | |||
+ | |||
+ | ==== 20-managesieve.conf ==== | ||
+ | Auf welchem Port und welcher Adresse unser Managesieve-Logindaemon horchen soll wird in der datei // | ||
+ | # vim / | ||
+ | <file bash / | ||
+ | ## ManageSieve specific settings | ||
+ | ## | ||
+ | |||
+ | # Uncomment to enable managesieve protocol: | ||
+ | # | ||
+ | |||
+ | # Service definitions | ||
+ | |||
+ | # Django : 2014-08-04 | ||
+ | # default: unset | ||
+ | service managesieve-login { | ||
+ | inet_listener sieve { | ||
+ | address = 10.0.0.70 | ||
+ | port = 4190 | ||
+ | } | ||
+ | |||
+ | # | ||
+ | # port = 2000 | ||
+ | #} | ||
+ | |||
+ | # Number of connections to handle before starting a new process. Typically | ||
+ | # the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0 | ||
+ | # is faster. < | ||
+ | # | ||
+ | |||
+ | # Number of processes to always keep waiting for more connections. | ||
+ | # | ||
+ | |||
+ | # If you set service_count=0, | ||
+ | #vsz_limit = 64M | ||
+ | } | ||
+ | |||
+ | #service managesieve { | ||
+ | # Max. number of ManageSieve processes (connections) | ||
+ | # | ||
+ | #} | ||
+ | |||
+ | # Service configuration | ||
+ | |||
+ | protocol sieve { | ||
+ | # Maximum ManageSieve command line length in bytes. ManageSieve usually does | ||
+ | # not involve overly long command lines, so this setting will not normally | ||
+ | # need adjustment | ||
+ | # | ||
+ | |||
+ | # Maximum number of ManageSieve connections allowed for a user from each IP | ||
+ | # address. | ||
+ | # NOTE: The username is compared case-sensitively. | ||
+ | # | ||
+ | |||
+ | # Space separated list of plugins to load (none known to be useful so far). | ||
+ | # Do NOT try to load IMAP plugins here. | ||
+ | # | ||
+ | |||
+ | # MANAGESIEVE logout format string: | ||
+ | # %i - total number of bytes read from client | ||
+ | # %o - total number of bytes sent to client | ||
+ | # | ||
+ | |||
+ | # To fool ManageSieve clients that are focused on CMU's timesieved you can | ||
+ | # specify the IMPLEMENTATION capability that Dovecot reports to clients. | ||
+ | # For example: 'Cyrus timsieved v2.2.13' | ||
+ | # | ||
+ | |||
+ | # Explicitly specify the SIEVE and NOTIFY capability reported by the server | ||
+ | # before login. If left unassigned these will be reported dynamically | ||
+ | # according to what the Sieve interpreter supports by default (after login | ||
+ | # this may differ depending on the user). | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # The maximum number of compile errors that are returned to the client upon | ||
+ | # script upload or script verification. | ||
+ | # | ||
+ | |||
+ | # Refer to 90-sieve.conf for script quota configuration and configuration of | ||
+ | # Sieve execution limits. | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== 90-sieve-extprograms.conf ==== | ||
+ | Mit Hilfe der Datei // | ||
+ | # cat / | ||
+ | <file bash / | ||
+ | |||
+ | # Don't forget to add the sieve_extprograms plugin to the sieve_plugins setting. | ||
+ | # Also enable the extensions you need (one or more of vnd.dovecot.pipe, | ||
+ | # vnd.dovecot.filter and vnd.dovecot.execute) by adding these to the | ||
+ | # sieve_extensions or sieve_global_extensions settings. Restricting these | ||
+ | # extensions to a global context using sieve_global_extensions is recommended. | ||
+ | |||
+ | plugin { | ||
+ | |||
+ | # The directory where the program sockets are located for the | ||
+ | # vnd.dovecot.pipe, | ||
+ | # respectively. The name of each unix socket contained in that directory | ||
+ | # directly maps to a program-name referenced from the Sieve script. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # The directory where the scripts are located for direct execution by the | ||
+ | # vnd.dovecot.pipe, | ||
+ | # respectively. The name of each script contained in that directory | ||
+ | # directly maps to a program-name referenced from the Sieve script. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | } | ||
+ | |||
+ | # An example program service called ' | ||
+ | #service do-something { | ||
+ | # Define the executed script as parameter to the sieve service | ||
+ | #executable = script / | ||
+ | |||
+ | # Use some unprivileged user for executing the program | ||
+ | #user = dovenull | ||
+ | |||
+ | # The unix socket located in the sieve_pipe_socket_dir (as defined in the | ||
+ | # plugin {} section above) | ||
+ | # | ||
+ | # LDA/LMTP must have access | ||
+ | # user = vmail | ||
+ | # mode = 0600 | ||
+ | #} | ||
+ | #} | ||
+ | </ | ||
+ | |||
+ | ==== 90-sieve.conf ==== | ||
+ | Die Einstellungen des Sieve-Plugins erfolgen mit Hilfe der Datei // | ||
+ | # less / | ||
+ | |||
+ | <file bash / | ||
+ | ## Settings for the Sieve interpreter | ||
+ | ## | ||
+ | |||
+ | # Do not forget to enable the Sieve plugin in 15-lda.conf and 20-lmtp.conf | ||
+ | # by adding it to the respective mail_plugins= settings. | ||
+ | |||
+ | plugin { | ||
+ | # The path to the user's main active script. If ManageSieve is used, this the | ||
+ | # location of the symbolic link controlled by ManageSieve. | ||
+ | sieve = ~/ | ||
+ | |||
+ | # The default Sieve script when the user has none. This is a path to a global | ||
+ | # sieve script file, which gets executed ONLY if user's private Sieve script | ||
+ | # doesn' | ||
+ | # command line tool. | ||
+ | # --> See sieve_before fore executing scripts before the user's personal | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Directory for :personal include scripts for the include extension. This | ||
+ | # is also where the ManageSieve service stores the user's scripts. | ||
+ | sieve_dir = ~/sieve | ||
+ | |||
+ | # Directory for :global include scripts for the include extension. | ||
+ | # | ||
+ | |||
+ | # Path to a script file or a directory containing script files that need to be | ||
+ | # executed before the user's script. If the path points to a directory, all | ||
+ | # the Sieve scripts contained therein (with the proper .sieve extension) are | ||
+ | # executed. The order of execution within a directory is determined by the | ||
+ | # file names, using a normal 8bit per-character comparison. Multiple script | ||
+ | # file or directory paths can be specified by appending an increasing number. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Identical to sieve_before, | ||
+ | # user's script (only when keep is still in effect!). Multiple script file or | ||
+ | # directory paths can be specified by appending an increasing number. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Which Sieve language extensions are available to users. By default, all | ||
+ | # supported extensions are available, except for deprecated extensions or | ||
+ | # those that are still under development. Some system administrators may want | ||
+ | # to disable certain Sieve extensions or enable those that are not available | ||
+ | # by default. This setting can use ' | ||
+ | # to the default. For example `sieve_extensions = +imapflags' | ||
+ | # deprecated imapflags extension in addition to all extensions were already | ||
+ | # enabled by default. | ||
+ | # | ||
+ | |||
+ | # Which Sieve language extensions are ONLY available in global scripts. This | ||
+ | # can be used to restrict the use of certain Sieve extensions to administrator | ||
+ | # control, for instance when these extensions can cause security concerns. | ||
+ | # This setting has higher precedence than the `sieve_extensions' | ||
+ | # (above), meaning that the extensions enabled with this setting are never | ||
+ | # available to the user's personal script no matter what is specified for the | ||
+ | # `sieve_extensions' | ||
+ | # `sieve_extensions' | ||
+ | # enabled or disabled for exclusive use in global scripts. Currently, no | ||
+ | # extensions are marked as such by default. | ||
+ | # | ||
+ | |||
+ | # The Pigeonhole Sieve interpreter can have plugins of its own. Using this | ||
+ | # setting, the used plugins can be specified. Check the Dovecot wiki | ||
+ | # (wiki2.dovecot.org) or the pigeonhole website | ||
+ | # (http:// | ||
+ | # The sieve_extprograms plugin is included in this release. | ||
+ | # | ||
+ | |||
+ | # The separator that is expected between the :user and :detail | ||
+ | # address parts introduced by the subaddress extension. This may | ||
+ | # also be a sequence of characters (e.g. ' | ||
+ | # implementation looks for the separator from the left of the | ||
+ | # localpart and uses the first one encountered. The :user part is | ||
+ | # left of the separator and the :detail part is right. This setting | ||
+ | # is also used by Dovecot' | ||
+ | # | ||
+ | |||
+ | # The maximum size of a Sieve script. The compiler will refuse to compile any | ||
+ | # script larger than this limit. If set to 0, no limit on the script size is | ||
+ | # enforced. | ||
+ | # | ||
+ | |||
+ | # The maximum number of actions that can be performed during a single script | ||
+ | # execution. If set to 0, no limit on the total number of actions is enforced. | ||
+ | # | ||
+ | |||
+ | # The maximum number of redirect actions that can be performed during a single | ||
+ | # script execution. If set to 0, no redirect actions are allowed. | ||
+ | # | ||
+ | |||
+ | # The maximum number of personal Sieve scripts a single user can have. If set | ||
+ | # to 0, no limit on the number of scripts is enforced. | ||
+ | # (Currently only relevant for ManageSieve) | ||
+ | # | ||
+ | |||
+ | # The maximum amount of disk storage a single user's scripts may occupy. If | ||
+ | # set to 0, no limit on the used amount of disk storage is enforced. | ||
+ | # (Currently only relevant for ManageSieve) | ||
+ | # | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== dovecot.conf ==== | ||
+ | Zu guter letzt fügen wir noch das Protokoll oder exakter formuliert die Script-Sprache **sieve** zu den Protokollen hinzu, die unser Dovecot-Server zur Verfügung stellen soll. Per Default bietet unser Dovecot-Server bisher folgende Protokolle an: | ||
+ | # doveconf protocols | ||
+ | |||
+ | | ||
+ | |||
+ | Die Erweiterung um **sieve** erfolgt | ||
# vim / | # vim / | ||
- | <file bash / | + | <file bash / |
- | | + | |
- | # If you're in a hurry, see http:// | + | # If you're in a hurry, see http:// |
# " | # " | ||
Zeile 40: | Zeile 350: | ||
# Protocols we want to be serving. | # Protocols we want to be serving. | ||
- | #protocols = imap pop3 lmtp | + | # Django : 2014-08-04 |
+ | # Erweiterung um die Scriptsprache/ | ||
+ | # default: | ||
+ | protocols = imap pop3 lmtp sieve | ||
# A comma separated list of IPs or hosts where to listen in for connections. | # A comma separated list of IPs or hosts where to listen in for connections. | ||
Zeile 46: | Zeile 359: | ||
# If you want to specify non-default ports or anything more complex, | # If you want to specify non-default ports or anything more complex, | ||
# edit conf.d/ | # edit conf.d/ | ||
- | #listen = *, :: | + | # Django : 2014-08-04 |
+ | # IPv6-Adressen deaktivieren, | ||
+ | # bzw. einer IPv4-Addresse | ||
+ | # default: | ||
+ | # listen = 10.0.0.70 | ||
# Base directory where to store runtime data. | # Base directory where to store runtime data. | ||
Zeile 125: | Zeile 442: | ||
</ | </ | ||
- | Zum Aktivieren unserer Änderungen führen | + | ==== 20-lmtp.conf ==== |
- | # | + | Da die definierten SIEVE-Regeln bei der Zustellung der Nachrichten ihre Arbeit verrichten, müssen |
+ | # | ||
+ | <file bash / | ||
+ | ## LMTP specific settings | ||
+ | ## | ||
- | Im Maillog unseres Servers wird dieser Reload entsprechend vermerkt. | + | # Support proxying to other LMTP/SMTP servers by performing passdb lookups. |
- | Jul 21 19:53:45 vml000070 dovecot: master: Warning: SIGHUP received - reloading configuration | + | #lmtp_proxy = no |
- | ===== 10-logging.conf ===== | + | # When recipient address includes the detail (e.g. user+detail), |
+ | # the mail to the detail mailbox. See also recipient_delimiter and | ||
+ | # lda_mailbox_autocreate settings. | ||
+ | # | ||
+ | # Verify quota before replying to RCPT TO. This adds a small overhead. | ||
+ | # | ||
+ | protocol lmtp { | ||
+ | # Space separated list of plugins to load (default is global mail_plugins). | ||
+ | # Django : 2014-08-04 | ||
+ | # default: | ||
+ | mail_plugins = $mail_plugins sieve | ||
+ | } | ||
+ | </ | ||
- | # /etc/dovecot/conf.d/10-logging.conf | + | ===== Horde-Framework' |
- | <file bash /etc/ | + | Die notwendigen Konfigurationseinstellungen bei der Applikation **[[http://www.horde.org/apps/ |
- | ## Log destination. | + | ===== Paketfilter |
- | ## | + | Damit unsere Kunden mit Ihren Mailclients Verbindungen zum geöffneten Ports **4190** unseres Dovecot-Server aufbauen können, müssen wir für diese noch Änderungen am Paketfilter **firewalld** vornehmen. |
+ | | ||
- | # Log file to use for error messages. " | + | |
- | # /dev/stderr logs to stderr. | + | |
- | #log_path = syslog | + | |
- | # Log file to use for informational messages. Defaults to log_path. | + | Anschließend können wir den Firewall-Daemon einmal durchstarten und anschließend überprüfen, |
- | # | + | |
- | # Log file to use for debug messages. Defaults to info_log_path. | + | |
- | #debug_log_path = | + | |
- | # Syslog facility to use if you're logging to syslog. Usually if you don' | + | |
- | # want to use " | + | |
- | # facilities are supported. | + | |
- | # | + | |
- | ## | + | Abschließend prüfen wir noch, ob die Erweiterung unseres Paketfilter aktiv ist. |
- | ## Logging verbosity and debugging. | + | |
- | ## | + | < |
+ | pkts bytes target | ||
+ | 0 0 ACCEPT | ||
+ | | ||
+ | 0 0 ACCEPT | ||
+ | 0 0 ACCEPT | ||
+ | 0 0 ACCEPT | ||
+ | 0 0 ACCEPT | ||
+ | 0 0 ACCEPT | ||
+ | </ | ||
- | # Log unsuccessful authentication attempts and the reasons why they failed. | + | ===== Aktivierung ==== |
- | #auth_verbose = no | + | Zum Aktivieren unserer Änderungen starten wir den Daemon nun einmal durch. |
+ | | ||
- | # In case of password mismatches, log the attempted password. Valid values are | + | Im Maillog wurde der Restart entsprechend dokumentiert. |
- | # no, plain and sha1. sha1 can be useful for detecting brute force password | + | |
- | # attempts vs. user simply trying the same password over and over again. | + | < |
- | # You can also truncate the value to n chars by appending ":n" | + | Aug 4 23:41:47 vml000070 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) |
- | # | + | Aug 4 23:41:47 vml000070 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) |
+ | Aug 4 23:41:47 vml000070 dovecot: master: Dovecot v2.2.13 starting up for imap, pop3, lmtp, sieve (core dumps disabled) | ||
+ | </ | ||
- | # Even more verbose logging for debugging purposes. Shows for example SQL | + | Fragen wir den Serverstatus ab, finden wir nun auch den Dienst **sieve** bei den Protokollen. |
- | # queries. | + | |
- | # | + | < |
+ | Loaded: loaded (/ | ||
+ | | ||
+ | Process: 4156 ExecStartPre=/ | ||
+ | Main PID: 4161 (dovecot) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | # In case of password mismatches, log the passwords and used scheme so the | + | Aug 04 23:41:47 vml000070.dmz.nausch.org systemd[1]: Started Dovecot IMAP/POP3 email server. |
- | # problem can be debugged. Enabling this also enables auth_debug. | + | Aug 04 23:41:47 vml000070.dmz.nausch.org dovecot[4161]: |
- | # | + | </ |
- | # Enable mail process debugging. This can help you figure out why Dovecot | + | Fragen wir mit **netstat** die geöffneten Ports ab, sehen wir auch dort, dass unser Dovecot-Server nun auch auf Port **4190** bei der IP-Adresse **10.0.0.70** lauscht. |
- | # isn't finding your mails. | + | |
- | #mail_debug = no | + | |
- | # Show protocol level SSL errors. | + | |
- | # | + | tcp 0 0 10.0.0.70: |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | # mail_log plugin provides more event logging for mail processes. | + | ===== Test ===== |
- | plugin { | + | Unser ersten Funktionstest werden wir nun mit **SIEVE** via LMTP durchführen. Bei diesem folgenden Test nutzen wir die Authentifikations-Methode **PLAIN**. Die Anmeldedaten müssen dabei zum einen Base64 codiert werden und das Format **" |
- | # Events to log. Also available: flag_change append | + | AUTHENTICATE " |
- | # | + | |
- | # Available fields: uid, box, msgid, from, subject, size, vsize, flags | + | |
- | # size and vsize are available only for expunge and copy events. | + | |
- | # | + | |
- | } | + | |
- | ## | + | Zum Erstellen dieses Anmeldestrings nutzen wir einfach das script **sieve-auth-command.pl** von //Stephan Bosch//. |
- | ## Log formatting. | + | # vim / |
- | ## | + | <file perl / |
+ | # | ||
+ | # sieve-auth-command.pl | ||
+ | # --------------------- | ||
+ | # | ||
+ | # Generates ManageSieve AUTHENTICATE command for manually testing the protocol | ||
+ | # using telnet or gnutls-cli (TLS) | ||
+ | # | ||
+ | # Usage: | ||
+ | # | ||
+ | # | ||
+ | # Prints the AUTHENTICATE " | ||
+ | # | ||
+ | # -- | ||
+ | # Stephan Bosch, stephan@rename-it.nl | ||
+ | # | ||
- | # Prefix for each line written to log file. % codes are in strftime(3) | + | use MIME::Base64; |
- | # format. | + | |
- | # | + | |
- | # Space-separated list of elements we want to log. The elements which have | + | use strict; |
- | # a non-empty variable value are joined together to form a comma-separated | + | |
- | # string. | + | |
- | # | + | |
- | # Login log format. %s contains login_log_format_elements string, %$ contains | + | my $username = shift; |
- | # the data we want to log. | + | my $password |
- | # | + | |
- | + | ||
- | # Log prefix for mail processes. See doc/ | + | |
- | # possible variables you can use. | + | |
- | # | + | |
- | # Format to use for logging mail deliveries. You can use variables: | + | my $userpass = " |
- | # %$ - Delivery status message (e.g. "saved to INBOX") | + | my $encode=encode_base64($userpass); |
- | # %m - Message-ID | + | |
- | # %s - Subject | + | $encode =~ s/^\s+//; |
- | # %f - From address | + | $encode =~ s/\s+$//; |
- | # %p - Physical size | + | |
- | # %w - Virtual size | + | print " |
- | # | + | |
</ | </ | ||
- | Die benutzen Variablen | + | Um das Script einfach ausführen zu können versehen wir nun noch die Datei-Rechte mit einem **x**. |
+ | # chmod +x / | ||
+ | |||
+ | Für unseren User **django@nausch.org** mit dem Passwort **Dj4n90_d3r_G33k!** erstellen wir nun unseren Anmeldestring. | ||
+ | $ sieve-auth-command.pl django@nausch.org Dj4n90_d3r_G33k! | ||
+ | |||
+ | | ||
+ | |||
+ | Diesen Anmeldestring verwenden wir nun bei unserem ersten Test. Bei diesem SIEVE-Test via **telnet** sind die Eingaben am testenden Client in der Farbe < | ||
+ | |||
+ | Als erstes bauen wir eine Verbindung zu unserem Dovecot-Server zum **ManageSieve-Port** **4190** auf und melden uns mit unserem zuvor generierten Anmeldestring am Server an. | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | Connected to 10.0.0.70. | ||
+ | Escape character is ' | ||
+ | <font style=" | ||
+ | & | ||
+ | & | ||
+ | & | ||
+ | & | ||
+ | & | ||
+ | & | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | </ | ||
+ | |||
+ | Als erste Aktion fragen wir ab, welche SIEVE-Scruipte auf dem Server vorhanden sind. Da bis dato noch keine Scripte hinterlegt wurden, sit die Antwort des Servers natürlich etwas spartanisch, | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | </ | ||
+ | |||
+ | Nun wollen wir unser erstes SIEVE Script anlegen. Mit Hilfe dieses Scriptes werden alle Nachrichten sofort gelöscht, sobald diese im Betreff das Wörtchen **p0rn** enthält und der Postfix-MTA die Nachricht via **LMTP** an unseren Backend-server Dovecot übergibt. Das entsprechende Script könnte nun wie folgt aussehen. | ||
+ | |||
+ | < | ||
+ | discard; | ||
+ | stop; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Das script hat insgesamt 96-Zeichen (gefolgt von einem abschließendem **CR**). Zusammen ergibt das also 97 Zeichen. Mit dem Befehl **PUTSCRIPT** laden wir nun dieses script zum Server hoch. | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | if header :comparator " | ||
+ | discard; | ||
+ | stop; | ||
+ | }</ | ||
+ | <font style=" | ||
+ | </ | ||
+ | |||
+ | Fragen wir nun erneut ab, welche Scripte auf dem Server vorliegen, sehen wir auch unser erstes Testscript **erste_sieve-regel_zum_testen**. | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | Zum Scharfschalten des Scripts wird der Befehl **SETACTIVE** verwendet. | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | </ | ||
+ | |||
+ | Fragen wir nun erneut die Liste des SIEVE-Scripte ab, sehen wir ein **ACTIVE** hinter dem Scriptnamen **erste_sieve-regel_zum_testen**; | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | Wollen wir ein script Herunterladen verwenden wir den Befehl **GETSCRIPT**. | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | & | ||
+ | | ||
+ | | ||
+ | & | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | Zu guter Letzt melden wir uns nun von unserem Server mit dem Befehl **LOGOUT** wieder ab. | ||
+ | |||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | </ | ||
+ | |||
+ | Im Verzeischnis des Users **django@nausch.org** finden wir nun auch das Verzeichnis // | ||
+ | |||
+ | < | ||
+ | ├── .dovecot.sieve -> sieve/ | ||
+ | ├── Maildir/ | ||
+ | │ ├── cur/ | ||
+ | │ │ └── 1407189625.M304698P4532.vml000070.dmz.nausch.org, | ||
+ | │ ├── dovecot.index.cache | ||
+ | │ ├── dovecot.index.log | ||
+ | │ ├── dovecot.mailbox.log | ||
+ | │ ├── dovecot-uidlist | ||
+ | │ ├── dovecot-uidvalidity | ||
+ | │ ├── dovecot-uidvalidity.53dfa2ad | ||
+ | │ ├── .Drafts/ | ||
+ | │ │ ├── cur/ | ||
+ | │ │ ├── dovecot.index.log | ||
+ | │ │ ├── dovecot-uidlist | ||
+ | │ │ ├── maildirfolder | ||
+ | │ │ ├── new/ | ||
+ | │ │ └── tmp/ | ||
+ | │ ├── new/ | ||
+ | │ ├── .Sent/ | ||
+ | │ │ ├── cur/ | ||
+ | │ │ ├── dovecot.index.log | ||
+ | │ │ ├── dovecot-uidlist | ||
+ | │ │ ├── maildirfolder | ||
+ | │ │ ├── new/ | ||
+ | │ │ └── tmp/ | ||
+ | │ ├── subscriptions | ||
+ | │ └── tmp/ | ||
+ | └── sieve/ | ||
+ | ├── erste_sieve-regel_zum_testen.sieve | ||
+ | └── tmp/ | ||
+ | </ | ||
+ | |||
+ | Das aktive Script erkennen wir an dem symlink // | ||
+ | # ll / | ||
+ | |||
+ | | ||
+ | |||
+ | Im Maillog wurden unsere SIEVE-Script Aktivitäten mit Hilfe des Mail-Plugins **ManageSieve** dokumentiert. | ||
+ | < | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:58:29 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:59:09 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 12:59:25 vml000070 dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) | ||
+ | Aug 5 12:59:25 vml000070 dovecot: imap-login: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) | ||
+ | Aug 5 12:59:25 vml000070 dovecot: anvil: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) | ||
+ | Aug 5 12:59:25 vml000070 dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) | ||
+ | Aug 5 13:00:00 vml000070 dovecot: master: Dovecot v2.2.13 starting up for imap, pop3, lmtp, sieve (core dumps disabled) | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve-login: | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:00:18 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | Aug 5 13:02:09 vml000070 dovecot: managesieve(django@nausch.org): | ||
+ | </ | ||
+ | |||
+ | Zum Abschluß unseres Tests liefern wir nun eine Nachricht via **LMTP** bei unserem Dovecot-Server ein. | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | Connected to 10.0.0.70. | ||
+ | Escape character is ' | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | & | ||
+ | & | ||
+ | & | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | To: Django | ||
+ | Subject: Haben Du Interesse an p0rn? | ||
+ | Date: Mon, 21 Jul 2014 09:00:36 -0000 | ||
+ | |||
+ | HI, | ||
+ | wenn Du haben willst lot of p0rn, Du mir sagen. | ||
+ | Ich habe sehr viel davon. | ||
+ | |||
+ | ttyl | ||
+ | Bazibua | ||
+ | .</font> | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | </ | ||
+ | |||
+ | |||
+ | Im Maillog sehen wir nun, dass die Nachricht nicht zugestellt, sonder gelöscht wurde **marked message to be discarded if not explicitly delivered (discard action)**. | ||
+ | |||
+ | < | ||
+ | Aug 5 13:38:02 vml000070 dovecot: lmtp(5300): Connect from 10.0.0.80 | ||
+ | Aug 5 13:38:24 vml000070 dovecot: lmtp(5300): Debug: Loading modules from directory: / | ||
+ | Aug 5 13:38:24 vml000070 dovecot: lmtp(5300): Debug: Module loaded: / | ||
+ | Aug 5 13:38:24 vml000070 dovecot: lmtp(5300): Debug: auth input: django@nausch.org uid=10000 gid=10000 home=/srv/ | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:39:59 vml000070 dovecot: lmtp(5300, django@nausch.org): | ||
+ | Aug 5 13:40:03 vml000070 dovecot: lmtp(5300): Disconnect from 10.0.0.80: Successful quit | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Im Verzeichnis des Users **django@nausch.org** sehen wir keine neue Nachricht, da diese mit Hilfe des SIEVE-scriptes sofort gelöscht wurde. | ||
+ | < | ||
+ | ├── .dovecot.sieve -> sieve/ | ||
+ | ├── .dovecot.svbin | ||
+ | ├── Maildir/ | ||
+ | │ ├── cur/ | ||
+ | │ │ └── 1407189625.M304698P4532.vml000070.dmz.nausch.org, | ||
+ | │ ├── dovecot.index.cache | ||
+ | │ ├── dovecot.index.log | ||
+ | │ ├── dovecot.mailbox.log | ||
+ | │ ├── dovecot-uidlist | ||
+ | │ ├── dovecot-uidvalidity | ||
+ | │ ├── dovecot-uidvalidity.53dfa2ad | ||
+ | │ ├── .Drafts/ | ||
+ | │ │ ├── cur/ | ||
+ | │ │ ├── dovecot.index.log | ||
+ | │ │ ├── dovecot-uidlist | ||
+ | │ │ ├── maildirfolder | ||
+ | │ │ ├── new/ | ||
+ | │ │ └── tmp/ | ||
+ | │ ├── new/ | ||
+ | │ ├── .Sent/ | ||
+ | │ │ ├── cur/ | ||
+ | │ │ ├── dovecot.index.log | ||
+ | │ │ ├── dovecot-uidlist | ||
+ | │ │ ├── maildirfolder | ||
+ | │ │ ├── new/ | ||
+ | │ │ └── tmp/ | ||
+ | │ ├── subscriptions | ||
+ | │ └── tmp/ | ||
+ | └── sieve/ | ||
+ | ├── erste_sieve-regel_zum_testen.sieve | ||
+ | └── tmp/ | ||
+ | </ | ||
+ | |||
+ | ===== Test ===== | ||
+ | //... in Bearbeitung (Vorankündigung)! ...// | ||
+ | ====== Links ====== | ||
+ | * **[[centos: | ||
+ | * **[[wiki: | ||
+ | * **[[http:// | ||