ateliers:serveurmail:rspamd
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
ateliers:serveurmail:rspamd [2017/05/11 23:13] – [Installation] dove | ateliers:serveurmail:rspamd [2018/01/28 14:01] (Version actuelle) – Typos okhin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
==== Ressources ==== | ==== Ressources ==== | ||
- | FIXME: A écrire | + | [[https:// |
+ | [[https:// | ||
==== Installation ==== | ==== Installation ==== | ||
__Ajout repository non-officiel__ : | __Ajout repository non-officiel__ : | ||
+ | |||
+ | Le repository officiel de debian n'est plus maintenu, il fautd onc utiliser la version upstream. | ||
+ | |||
+ | Le fichier ''/ | ||
+ | |||
+ | $ wget -O- https:// | ||
<code|h / | <code|h / | ||
- | deb http:// | + | deb http:// |
</ | </ | ||
Ligne 23: | Ligne 30: | ||
FIXME: A écrire | FIXME: A écrire | ||
+ | < | ||
+ | # | ||
+ | # Python 3.5+ required | ||
+ | # Script by https:// | ||
+ | # Source adapted to 3.5 from dashie version https:// | ||
- | ==== Configuration ==== | + | import sys |
+ | import smtplib | ||
+ | import subprocess | ||
+ | import syslog | ||
+ | import time | ||
- | FIXME: A écrire | + | t_start = time.time() |
+ | SMTP_HOST | ||
+ | SMTP_PORT | ||
+ | RSPAMC_BIN | ||
+ | RSPAMC_ADDR = ' | ||
+ | |||
+ | mail_from | ||
+ | rcpt_to | ||
+ | |||
+ | def size(size, decimal_places): | ||
+ | for unit in ['',' | ||
+ | if size < 1024.0: | ||
+ | break | ||
+ | size /= 1024.0 | ||
+ | return " | ||
+ | |||
+ | syslog.openlog(logoption=syslog.LOG_PID, | ||
+ | |||
+ | # Pipe stdin to rspamc, and get the processed mail back | ||
+ | #XXX: this means the processed mail stays in RAM, which may not be what we want? | ||
+ | completed_process = subprocess.run([RSPAMC_BIN, | ||
+ | | ||
+ | | ||
+ | |||
+ | # Remove ' | ||
+ | mail_contents = completed_process.stdout | ||
+ | mail_contents = b' | ||
+ | |||
+ | with smtplib.SMTP(SMTP_HOST, | ||
+ | smtp.sendmail(mail_from, | ||
+ | |||
+ | t_end = time.time() | ||
+ | |||
+ | syslog.syslog(" | ||
+ | </ |
ateliers/serveurmail/rspamd.txt · Dernière modification : 2018/01/28 14:01 de okhin