wiki:QuotasParBoite

Version 9 (modified by anonyme, 6 years ago) (diff)

--

codeine buy ephedra celebrex prevacid solutab acomplia treatment generic valium buy hydrocodone online codeine buy valium online affect nexium side buy online diazepam buy online ultram side effects of lipitor zyprexa lawyer buy ambien online atenolol and flushing buy cheap codeine online zolpidem atenolol buy ultracet drug klonopin hydrocodone online acomplia treatment buy valium online valium zyprexa attorney information zanaflex clomid side effects acyclovir zanaflex buy phentermine zyprexa diabetes tramadol cod soft tab tadalafil buy ambien online codeine prevacid hydrocodone online pharmacy tramadol valium zithromax side effects buy citrate sildenafil prevacid side effects glucophage loss weight cheap codeine drug ultracet information zanaflex glucophage phentermine buy didrex online atenolol tetracycline cheap viagra cheap ephedra generic lipitor glucophage pcos levitra alternative buy cheap ultram buy tetracycline diet fuel with ephedra buy citrate sildenafil diazepam buy levitra online information zanaflex buy cheap fioricet celexa glucophage pcos cheap zanaflex valium acomplia treatment side effects of lipitor atenolol buy ephedra online atenolol side effects bontril 35mg zithromax viagra alternative buy valium online online zanaflex buy hydrocodone tramadol side effects of zyprexa buy bontril valium without prescription prevacid online codeine addiction discount valtrex side effects of lipitor codeine addiction didrex online cheap ephedra valium discount didrex zyprexa side effects didrex cheap lipitor side effects prevacid zoloft sildenafil generic ultram buy tadalafil drug ultracet celexa & discontinuation symptoms ephedrine hcl online pharmacy tramadol klonopin withdrawal generic sildenafil generic nexium glucophage xr zithromax antibiotic cheap ultram zoloft withdrawal cheap ultram cheap bontril drug fioricet cheap ephedra ambien side effects from lipitor tramadol cod buy online codeine valium buy cheap diazepam valtrex medication cheap codeine buy zanaflex side effects of lipitor cheap viagra buy tramadol clomid side effects buy fioricet glucophage xr rimonabant acomplia cheap ultracet cheap didrex celexa & discontinuation symptoms buy cheap codeine hydrocodone online celebrex zithromax azithromycin buy tetracycline zoloft suicide generic ambien valtrex buy tetracycline glucophage xr zithromax azithromycin prevacid online effects side zanaflex cheap fioricet side effects from lipitor bontril drug ultracet buy levitra zyprexa attorney phentermine online acyclovir buy online codeine buy online codeine gain lexapro weight glucophage loss weight citrate generic sildenafil klonopin effects nexium side acyclovir medication lexapro didrex online clomid side effects cheap ultracet side effects for valtrex buy tadalafil lexapro withdrawal buy ultram sildenafil viagra glucophage xr slot machine celebrex online zolpidem generic viagra levitra alternative acyclovir dosage zoloft glucophage loss weight buy ephedrine klonopin side effects glucophage xr hydrocodone online buy ultram buy ultracet buy valtrex zithromax antibiotic ambien buy tetracycline prevacid solutab buy hydrocodone online buy tramadol ambien sildenafil discount valtrex zithromax side effects buy celebrex zyprexa diabetes celexa & discontinuation symptoms

Mise en garde

Si ce Howto cherche a rester a la fois le plus debian-style et AlternC-style, il vous fait quitter les deux. Il s'adresse donc plutot a un public avertis, capable eventuellement d'aller hacker la conf de postfix a La Rache . Enfin il faut compiler une extension de MySQL afin de pouvoir dissocier ce qui est du pop des redirections (dans le cas d'une boite faisant les deux) car la config d'AlternC s'appuie par defaut sur une distribution locale du courrier, alors que dans la configuration qui suit seules les mailings lists beneficie de cela, tout le reste passant par du virtual et donc du quota.

Je suis maintenant convaincu que cette methode est loin d'etre la meilleure et qu'il y a moyen de mieux faire. Les maps SQL que j'utilise ne sont certainement pas les plus pertinentes mais j'ai du "bidouiller" pour que ca marche. Je ne dispose malheureusement pas du temps necessaire pour faire mieux.

Enfin le calcul du quota a la reception de chaque mail charge la machine, donc je deconseille ce type de configuration sur un serveur deja charge.

Installation de postfix patche pour VDA

Il faut recuperer les sources de postfix pour appliquer les patchs VDA.

apt-get install build-essential dpkg-dev fakeroot debhelper libdb4.2-dev libgdbm-dev libldap2-dev libpcre3-dev libmysqlclient10-dev libssl-dev libsasl2-dev postgresql-dev po-debconf dpatch
cd /usr/src
apt-get source postfix

wget http://web.onda.com.br/nadal/postfix/VDA/postfix-2.1.5-trash.patch.gz
gunzip postfix-2.1.5-trash.patch.gz
cd postfix-2.1.5
patch -p1 < ../postfix-2.1.5-trash.patch
dpkg-buildpackage
cd ..
dpkg -i postfix_2.1.5-9_i386.deb
dpkg -i postfix-mysql_2.1.5-9_i386.deb
dpkg -i postfix-tls_2.1.5-9_i386.deb

Ensuite on fixe ces packages afin qu'il ne soit plus mis a jour :

dpkg --get-selections| grep postfix | sed s/hold/install/ | dpkg --set-selections
aptitude hold postfix postfix-doc postfix-mysql postfix-pcre postfix-tls

Mise en place du champs quota dans MySQL

Nous allons ajouter un champs quota a la table mail_users d'AlternC, nous fixons ici un quota en 100Mo , cette donnee est exprimee en octets.

 mysql -usysusr -pmot_de_passe system -e "ALTER TABLE `mail_users` ADD `quota`  INT DEFAULT '104857600' NOT NULL ;"

Il faut en plus compiler une extension pour mysql afin que de disposer d'une fonction mailfilter. AlternC utilisant le transport local pour faire la delvrance nous devons sortir de ce shema afin de passer par un transport virtuel.

tar zxvf mailfilter.tgz
cd mailfilter
make 
cp mailfiter.so /usr/lib/mysql-fct-mailfilter.so
ldconfig 
mysql restart
mysql -usysusr -pmot_de_passe -e "create function mailfilter returns string soname 'mysql-fct-mailfilter.so' ;"

Modification des confs d'AlternC pour postfix et courrier

Il faut editer /etc/alternc/templates/postfix/main.cf et le remplacer par :

#
# Fichier de configuration de Postfix pour AlternC
# $Id: main.cf,v 1.17 2006/01/12 06:50:15 anarcat Exp $
# 
# %%warning_message%% 
# pour postfix SARGE v2

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
# recipient_delimiter = +

home_mailbox = Maildir/

smtpd_banner = $myhostname ESMTP

header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks

local_destination_concurrency_limit = 8
default_destination_concurrency_limit = 10

myhostname = %%fqdn%%
myorigin = %%fqdn%%
mynetworks = 127.0.0.1 %%mynetwork%%  82.127.2.119 81.80.253.50


# Configuration TLS pour le serveur smtp : 
smtpd_use_tls = yes
smtpd_tls_dcert_file = /etc/courier/pop3d.pem
smtpd_tls_dkey_file = $smtpd_tls_dcert_file
smtpd_tls_CApath = /etc/ssl/certs/
smtpd_tls_key_file =  $smtpd_tls_dcert_file
smtpd_tls_cert_file =  $smtpd_tls_dcert_file
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

# Configuration TLS pour le client smtp
smtp_use_tls = yes
smtp_tls_dcert_file = $smtpd_tls_dcert_file
smtp_tls_dkey_file = $smtpd_tls_dcert_file
smtp_tls_CApath = $smtpd_tls_CApath

# Configuration SASL via sasldb (/etc/sasldb) uniquement en TLS.
# Sinon le pass passe en clair et c'est mal !
smtpd_tls_auth_only = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = postfix
smtpd_sasl_security_options = noanonymous
enable_sasl_authentification = yes
broken_sasl_auth_clients = yes

# Pour ?iter certains vieux spammeurs.
disable_vrfy_command = yes

# On autorise le relai ?: les authentifi? en saslet nos domaines.
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination

alias_maps = mysql:/etc/postfix/mymailinglists.cf mysql:/etc/postfix/myalias-only.cf hash:/etc/aliases

default_privs = www-data
program_directory = /usr/lib/postfix

#Quota Postfix VDA
virtual_minimum_uid = 32
virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf proxy:mysql:/etc/postfix/mygidunderscore.cf
virtual_uid_maps = static:33
virtual_transport = virtual
virtual_mailbox_base = /
virtual_alias_maps =  proxy:mysql:/etc/postfix/myredirections.cf proxy:mysql:/etc/postfix/mymixed.cf 
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtualmaildirunderscore.cf proxy:mysql:/etc/postfix/myvirtualmaildir.cf 
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mydomains.cf proxy:mysql:/etc/postfix/myunderscore.cf
virtual_alias_domains =
append_at_myorigin = no
append_dot_mydomain = no
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/myquota.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_limit = 1073741824
virtual_mailbox_limit_inbox = no
virtual_maildir_limit_message = La boite email de votre destinataire est pleine.
virtual_create_maildirsize = yes
virtual_overquota_bounce = yes
proxy_read_maps= $virtual_gid_maps $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $virtual_mailbox_limit_maps  proxy:unix:passwd.byname 
local_transport = local
mydestination = 

il faut editer le fichier : /etc/alternc/templates/courier/authmysqlrc a la ligne 131 mettre :

MYSQL_QUOTA_FIELD quota

Ensuite il faut reprendre les fichiers de maps mysql pour postfix :

tar zxvf conf.tgz 
cd conf
for i in * 
sed -i s/MDP_SQL/A_REMPLACER_PAR_LE_VOTRE/ $i
cp * /etc/postfix

changer les droits :

chmod 640 /etc/postfix/*.cf 
chgrp postfix /etc/postfix/*.cf

AlternC install

Ensuite un petit :

alternc.install 

Et si tout va bien tout roule :)

Todo

Ajouter un script de notification de quota pour les utilisateurs.

Attachments

  • conf.tgz (812 bytes) - added by pierre-gilles 7 years ago. Maps MySQL pour Postfix pour une delivrance via virtual
  • mailfilter.tgz (1.9 KB) - added by pierre-gilles 7 years ago. Extension pour Mysql 4.X permettant d'utiliser un filtre mailfilter