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 | ||
| utilisateurs:mcpeter:postfix_dovecot_mysql_postfixadmin [Le 24/07/2015, 11:00] – [Installation d'une solution mail complète : Postfix, Dovecot, MySQL, Postfixadmin] tiramiseb | utilisateurs:mcpeter:postfix_dovecot_mysql_postfixadmin [Le 20/07/2018, 01:06] (Version actuelle) – suppression brouillon McPeter | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | {{tag> | ||
| - | ---- | ||
| - | ====== Installation d'une solution mail complète : Postfix, Dovecot, MySQL, Postfixadmin ====== | ||
| - | |||
| - | Cette page propose un pas-à-pas pour mettre en place rapidement un serveur de messagerie en faisant appel à l' | ||
| - | * [[: | ||
| - | * [[: | ||
| - | * [[:MySql]] pour enregistrer les comptes mails virtuels | ||
| - | * [[http:// | ||
| - | |||
| - | < | ||
| - | |||
| - | //Ceci est l'avis d'un administrateur système professionnel, | ||
| - | |||
| - | La solution présentée ici est très complexe et n'est mise en œuvre, en environnements professionnels, | ||
| - | Ce tutoriel n'est donc //à mon avis// pas à suivre pour la mise en place d'un petit serveur de messagerie : personnel, familial, entre amis, etc. | ||
| - | |||
| - | --- // | ||
| - | |||
| - | =====Pré-requis===== | ||
| - | |||
| - | * Une solution [[: | ||
| - | * Un certificat SSL (auto-signé ou autre) valide. | ||
| - | < | ||
| - | sudo apt-get install ssl-cert | ||
| - | sudo make-ssl-cert generate-default-snakeoil --force-overwrite</ | ||
| - | |||
| - | ====Création de l' | ||
| - | |||
| - | < | ||
| - | Créez la base de données (ici // | ||
| - | < | ||
| - | grant all on postfixadmin.* to ' | ||
| - | </ | ||
| - | |||
| - | Plus d' | ||
| - | |||
| - | ====Installation des paquets=== | ||
| - | |||
| - | - [[: | ||
| - | * **[[apt> | ||
| - | * **[[apt> | ||
| - | sudo service clamav-daemon start</ | ||
| - | * **[[apt> | ||
| - | - Relancez le [[: | ||
| - | - Installez la seconde série de paquets utiles à savoir : | ||
| - | * **[[apt> | ||
| - | * **[[apt> | ||
| - | sudo apt-get install arj bzip2 cabextract cpio file gzip nomarch pax unzip zip</ | ||
| - | * **[[apt> | ||
| - | </ | ||
| - | |||
| - | =====Postfixadmin===== | ||
| - | |||
| - | Postfixadmin permet de gérer graphiquement les domaines et les boites e-mail rattachées. Il permet de créer des administrateurs par domaine qui peuvent eux-mêmes créer des boites ainsi que des alias. Le tout se pilotant au travers d'un [[: | ||
| - | |||
| - | ==== Installation ==== | ||
| - | Un paquet tout prêt est disponible et évite plusieurs étapes de configuration/ | ||
| - | - le télécharger à [[http:// | ||
| - | - l' | ||
| - | - Choisissez " | ||
| - | Ceci se résume dans un [[: | ||
| - | < | ||
| - | sudo dpkg -i postfixadmin_2.3.5-1_all.deb</ | ||
| - | |||
| - | ==== Configuration ==== | ||
| - | === Paramètres principaux === | ||
| - | [[: | ||
| - | |||
| - | <file php> | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | $CONF[' | ||
| - | </ | ||
| - | |||
| - | === Définition de la base de données === | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file php> | ||
| - | $dbuser=' | ||
| - | $dbpass=' | ||
| - | $basepath=''; | ||
| - | $dbname=' | ||
| - | $dbserver=''; | ||
| - | $dbport=''; | ||
| - | $dbtype=' | ||
| - | </ | ||
| - | |||
| - | === Mise en place === | ||
| - | Modifier si nécessaire / | ||
| - | <file conf> | ||
| - | Relancez le [[: | ||
| - | Un rechargement de la configuration apache peut suffire | ||
| - | < | ||
| - | Lancez la configuration en saisissant dans votre navigateur l' | ||
| - | Créez la clé de hash via le mot de passe demandé en bas de page. (ce mot de passe sert de contrôle à la clé de hash). | ||
| - | <note important> | ||
| - | Créez un administrateur Postfixadmin. Il est **fortement conseillé** de bien le différencier de l' | ||
| - | |||
| - | [[: | ||
| - | <file php> | ||
| - | |||
| - | Il faut ensuite protéger cette page (vous pourrez créer d' | ||
| - | [[: | ||
| - | |||
| - | < | ||
| - | deny from all | ||
| - | </ | ||
| - | |||
| - | Se rendre sur la page http:// | ||
| - | {{: | ||
| - | À ce stade, Postfixadmin est opérationnel. | ||
| - | |||
| - | |||
| - | |||
| - | =====Répertoire des e-mails===== | ||
| - | |||
| - | Ici les utilisateurs sont virtuels, et donc indépendant | ||
| - | Pour l' | ||
| - | |||
| - | * Création du groupe **mail** puis de l' | ||
| - | sudo useradd -r -u 150 -g mail -d /home/vmail -s / | ||
| - | * Création du répertoire dédié et les droits associés < | ||
| - | sudo chmod 770 / | ||
| - | * Désignation du // | ||
| - | |||
| - | =====Dovecot===== | ||
| - | |||
| - | [[: | ||
| - | Il gère également l' | ||
| - | |||
| - | ==== Configuration ==== | ||
| - | |||
| - | Vous allez attaquer la première partie " | ||
| - | |||
| - | === Définition de la base de données ? === | ||
| - | [[: | ||
| - | |||
| - | <file txt auth-sql.conf.ext># | ||
| - | # defined in / | ||
| - | passdb { | ||
| - | driver = sql | ||
| - | args = / | ||
| - | } | ||
| - | # Look up user information from a SQL database as | ||
| - | # defined in / | ||
| - | userdb { | ||
| - | driver = sql | ||
| - | args = / | ||
| - | }</ | ||
| - | |||
| - | === Définition des accès à la base de données ? === | ||
| - | Vérifiez avant tout l' | ||
| - | < | ||
| - | devrait répondre quelque chose comme | ||
| - | < | ||
| - | Notez bien ces informations avant d' [[: | ||
| - | * Type de base de données: < | ||
| - | driver = mysql</ | ||
| - | * Ici remplacez // | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | connect = host=localhost dbname=postfixadmin user=postfixadmin password=mot_de_passe_postfixadmin</ | ||
| - | * Type d' | ||
| - | # | ||
| - | # List of supported schemes is in | ||
| - | # http:// | ||
| - | # | ||
| - | default_pass_scheme = MD5-CRYPT</ | ||
| - | * Requète de mot de passe (adaptez avec les informations obtenues en début de ce chapitre) < | ||
| - | password_query = \ | ||
| - | SELECT username as user, password, '/ | ||
| - | ' | ||
| - | FROM mailbox WHERE username = ' | ||
| - | * Information utilisateur (adaptez avec les informations obtenues en début de ce chapitre) < | ||
| - | user_query = \ | ||
| - | SELECT '/ | ||
| - | 150 AS uid, 1001 AS gid, concat(' | ||
| - | FROM mailbox WHERE username = ' | ||
| - | |||
| - | === FIXME === | ||
| - | |||
| - | [[: | ||
| - | |||
| - | < | ||
| - | # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP | ||
| - | # matches the local IP (ie. you're connecting from the same computer), the | ||
| - | # connection is considered secure and plaintext authentication is allowed. | ||
| - | disable_plaintext_auth = yes</ | ||
| - | |||
| - | < | ||
| - | # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey | ||
| - | # | ||
| - | # NOTE: See also disable_plaintext_auth setting. | ||
| - | auth_mechanisms = plain login</ | ||
| - | |||
| - | < | ||
| - | ## Password and user databases | ||
| - | ## | ||
| - | |||
| - | # | ||
| - | # Password database is used to verify user's password (and nothing more). | ||
| - | # You can have multiple passdbs and userdbs. This is useful if you want to | ||
| - | # allow both system users (/ | ||
| - | # duplicating the system users into virtual database. | ||
| - | # | ||
| - | # < | ||
| - | # | ||
| - | # User database specifies where mails are located and what user/group IDs | ||
| - | # own them. For single-UID configuration use " | ||
| - | # | ||
| - | # < | ||
| - | |||
| - | #!include auth-deny.conf.ext | ||
| - | #!include auth-master.conf.ext | ||
| - | |||
| - | #!include auth-system.conf.ext | ||
| - | # Use the SQL database configuration rather than any of these others. | ||
| - | !include auth-sql.conf.ext | ||
| - | #!include auth-ldap.conf.ext | ||
| - | #!include auth-passwdfile.conf.ext | ||
| - | #!include auth-checkpassword.conf.ext | ||
| - | #!include auth-vpopmail.conf.ext | ||
| - | #!include auth-static.conf.ext</ | ||
| - | |||
| - | === FIXME === | ||
| - | |||
| - | [[: | ||
| - | |||
| - | < | ||
| - | # tries to find the mailboxes automatically. This won't work if the user | ||
| - | # doesn' | ||
| - | # location. | ||
| - | # | ||
| - | # If you're using mbox, giving a path to the INBOX file (eg. / | ||
| - | # isn't enough. You'll also need to tell Dovecot where the other mailboxes are | ||
| - | # kept. This is called the "root mail directory", | ||
| - | # path given in the mail_location setting. | ||
| - | # | ||
| - | # There are a few special variables you can use, eg.: | ||
| - | # | ||
| - | # %u - username | ||
| - | # %n - user part in user@domain, | ||
| - | # %d - domain part in user@domain, | ||
| - | # %h - home directory | ||
| - | # | ||
| - | # See doc/ | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # < | ||
| - | # | ||
| - | mail_location = maildir:/ | ||
| - | |||
| - | < | ||
| - | # can override these by returning uid or gid fields. You can use either numbers | ||
| - | # or names. < | ||
| - | mail_uid = vmail | ||
| - | mail_gid = mail</ | ||
| - | |||
| - | < | ||
| - | # to make sure that users can't log in as daemons or other system users. | ||
| - | # Note that denying root logins is hardcoded to dovecot binary and can't | ||
| - | # be done even if first_valid_uid is set to 0. | ||
| - | # | ||
| - | # Use the vmail user uid here. | ||
| - | first_valid_uid = 150 | ||
| - | last_valid_uid = 150</ | ||
| - | |||
| - | === FIXME === | ||
| - | |||
| - | [[: | ||
| - | Si vous voulez utiliser le support SSL/TLS et/ou utiliser votre propre certificat. Dans le cas de votre propre certificat, il vous faudra renseigner les parties // | ||
| - | |||
| - | < | ||
| - | ssl = yes | ||
| - | |||
| - | # PEM encoded X.509 SSL/TLS certificate and private key. They' | ||
| - | # dropping root privileges, so keep the key file unreadable by anyone but | ||
| - | # root. Included doc/ | ||
| - | # certificate, | ||
| - | ssl_cert = </ | ||
| - | ssl_key = </ | ||
| - | |||
| - | === FIXME === | ||
| - | |||
| - | [[: | ||
| - | Ajout des options de Postfix à Dovecot.\\ | ||
| - | |||
| - | < | ||
| - | # auth_socket_path points to this userdb socket by default. It's typically | ||
| - | # used by dovecot-lda, | ||
| - | # permissions make it readable only by root, but you may need to relax these | ||
| - | # permissions. Users that have access to this socket are able to get a list | ||
| - | # of all usernames and get results of everyone' | ||
| - | unix_listener auth-userdb { | ||
| - | mode = 0600 | ||
| - | user = vmail | ||
| - | group = mail | ||
| - | } | ||
| - | |||
| - | # Postfix smtp-auth | ||
| - | unix_listener / | ||
| - | mode = 0666 | ||
| - | # Assuming the default Postfix user and group | ||
| - | user = postfix | ||
| - | group = postfix | ||
| - | }</ | ||
| - | | ||
| - | Rendre accessible la configuration à Dovecot et aux utilisateurs vmail.\\ | ||
| - | |||
| - | < | ||
| - | sudo chmod -R o-rwx / | ||
| - | | ||
| - | |||
| - | |||
| - | ===== Amavis ClamAV, SpamAssassin ===== | ||
| - | |||
| - | Ajout des utilisateurs clamav et amavis et partage de leurs droits : | ||
| - | < | ||
| - | sudo adduser amavis clamav</ | ||
| - | |||
| - | ====Configuration Amavis ClamAV==== | ||
| - | |||
| - | [[: | ||
| - | |||
| - | < | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file txt 15-content_filter_mode> | ||
| - | |||
| - | # You can modify this file to re-enable SPAM checking through spamassassin | ||
| - | # and to re-enable antivirus checking. | ||
| - | |||
| - | # | ||
| - | # Default antivirus checking mode | ||
| - | # Please note, that anti-virus checking is DISABLED by | ||
| - | # default. | ||
| - | # If You wish to enable it, please uncomment the following lines: | ||
| - | |||
| - | @bypass_virus_checks_maps = ( | ||
| - | | ||
| - | |||
| - | # | ||
| - | # Default SPAM checking mode | ||
| - | # Please note, that anti-spam checking is DISABLED by | ||
| - | # default. | ||
| - | # If You wish to enable it, please uncomment the following lines: | ||
| - | |||
| - | @bypass_spam_checks_maps = ( | ||
| - | | ||
| - | |||
| - | 1; # ensure a defined return</ | ||
| - | |||
| - | ====Configuration SpamAssassin==== | ||
| - | |||
| - | [[: | ||
| - | |||
| - | < | ||
| - | ENABLED=1</ | ||
| - | |||
| - | < | ||
| - | # Set to anything but 0 to enable the cron job to automatically update | ||
| - | # spamassassin' | ||
| - | CRON=1</ | ||
| - | |||
| - | On relance les services :\\ | ||
| - | |||
| - | < | ||
| - | sudo service spamassassin restart</ | ||
| - | |||
| - | =====Postfix===== | ||
| - | |||
| - | Seconde partie " | ||
| - | Postfix gère les courriers entrant, via le protocole SMTP. Ici nous allons configurer Postfix pour qu'il gère les courriers au niveau Antivirus et AntiSpam avant de transmettre le tout à Dovecot, ainsi que la gestion des utilisateurs virtuels se connectant via SMTP pour envoyer du courrier. | ||
| - | |||
| - | Sous 12.10 (server) il faut installer le paquetage grâce auquel Postfix accédera aux bases de données: | ||
| - | < | ||
| - | | ||
| - | ====Configuration==== | ||
| - | |||
| - | <note tip>Les sections de fichiers qui suivent, sont téléchargeables directement depuis le nom indiqué dans l' | ||
| - | Création des fichiers de configuration pour que Postfix trouve les utilisateurs et domaines.\\ | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file txt mysql_virtual_alias_domainaliases_maps.cf> | ||
| - | password = mot_de_passe_administrateur_postfix | ||
| - | hosts = 127.0.0.1 | ||
| - | dbname = postfixadmin | ||
| - | query = SELECT goto FROM alias, | ||
| - | WHERE alias_domain.alias_domain = ' | ||
| - | AND alias.address=concat(' | ||
| - | AND alias.active = 1</ | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file txt mysql_virtual_alias_maps.cf> | ||
| - | password = mot_de_passe_administrateur_postfix | ||
| - | hosts = 127.0.0.1 | ||
| - | dbname = postfixadmin | ||
| - | table = alias | ||
| - | select_field = goto | ||
| - | where_field = address | ||
| - | additional_conditions = and active = ' | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file txt mysql_virtual_domains_maps.cf> | ||
| - | password = mot_de_passe_administrateur_postfix | ||
| - | hosts = 127.0.0.1 | ||
| - | dbname = postfixadmin | ||
| - | table = domain | ||
| - | select_field = domain | ||
| - | where_field = domain | ||
| - | additional_conditions = and backupmx = ' | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file txt mysql_virtual_mailbox_domainaliases_maps.cf> | ||
| - | password = mot_de_passe_administrateur_postfix | ||
| - | hosts = 127.0.0.1 | ||
| - | dbname = postfixadmin | ||
| - | query = SELECT maildir FROM mailbox, alias_domain | ||
| - | WHERE alias_domain.alias_domain = ' | ||
| - | AND mailbox.username=concat(' | ||
| - | AND mailbox.active = 1</ | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <file txt mysql_virtual_mailbox_maps.cf> | ||
| - | password = mot_de_passe_administrateur_postfix | ||
| - | hosts = 127.0.0.1 | ||
| - | dbname = postfixadmin | ||
| - | table = mailbox | ||
| - | select_field = CONCAT(domain, | ||
| - | where_field = username | ||
| - | additional_conditions = and active = ' | ||
| - | |||
| - | Création du fichier qui contient les directives pour " | ||
| - | [[: | ||
| - | |||
| - | <file txt header_checks>/ | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | |||
| - | Fichier de configuration principale de Postfix qui contient un bon nombre de choix complexes et des options sur la façon dont le courrier est relayé et comment se comporte SMTP. Pour affiner votre configuration, | ||
| - | <note important> | ||
| - | [[: | ||
| - | |||
| - | <file txt main.cf># | ||
| - | |||
| - | # The first text sent to a connecting process. | ||
| - | smtpd_banner = $myhostname ESMTP $mail_name | ||
| - | biff = no | ||
| - | # appending .domain is the MUA's job. | ||
| - | append_dot_mydomain = no | ||
| - | readme_directory = no | ||
| - | |||
| - | # SASL parameters | ||
| - | # --------------------------------- | ||
| - | |||
| - | # Use Dovecot to authenticate. | ||
| - | smtpd_sasl_type = dovecot | ||
| - | # Referring to / | ||
| - | smtpd_sasl_path = private/ | ||
| - | smtpd_sasl_auth_enable = yes | ||
| - | broken_sasl_auth_clients = yes | ||
| - | smtpd_sasl_security_options = noanonymous | ||
| - | smtpd_sasl_local_domain = | ||
| - | smtpd_sasl_authenticated_header = yes | ||
| - | |||
| - | # TLS parameters | ||
| - | # --------------------------------- | ||
| - | |||
| - | # Replace this with your SSL certificate path if you are using one. | ||
| - | smtpd_tls_cert_file=/ | ||
| - | smtpd_tls_key_file=/ | ||
| - | # The snakeoil self-signed certificate has no need for a CA file. But | ||
| - | # if you are using your own SSL certificate, | ||
| - | # a CA certificate bundle from your provider. The path to that goes | ||
| - | # here. | ||
| - | # | ||
| - | smtpd_use_tls=yes | ||
| - | smtp_tls_security_level = may | ||
| - | smtpd_tls_security_level = may | ||
| - | # | ||
| - | smtp_tls_note_starttls_offer = yes | ||
| - | smtpd_tls_loglevel = 1 | ||
| - | smtpd_tls_received_header = yes | ||
| - | smtpd_tls_session_cache_timeout = 3600s | ||
| - | tls_random_source = dev:/ | ||
| - | # | ||
| - | # | ||
| - | |||
| - | # See / | ||
| - | # information on enabling SSL in the smtp client. | ||
| - | |||
| - | # SMTPD parameters | ||
| - | # --------------------------------- | ||
| - | |||
| - | # Uncomment the next line to generate " | ||
| - | # | ||
| - | # will it be a permanent error or temporary | ||
| - | unknown_local_recipient_reject_code = 450 | ||
| - | # how long to keep message on queue before return as failed. | ||
| - | # some have 3 days, I have 16 days as I am backup server for some people | ||
| - | # whom go on holiday with their server switched off. | ||
| - | maximal_queue_lifetime = 7d | ||
| - | # max and min time in seconds between retries if connection failed | ||
| - | minimal_backoff_time = 1000s | ||
| - | maximal_backoff_time = 8000s | ||
| - | # how long to wait when servers connect before receiving rest of data | ||
| - | smtp_helo_timeout = 60s | ||
| - | # how many address can be used in one message. | ||
| - | # effective stopper to mass spammers, accidental copy in whole address list | ||
| - | # but may restrict intentional mail shots. | ||
| - | smtpd_recipient_limit = 16 | ||
| - | # how many error before back off. | ||
| - | smtpd_soft_error_limit = 3 | ||
| - | # how many max errors before blocking it. | ||
| - | smtpd_hard_error_limit = 12 | ||
| - | |||
| - | # This next set are important for determining who can send mail and relay mail | ||
| - | # to other servers. It is very important to get this right - accidentally producing | ||
| - | # an open relay that allows unauthenticated sending of mail is a Very Bad Thing. | ||
| - | # | ||
| - | # You are encouraged to read up on what exactly each of these options accomplish. | ||
| - | |||
| - | # Requirements for the HELO statement | ||
| - | smtpd_helo_restrictions = permit_mynetworks, | ||
| - | # Requirements for the sender details | ||
| - | smtpd_sender_restrictions = permit_sasl_authenticated, | ||
| - | # Requirements for the connecting server | ||
| - | # Attention MODIFICATION de la config proposée. | ||
| - | # ------------------------------------------------------------- | ||
| - | # Le serveur de blacklist dnsbl.njabl.org n'est plus en service depuis mars 2013 - Voir [[http:// | ||
| - | # Donc remplacer la ligne suivante | ||
| - | # smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, | ||
| - | # Par la nouvelle ligne | ||
| - | smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, | ||
| - | # Requirement for the recipient address. Note that the entry for | ||
| - | # " | ||
| - | smtpd_recipient_restrictions = reject_unauth_pipelining, | ||
| - | smtpd_data_restrictions = reject_unauth_pipelining | ||
| - | |||
| - | # require proper helo at connections | ||
| - | smtpd_helo_required = yes | ||
| - | # waste spammers time before rejecting them | ||
| - | smtpd_delay_reject = yes | ||
| - | disable_vrfy_command = yes | ||
| - | |||
| - | # General host and delivery info | ||
| - | # ---------------------------------- | ||
| - | |||
| - | myhostname = votre_domaine_principal.tld | ||
| - | myorigin = / | ||
| - | mydestination = localhost | ||
| - | #relayhost = | ||
| - | # If you have a separate web server that sends outgoing mail through this | ||
| - | # mailserver, you may want to add its IP address to the space-delimited list in | ||
| - | # mynetworks, e.g. as 111.222.333.444/ | ||
| - | mynetworks = 127.0.0.0/8 [:: | ||
| - | mailbox_size_limit = 0 | ||
| - | recipient_delimiter = + | ||
| - | inet_interfaces = all | ||
| - | mynetworks_style = host | ||
| - | |||
| - | # This specifies where the virtual mailbox folders will be located. | ||
| - | virtual_mailbox_base = /home/vmail | ||
| - | # This is for the mailbox location for each user. The domainaliases | ||
| - | # map allows us to make use of Postfix Admin' | ||
| - | virtual_mailbox_maps = mysql:/ | ||
| - | # and their user id | ||
| - | virtual_uid_maps = static:150 | ||
| - | # and group id | ||
| - | virtual_gid_maps = static:1001 | ||
| - | # This is for aliases. The domainaliases map allows us to make | ||
| - | # use of Postfix Admin' | ||
| - | virtual_alias_maps = mysql:/ | ||
| - | # This is for domain lookups. | ||
| - | virtual_mailbox_domains = mysql:/ | ||
| - | |||
| - | # Integration with other packages | ||
| - | # --------------------------------------- | ||
| - | |||
| - | # Tell postfix to hand off mail to the definition for dovecot in master.cf | ||
| - | virtual_transport = dovecot | ||
| - | dovecot_destination_recipient_limit = 1 | ||
| - | |||
| - | # Use amavis for virus and spam scanning | ||
| - | content_filter = amavis: | ||
| - | |||
| - | # Header manipulation | ||
| - | # -------------------------------------- | ||
| - | |||
| - | # Getting rid of unwanted headers. See: https:// | ||
| - | header_checks = regexp:/ | ||
| - | # getting rid of x-original-to | ||
| - | enable_original_recipient = no</ | ||
| - | |||
| - | [[: | ||
| - | Notez le " | ||
| - | |||
| - | <file txt master.cf># | ||
| - | # Postfix master process configuration file. For details on the format | ||
| - | # of the file, see the master(5) manual page (command: "man 5 master" | ||
| - | # | ||
| - | # Do not forget to execute " | ||
| - | # | ||
| - | # ========================================================================== | ||
| - | # service type private unpriv | ||
| - | # | ||
| - | # ========================================================================== | ||
| - | smtp inet n | ||
| - | 5025 inet n | ||
| - | #smtp inet n | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | #submission inet n | ||
| - | # -o syslog_name=postfix/ | ||
| - | # -o smtpd_tls_security_level=encrypt | ||
| - | # -o smtpd_sasl_auth_enable=yes | ||
| - | # -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| - | # -o milter_macro_daemon_name=ORIGINATING | ||
| - | # | ||
| - | # -o syslog_name=postfix/ | ||
| - | # -o smtpd_tls_wrappermode=yes | ||
| - | # -o smtpd_sasl_auth_enable=yes | ||
| - | # -o smtpd_tls_auth_only=yes | ||
| - | # -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| - | # -o smtpd_sasl_security_options=noanonymous, | ||
| - | # -o smtpd_sasl_tls_security_options=noanonymous | ||
| - | # -o milter_macro_daemon_name=ORIGINATING | ||
| - | #628 | ||
| - | pickup | ||
| - | -o content_filter= | ||
| - | -o receive_override_options=no_header_body_checks | ||
| - | cleanup | ||
| - | qmgr fifo n | ||
| - | #qmgr | ||
| - | tlsmgr | ||
| - | rewrite | ||
| - | bounce | ||
| - | defer | ||
| - | trace | ||
| - | verify | ||
| - | flush | ||
| - | proxymap | ||
| - | proxywrite unix - | ||
| - | smtp unix - | ||
| - | relay | ||
| - | # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 | ||
| - | showq | ||
| - | error | ||
| - | retry | ||
| - | discard | ||
| - | local | ||
| - | virtual | ||
| - | lmtp unix - | ||
| - | anvil | ||
| - | scache | ||
| - | # | ||
| - | # ==================================================================== | ||
| - | # Interfaces to non-Postfix software. Be sure to examine the manual | ||
| - | # pages of the non-Postfix software to find out what options it wants. | ||
| - | # | ||
| - | # Many of the following services use the Postfix pipe(8) delivery | ||
| - | # agent. | ||
| - | # and other message envelope options. | ||
| - | # ==================================================================== | ||
| - | # | ||
| - | # maildrop. See the Postfix MAILDROP_README file for details. | ||
| - | # Also specify in main.cf: maildrop_destination_recipient_limit=1 | ||
| - | # | ||
| - | maildrop | ||
| - | flags=DRhu user=vmail argv=/ | ||
| - | # | ||
| - | # ==================================================================== | ||
| - | # | ||
| - | # Recent Cyrus versions can use the existing " | ||
| - | # | ||
| - | # Specify in cyrus.conf: | ||
| - | # | ||
| - | # | ||
| - | # Specify in main.cf one or more of the following: | ||
| - | # mailbox_transport = lmtp: | ||
| - | # virtual_transport = lmtp: | ||
| - | # | ||
| - | # ==================================================================== | ||
| - | # | ||
| - | # Cyrus 2.1.5 (Amos Gouaux) | ||
| - | # Also specify in main.cf: cyrus_destination_recipient_limit=1 | ||
| - | # | ||
| - | # | ||
| - | # user=cyrus argv=/ | ||
| - | # | ||
| - | # ==================================================================== | ||
| - | # Old example of delivery via Cyrus. | ||
| - | # | ||
| - | #old-cyrus unix - | ||
| - | # flags=R user=cyrus argv=/ | ||
| - | # | ||
| - | # ==================================================================== | ||
| - | # | ||
| - | # See the Postfix UUCP_README file for configuration details. | ||
| - | # | ||
| - | uucp unix - | ||
| - | flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) | ||
| - | # | ||
| - | # Other external delivery methods. | ||
| - | # | ||
| - | ifmail | ||
| - | flags=F user=ftn argv=/ | ||
| - | bsmtp | ||
| - | flags=Fq. user=bsmtp argv=/ | ||
| - | scalemail-backend unix - | ||
| - | flags=R user=scalemail argv=/ | ||
| - | mailman | ||
| - | flags=FR user=list argv=/ | ||
| - | ${nexthop} ${user} | ||
| - | |||
| - | # | ||
| - | # The next two entries integrate with Amavis for anti-virus/ | ||
| - | # | ||
| - | amavis | ||
| - | -o smtp_data_done_timeout=1200 | ||
| - | -o smtp_send_xforward_command=yes | ||
| - | -o disable_dns_lookups=yes | ||
| - | -o max_use=20 | ||
| - | 127.0.0.1: | ||
| - | -o content_filter= | ||
| - | -o local_recipient_maps= | ||
| - | -o relay_recipient_maps= | ||
| - | -o smtpd_restriction_classes= | ||
| - | -o smtpd_delay_reject=no | ||
| - | -o smtpd_client_restrictions=permit_mynetworks, | ||
| - | -o smtpd_helo_restrictions= | ||
| - | -o smtpd_sender_restrictions= | ||
| - | -o smtpd_recipient_restrictions=permit_mynetworks, | ||
| - | -o smtpd_data_restrictions=reject_unauth_pipelining | ||
| - | -o smtpd_end_of_data_restrictions= | ||
| - | -o mynetworks=127.0.0.0/ | ||
| - | -o smtpd_error_sleep_time=0 | ||
| - | -o smtpd_soft_error_limit=1001 | ||
| - | -o smtpd_hard_error_limit=1000 | ||
| - | -o smtpd_client_connection_count_limit=0 | ||
| - | -o smtpd_client_connection_rate_limit=0 | ||
| - | -o receive_override_options=no_header_body_checks, | ||
| - | |||
| - | # | ||
| - | # Integration with Dovecot - hand mail over to it for local delivery, and | ||
| - | # run the process under the vmail user and mail group. | ||
| - | # | ||
| - | dovecot | ||
| - | flags=DRhu user=vmail: | ||
| - | | ||
| - | =====Ouvrir les ports===== | ||
| - | |||
| - | Dans le cas où vous utilisez ufw et qu'il est activé, vous devez ouvrir : | ||
| - | < | ||
| - | sudo ufw allow pop3 # Port 110 | ||
| - | sudo ufw allow imap2 # Port 143 | ||
| - | sudo ufw allow imaps # Port 993 | ||
| - | sudo ufw allow smtp # Port 25 | ||
| - | sudo ufw allow pop3s # Port 995 | ||
| - | sudo ufw allow 5025/ | ||
| - | </ | ||
| - | |||
| - | =====Relancer tous les services===== | ||
| - | |||
| - | < | ||
| - | sudo service spamassassin restart | ||
| - | sudo service clamav-daemon restart | ||
| - | sudo service amavis restart | ||
| - | sudo service dovecot restart</ | ||
| - | |||
| - | =====Postfixadmin===== | ||
| - | |||
| - | ====Configuration==== | ||
| - | |||
| - | =====Liens===== | ||
| - | * [[http:// | ||
| - | |||
| - | ---- | ||
| - | // | ||
