Filtrer ses mails ! Un cauchemar !
La configuration de dovecot aka “Le déversoir”
base_dir = /var/run/dovecot/
protocols = imap managesieve ## Je suppose que vous n'avez pas besoin de pop pour votre interface centralisé.
shutdown_clients = yes
disable_plaintext_auth = no
ssl = no ## ce howto ne couvre pas la sécurité de l'imap
# Si vous désirez utiliser seulement TLS
## Pour le moment ce HowTo n'a pas été pensé pour le SSL, mais on peut très facilement l'ajouter.
## disable_plaintext_auth = yes
## ssl = yes
## ssl_cert_file = /var/qmail/control/servercert.pem
## ssl_key_file = /var/qmail/control/servercert.pem
login_dir = /var/run/dovecot/login
login_process_per_connection = yes
login_greeting = Imap ready.
mail_debug = no
mail_uid = 1000
mail_gid = 100
first_valid_uid = 1000 ### Premier utilisateur système
last_valid_uid = 1001 ### Vous pouvez mettre en place cet imap pour plus de deux utilisateurs en augmentant cette directive.
first_valid_gid = 100
last_valid_gid = 1000
mail_location = maildir:~/.maildir ### Expliqué dans le postulat de l'introduction
## on active le deliver local
protocol lda {
postmaster_address = bragon[at_at_at]bragon[dot_point_dot]info ### Mettre ici une adresse mail valide !!!
# remember to give proper permissions for these files as well
log_path = /var/log/dovecot-deliver-errors.log
info_log_path = /var/log/dovecot-deliver.log
#auth_socket_path = /var/run/dovecot/auth-master
mail_plugins = sieve
}
## On log correctement
##
## Logging
##
# Log file to use for error messages, instead of sending them to syslog.
# /dev/stderr can be used to log into stderr.
log_path = /var/log/dovecot/error
# Log file to use for informational and debug messages.
# Default is the same as log_path.
info_log_path = /var/log/dovecot/info
protocol imap {
listen = 81.93.247.***:143 ### Mettre l'ip de la machine ici
login_executable = /usr/libexec/dovecot/imap-login
mail_max_userip_connections = 10
mail_plugin_dir = /usr/lib/dovecot/imap
mail_plugins = quota imap_quota
}
plugin {
quota = maildir:User quota
# Used by both the Sieve plugin and the ManageSieve protocol
sieve=~/.dovecot.sieve ## Répertoire ou serons stockés les regles de filtrage de dovecot.
sieve_dir=~/sieve ## Répertoire ou serons stockés les regles de filtrage de l'utilisateur (elles sont lu par dovecot)
}
protocol managesieve {
# Specify an alternative address:port the daemon must listen on
# (default: *:2000)
listen = 81.93.247.***:2000 ## ip de votre box à mettre ici
managesieve_logout_format = bytes ( in=%i : out=%o )
}
plugin {
# Used by both the Sieve plugin and the ManageSieve protocol
sieve=~/.dovecot.sieve
sieve_dir=~/sieve
}
auth_verbose = yes
auth_debug = yes
auth default { ### On se log ici directement à la base d'utilisateur unix du système courant.
mechanisms = plain login
passdb pam { args = "*"
}
userdb passwd { args = blocking=yes
}
}
protocols = imap managesieve ## Je suppose que vous n'avez pas besoin de pop pour votre interface centralisé.
shutdown_clients = yes
disable_plaintext_auth = no
ssl = no ## ce howto ne couvre pas la sécurité de l'imap
# Si vous désirez utiliser seulement TLS
## Pour le moment ce HowTo n'a pas été pensé pour le SSL, mais on peut très facilement l'ajouter.
## disable_plaintext_auth = yes
## ssl = yes
## ssl_cert_file = /var/qmail/control/servercert.pem
## ssl_key_file = /var/qmail/control/servercert.pem
login_dir = /var/run/dovecot/login
login_process_per_connection = yes
login_greeting = Imap ready.
mail_debug = no
mail_uid = 1000
mail_gid = 100
first_valid_uid = 1000 ### Premier utilisateur système
last_valid_uid = 1001 ### Vous pouvez mettre en place cet imap pour plus de deux utilisateurs en augmentant cette directive.
first_valid_gid = 100
last_valid_gid = 1000
mail_location = maildir:~/.maildir ### Expliqué dans le postulat de l'introduction
## on active le deliver local
protocol lda {
postmaster_address = bragon[at_at_at]bragon[dot_point_dot]info ### Mettre ici une adresse mail valide !!!
# remember to give proper permissions for these files as well
log_path = /var/log/dovecot-deliver-errors.log
info_log_path = /var/log/dovecot-deliver.log
#auth_socket_path = /var/run/dovecot/auth-master
mail_plugins = sieve
}
## On log correctement
##
## Logging
##
# Log file to use for error messages, instead of sending them to syslog.
# /dev/stderr can be used to log into stderr.
log_path = /var/log/dovecot/error
# Log file to use for informational and debug messages.
# Default is the same as log_path.
info_log_path = /var/log/dovecot/info
protocol imap {
listen = 81.93.247.***:143 ### Mettre l'ip de la machine ici
login_executable = /usr/libexec/dovecot/imap-login
mail_max_userip_connections = 10
mail_plugin_dir = /usr/lib/dovecot/imap
mail_plugins = quota imap_quota
}
plugin {
quota = maildir:User quota
# Used by both the Sieve plugin and the ManageSieve protocol
sieve=~/.dovecot.sieve ## Répertoire ou serons stockés les regles de filtrage de dovecot.
sieve_dir=~/sieve ## Répertoire ou serons stockés les regles de filtrage de l'utilisateur (elles sont lu par dovecot)
}
protocol managesieve {
# Specify an alternative address:port the daemon must listen on
# (default: *:2000)
listen = 81.93.247.***:2000 ## ip de votre box à mettre ici
managesieve_logout_format = bytes ( in=%i : out=%o )
}
plugin {
# Used by both the Sieve plugin and the ManageSieve protocol
sieve=~/.dovecot.sieve
sieve_dir=~/sieve
}
auth_verbose = yes
auth_debug = yes
auth default { ### On se log ici directement à la base d'utilisateur unix du système courant.
mechanisms = plain login
passdb pam { args = "*"
}
userdb passwd { args = blocking=yes
}
}
Configuration de .muttrc aka le rouleau à patisserie
Placer ce fichier .muttrc à la racine du répertoire utilisateur :
### pour voir les sous dossiers
set spoolfile="/home/bragon/.maildir/"
set folder="/home/bragon/.maildir/"
set mask="!^\\.[^.]"
set record="+.Sent"
set postponed="+.Drafts"
mailboxes ! + `\
for file in /home/bragon/.maildir/.*; do \
box=$(basename "$file"); \
if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" = '.customflags' \
-a ! "$box" = '.subscriptions' ]; then \
echo -n ""+$box" "; \
fi; \
done`
### activer la sidebar de mutt
macro index c "<change-folder>?<toggle-mailboxes>" "open a different folder"
macro pager c "<change-folder>?<toggle-mailboxes>" "open a different folder"
# Sidebar
set sidebar_visible=yes
set sidebar_width=50
color sidebar_new yellow default
# ctrl-n, ctrl-p to select next, prev folder
# ctrl-o to open selected folder
bind index \Cp sidebar-prev
bind index \Cn sidebar-next
bind index \Cb sidebar-open
bind pager \Cp sidebar-prev
bind pager \Cn sidebar-next
bind pager \Cb sidebar-open
## mon editeur est emacs et je t'emmerde !!!
set editor="emacs -nw"
set spoolfile="/home/bragon/.maildir/"
set folder="/home/bragon/.maildir/"
set mask="!^\\.[^.]"
set record="+.Sent"
set postponed="+.Drafts"
mailboxes ! + `\
for file in /home/bragon/.maildir/.*; do \
box=$(basename "$file"); \
if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" = '.customflags' \
-a ! "$box" = '.subscriptions' ]; then \
echo -n ""+$box" "; \
fi; \
done`
### activer la sidebar de mutt
macro index c "<change-folder>?<toggle-mailboxes>" "open a different folder"
macro pager c "<change-folder>?<toggle-mailboxes>" "open a different folder"
# Sidebar
set sidebar_visible=yes
set sidebar_width=50
color sidebar_new yellow default
# ctrl-n, ctrl-p to select next, prev folder
# ctrl-o to open selected folder
bind index \Cp sidebar-prev
bind index \Cn sidebar-next
bind index \Cb sidebar-open
bind pager \Cp sidebar-prev
bind pager \Cn sidebar-next
bind pager \Cb sidebar-open
## mon editeur est emacs et je t'emmerde !!!
set editor="emacs -nw"
Configuration de postfix aka “Le renvoyeur”
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = //usr/lib/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = tobold.mondomaine.info
mydomain = tobold.mondomaine.info
myorigin = $myhostname
unknown_local_recipient_reject_code = 550
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = /usr/share/doc/postfix-2.6.5/html
manpage_directory = /usr/share/man
sample_directory = /etc/postfix
readme_directory = /usr/share/doc/postfix-2.6.5/readme
home_mailbox = .maildir/
command_directory = /usr/sbin
daemon_directory = //usr/lib/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = tobold.mondomaine.info
mydomain = tobold.mondomaine.info
myorigin = $myhostname
unknown_local_recipient_reject_code = 550
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = /usr/share/doc/postfix-2.6.5/html
manpage_directory = /usr/share/man
sample_directory = /etc/postfix
readme_directory = /usr/share/doc/postfix-2.6.5/readme
home_mailbox = .maildir/
Configuration SpamAssassin/MySQL
* Afin de générer un bon local.cf utilisez : http://www.yrex.com/spam/spamconfig.php
* Insérer dans une base MySQL
CREATE TABLE userpref (
username varchar(100) NOT NULL default '',
preference varchar(50) NOT NULL default '',
value varchar(100) NOT NULL default '',
prefid int(11) NOT NULL auto_increment,
PRIMARY KEY (prefid),
KEY username (username)
);
CREATE TABLE bayes_expire (
id int(11) NOT NULL default '0',
runtime int(11) NOT NULL default '0',
KEY bayes_expire_idx1 (id)
) TYPE=MyISAM;
CREATE TABLE bayes_global_vars (
variable varchar(30) NOT NULL default '',
value varchar(200) NOT NULL default '',
PRIMARY KEY (variable)
) TYPE=MyISAM;
INSERT INTO bayes_global_vars VALUES ('VERSION','3');
CREATE TABLE bayes_seen (
id int(11) NOT NULL default '0',
msgid varchar(200) binary NOT NULL default '',
flag char(1) NOT NULL default '',
PRIMARY KEY (id,msgid)
) TYPE=MyISAM;
CREATE TABLE bayes_token (
id int(11) NOT NULL default '0',
token char(5) NOT NULL default '',
spam_count int(11) NOT NULL default '0',
ham_count int(11) NOT NULL default '0',
atime int(11) NOT NULL default '0',
PRIMARY KEY (id, token),
INDEX (id, atime)
) TYPE=MyISAM;
CREATE TABLE bayes_vars (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(200) NOT NULL default '',
spam_count int(11) NOT NULL default '0',
ham_count int(11) NOT NULL default '0',
token_count int(11) NOT NULL default '0',
last_expire int(11) NOT NULL default '0',
last_atime_delta int(11) NOT NULL default '0',
last_expire_reduce int(11) NOT NULL default '0',
oldest_token_age int(11) NOT NULL default '2147483647',
newest_token_age int(11) NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE bayes_vars_idx1 (username)
) TYPE=MyISAM;
CREATE TABLE awl (
username varchar(100) NOT NULL default '',
email varchar(200) NOT NULL default '',
ip varchar(10) NOT NULL default '',
count int(11) default '0',
totscore float default '0',
PRIMARY KEY (username,email,ip)
) TYPE=MyISAM;
username varchar(100) NOT NULL default '',
preference varchar(50) NOT NULL default '',
value varchar(100) NOT NULL default '',
prefid int(11) NOT NULL auto_increment,
PRIMARY KEY (prefid),
KEY username (username)
);
CREATE TABLE bayes_expire (
id int(11) NOT NULL default '0',
runtime int(11) NOT NULL default '0',
KEY bayes_expire_idx1 (id)
) TYPE=MyISAM;
CREATE TABLE bayes_global_vars (
variable varchar(30) NOT NULL default '',
value varchar(200) NOT NULL default '',
PRIMARY KEY (variable)
) TYPE=MyISAM;
INSERT INTO bayes_global_vars VALUES ('VERSION','3');
CREATE TABLE bayes_seen (
id int(11) NOT NULL default '0',
msgid varchar(200) binary NOT NULL default '',
flag char(1) NOT NULL default '',
PRIMARY KEY (id,msgid)
) TYPE=MyISAM;
CREATE TABLE bayes_token (
id int(11) NOT NULL default '0',
token char(5) NOT NULL default '',
spam_count int(11) NOT NULL default '0',
ham_count int(11) NOT NULL default '0',
atime int(11) NOT NULL default '0',
PRIMARY KEY (id, token),
INDEX (id, atime)
) TYPE=MyISAM;
CREATE TABLE bayes_vars (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(200) NOT NULL default '',
spam_count int(11) NOT NULL default '0',
ham_count int(11) NOT NULL default '0',
token_count int(11) NOT NULL default '0',
last_expire int(11) NOT NULL default '0',
last_atime_delta int(11) NOT NULL default '0',
last_expire_reduce int(11) NOT NULL default '0',
oldest_token_age int(11) NOT NULL default '2147483647',
newest_token_age int(11) NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE bayes_vars_idx1 (username)
) TYPE=MyISAM;
CREATE TABLE awl (
username varchar(100) NOT NULL default '',
email varchar(200) NOT NULL default '',
ip varchar(10) NOT NULL default '',
count int(11) default '0',
totscore float default '0',
PRIMARY KEY (username,email,ip)
) TYPE=MyISAM;
* secret.cf
##(Tell Spamassassin to use MySQL for bayes data
bayes_store_module Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn DBI:mysql:sa:localhost:3306
bayes_sql_username sa
bayes_sql_password somepwd
##(Tell Spamassassin to use MySQL for AWL data
auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn DBI:mysql:sa:localhost:3306
user_awl_sql_username sa
user_awl_sql_password somepwd
bayes_store_module Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn DBI:mysql:sa:localhost:3306
bayes_sql_username sa
bayes_sql_password somepwd
##(Tell Spamassassin to use MySQL for AWL data
auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn DBI:mysql:sa:localhost:3306
user_awl_sql_username sa
user_awl_sql_password somepwd
* local.cf
# SpamAssassin config file for version 3.x
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)
# How many hits before a message is considered spam.
required_score 5.0
# Change the subject of suspected spam
rewrite_header subject [SPAM]
# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 1
# Enable the Bayes system
use_bayes 1
# Enable Bayes auto-learning
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 1
#use_dcc 1
use_pyzor 1
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
# - english french
#ok_languages en fr
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
#ok_locales en fr
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)
# How many hits before a message is considered spam.
required_score 5.0
# Change the subject of suspected spam
rewrite_header subject [SPAM]
# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 1
# Enable the Bayes system
use_bayes 1
# Enable Bayes auto-learning
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 1
#use_dcc 1
use_pyzor 1
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
# - english french
#ok_languages en fr
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
#ok_locales en fr
Ajouter les clous de girofles dans RoundCube
http://www.tehinterweb.co.uk/roundcube/#pisieverules
Il vous faut installer les plugins ManageSieve et ReportasJunk
Suivez la documentation officielle, elle s’en sortira mieux que moi afin de vous expliquer tout cela.
- http://www.tehinterweb.co.uk/roundcube/plugins/sieverules.README.txt
- http://www.tehinterweb.co.uk/roundcube/plugins/sauserprefs.README.txt
- http://www.tehinterweb.co.uk/roundcube/plugins/markasjunk2.README.txt
Laissez refroidir
Voilà c’est prêt !
Awesome non ?
ps : Pour ceux qui me connaissent pas, c’est ma vraie photo avec un chapeau de chef :p
Succulent 🙂
Excellent ta photo de chef cuisinier 😀
Ha bah ouais il est beau avec sa toque 😀