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 | ||
| dbmail [Le 28/10/2012, 08:56] – [SASL] titouan | dbmail [Le 02/03/2023, 00:34] (Version actuelle) – Ajout tag sefran | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | {{tag> | + | {{tag> |
| ---- | ---- | ||
| Ligne 12: | Ligne 12: | ||
| < | < | ||
| * Expérience vivement recommandée en LAMP et SSH, pour une meilleure méthodologie et débogage | * Expérience vivement recommandée en LAMP et SSH, pour une meilleure méthodologie et débogage | ||
| - | * Etablir une connexion internet sur votre serveur, ne vous pose pas de problème. | ||
| - | < | ||
| * Cas particuliers auto-hébergement | * Cas particuliers auto-hébergement | ||
| Ligne 19: | Ligne 17: | ||
| ^ Cas ^ IP fixe ^dynamique | ^ Cas ^ IP fixe ^dynamique | ||
| ^1 | ^1 | ||
| - | ^2 | + | ^2 |
| ^3 | ^3 | ||
| - | ^4 | + | ^4 |
| - | ^4 | --------------------> | + | ^4 | --------------------> |
| - | ^5 | x | + | ^5 | x |
| - | ^6 | | | + | ^6 | | |
| légende; | légende; | ||
| >Cas 1,2,3 recommandés | >Cas 1,2,3 recommandés | ||
| ===== PostFix ===== | ===== PostFix ===== | ||
| - | + | * paquets | |
| - | Ajout à la fin de / | + | < |
| - | sudo vim /etc/postfix/master.cf | + | sudo apt-get install |
| - | dbmail-lmtp | + | sudo apt-get install libgsasl7 libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin cyrus-sasl2-dbg cyrus-sasl2-doc |
| + | sudo apt-get install php-auth-sasl php5-sasl libapache2-mod-authn-sasl | ||
| + | </ | ||
| === Configuration de postfix === | === Configuration de postfix === | ||
| - | sudo dpkg-reconfigure postfix | + | < |
| + | sudo dpkg-reconfigure postfix | ||
| + | </ | ||
| + | * Ajouter à la fin de sudo nano / | ||
| + | < | ||
| + | dbmail-lmtp | ||
| + | </ | ||
| === mailname main.cf === | === mailname main.cf === | ||
| - | sudo nano / | + | < |
| - | < | + | domain.tld</ |
| - | + | ||
| - | * domain.com est le domaine en tant que domaine de messagerie | + | |
| - | * smtp.domain.com est le CNAME ou alias du MX, ou MX lui même. | + | |
| - | * le mailto: toto@domain.com est alors possible | + | |
| - | NB: valable également pour un sous.domain.com en tant que domaine de messagerie | + | |
| + | * // | ||
| + | *// smtp.domain.tld// | ||
| + | * le mailto: // | ||
| + | NB: valable également pour un // | ||
| + | * /etc/hosts | ||
| + | < | ||
| + | 127.0.0.1 | ||
| + | # | ||
| + | # The following lines are desirable for IPv6 capable hosts | ||
| + | ::1 | ||
| + | fe00::0 ip6-localnet | ||
| + | ff00::0 ip6-mcastprefix | ||
| + | ff02::1 ip6-allnodes | ||
| + | ff02::2 ip6-allrouters | ||
| + | </ | ||
| + | Il n'est pas nécessaire de fixer // | ||
| + | < | ||
| + | smtp_host_lookup = native, dns | ||
| + | </ | ||
| + | * man hostname dnsdomainname | ||
| + | < | ||
| + | hostname -s # local_name | ||
| + | ce_que_vous_voulez | ||
| + | hostname -f # fqdn | ||
| + | www.mydomain.tld | ||
| + | hostname -d # domaine | ||
| + | mydomain.tld | ||
| + | </ | ||
| === main.cf === | === main.cf === | ||
| + | |||
| + | * méthode //virtual// | ||
| sudo nano / | sudo nano / | ||
| < | < | ||
| - | smtpd_banner | + | # maj 11 03 2013 |
| + | # Requis | ||
| + | alias_database | ||
| + | alias_maps = hash:/ | ||
| + | append_dot_mydomain = no | ||
| biff = no | biff = no | ||
| - | append_dot_mydomain = no | ||
| readme_directory = no | readme_directory = no | ||
| - | myhostname | + | config_directory |
| - | mydomain = domain.com | + | |
| - | mydestination = smtp.domain.com, | + | |
| - | + | ||
| - | # méthode virtual | + | |
| - | # supprimer mydestination, | + | |
| - | # relay_recipient_maps = mysql:/ | + | |
| - | + | ||
| - | myorigin = $mydomain | + | |
| - | relayhost = | + | |
| - | mynetworks = 127.0.0.0/ | + | |
| - | relay_domains = $mydestination | + | |
| - | mailbox_size_limit = 51200000 | + | |
| recipient_delimiter = + | recipient_delimiter = + | ||
| + | smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) | ||
| + | receive_override_options = no_address_mappings | ||
| + | |||
| inet_interfaces = all | inet_interfaces = all | ||
| - | inet_protocols = all | + | inet_protocols = ipv4 |
| - | smtpd_recipient_restrictions | + | |
| - | permit_auth_destination, | + | myhostname |
| - | permit_mynetworks, | + | mydomain = domain.tld |
| - | permit_sasl_authenticated, | + | mynetworks = 127.0.0.1 192.168.1.x 11.22.33.44 |
| - | reject_non_fqdn_hostname, | + | myorigin = $mydomain |
| - | reject_non_fqdn_sender, | + | mydestination = localhost |
| - | reject_non_fqdn_recipient, | + | relay_domains = $mydestination |
| - | reject_unauth_destination, | + | relay_recipient_maps = mysql:/ |
| - | reject_unauth_pipelining, | + | relayhost = |
| - | reject_invalid_hostname, | + | transport_maps = hash:/ |
| - | reject_rbl_client opm.blitzed.org, | + | |
| - | reject_rbl_client list.dsbl.org, | + | # Selon chaque config DNS |
| - | reject_rbl_client bl.spamcop.net, | + | smtp_host_lookup = native, dns |
| - | reject_rbl_client sbl-xbl.spamhaus.org | + | smtp_cname_overrides_servername = yes |
| - | reject | + | |
| + | # Requis Virtual | ||
| + | virtual_mailbox_domains = mysql:/ | ||
| + | virtual_mailbox_maps = mysql:/ | ||
| virtual_transport = dbmail-lmtp: | virtual_transport = dbmail-lmtp: | ||
| - | virtual_mailbox_domains = mysql:/ | ||
| - | virtual_mailbox_maps = mysql:/ | ||
| - | </ | ||
| - | Création de / | + | # Requis SASL |
| - | sudo vim / | + | broken_sasl_auth_clients = yes |
| + | smtp_sasl_auth_enable = yes | ||
| + | smtp_sasl_mechanism_filter = CRAM-MD5 PLAIN | ||
| + | smtp_sasl_password_maps = hash:/ | ||
| + | smtp_sasl_security_options = noanonymous | ||
| + | # | ||
| + | smtpd_sasl_auth_enable = yes | ||
| + | smtpd_sasl_authenticated_header = no | ||
| + | smtpd_sasl_local_domain = domain.tld list.domain.tld sous.domain.tld domain2.tld2 | ||
| + | smtpd_sasl_path = smtpd | ||
| + | smtpd_sasl_security_options = noanonymous | ||
| + | smtpd_sasl_type = cyrus | ||
| + | |||
| + | # Requis STARTTLS/ | ||
| + | smtp_tls_CAfile = / | ||
| + | smtp_tls_CApath = / | ||
| + | smtp_tls_cert_file = / | ||
| + | smtp_tls_key_file = / | ||
| + | # | ||
| + | smtp_tls_scert_verifydepth = 2 | ||
| + | smtp_tls_security_level = may | ||
| + | smtp_tls_session_cache_database = btree: | ||
| + | smtp_tls_session_cache_timeout = 900s | ||
| + | smtp_use_tls = yes | ||
| + | |||
| + | smtpd_tls_CAfile = / | ||
| + | smtpd_tls_CApath = / | ||
| + | smtpd_tls_ask_ccert = yes | ||
| + | smtpd_tls_auth_only = yes | ||
| + | smtpd_tls_ccert_verifydepth = 2 | ||
| + | smtpd_tls_cert_file = / | ||
| + | smtpd_tls_key_file = / | ||
| + | smtpd_tls_loglevel = 2 | ||
| + | smtpd_tls_mandatory_ciphers = medium | ||
| + | smtpd_tls_mandatory_protocols = TLSv1, SSLv3 | ||
| + | smtpd_tls_received_header = no | ||
| + | smtpd_tls_session_cache_database = btree: | ||
| + | smtpd_tls_session_cache_timeout = 900s | ||
| + | smtpd_use_tls = yes | ||
| + | tls_random_source = dev:/ | ||
| + | |||
| + | # Options Restrictions | ||
| + | smtpd_sender_restrictions = permit_sasl_authenticated, | ||
| + | smtpd_recipient_restrictions = permit_sasl_authenticated, | ||
| + | |||
| + | # Option x509 client | ||
| + | relay_clientcerts = hash:/ | ||
| + | |||
| + | # Option Limites | ||
| + | bounce_queue_lifetime = 36h | ||
| + | maximal_queue_lifetime = 36h | ||
| + | smtp_destination_concurrency_limit = 5 | ||
| + | smtp_destination_rate_delay = 1 | ||
| + | local_destination_concurrency_limit = 5 | ||
| + | default_destination_concurrency_limit = 10 | ||
| + | default_destination_recipient_limit = 25 | ||
| + | virtual_destination_concurrency_limit = 10 | ||
| + | virtual_destination_rate_delay = 1 | ||
| + | smtpd_client_connection_count_limit = 4 | ||
| + | smtpd_client_connection_rate_limit = 30 | ||
| + | smtpd_client_recipient_rate_limit = 30 | ||
| + | smtpd_error_sleep_time = 0 | ||
| + | smtpd_hard_error_limit = 4 | ||
| + | smtpd_recipient_limit = 30 | ||
| + | |||
| + | # Option clamsmtpd | ||
| + | content_filter = scan: | ||
| + | |||
| + | # Option dkim | ||
| + | milter_default_action = accept | ||
| + | milter_protocol = 2 | ||
| + | non_smtpd_milters = inet: | ||
| + | smtpd_milters = inet: | ||
| + | |||
| + | # Option Debogage Erreur Log | ||
| + | # sudo pflogsumm / | ||
| + | # master.cf | ||
| + | # smtp|submission|smtps | ||
| + | # smtp inet ... smtp -v | ||
| + | # postfix restart | ||
| + | # main.cf | ||
| + | # erreurs qui doivent être rapportées au postmaster | ||
| + | notify_classes = bounce, 2bounce, delay, policy, protocol, resource, software | ||
| + | #Ceci garde le message en file d' | ||
| + | #OK soft_bounce = yes | ||
| + | soft_bounce = no | ||
| + | debug_peer_list = 127.0.0.1 | ||
| + | debug_peer_level = 4 | ||
| + | smtpd_tls_loglevel = 3 | ||
| + | smtp_tls_loglevel = 3 | ||
| + | </ | ||
| + | |||
| + | sudo nano / | ||
| + | < | ||
| + | # | ||
| + | # 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 - n | ||
| + | -o content_filter=spamassassin: | ||
| + | -o cleanup_service_name=pre-cleanup | ||
| + | -o receive_override_options=no_unknown_recipient_checks, | ||
| + | -o smtpd_sasl_auth_enable=yes | ||
| + | -o smtp_connect_timeout=1 | ||
| + | -o smtp_destination_rate_delay=1 | ||
| + | submission | ||
| + | -o content_filter=spamassassin: | ||
| + | -o cleanup_service_name=pre-cleanup | ||
| + | -o receive_override_options=no_unknown_recipient_checks, | ||
| + | -o smtpd_tls_security_level=encrypt | ||
| + | -o smtpd_sasl_auth_enable=yes | ||
| + | -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| + | -o smtp_connect_timeout=1 | ||
| + | -o smtp_destination_rate_delay=1 | ||
| + | smtps | ||
| + | -o content_filter=spamassassin: | ||
| + | -o cleanup_service_name=pre-cleanup | ||
| + | -o receive_override_options=no_unknown_recipient_checks, | ||
| + | -o smtpd_tls_wrappermode=yes | ||
| + | -o smtpd_sasl_auth_enable=yes | ||
| + | -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| + | -o smtp_connect_timeout=1 | ||
| + | -o smtp_destination_rate_delay=1 | ||
| + | # -o milter_macro_daemon_name=ORIGINATING | ||
| + | #628 | ||
| + | pickup | ||
| + | -o cleanup_service_name=pre-cleanup | ||
| + | pre-cleanup unix n | ||
| + | -o virtual_alias_maps= | ||
| + | cleanup | ||
| + | -o mime_header_checks= | ||
| + | -o nested_header_checks= | ||
| + | -o body_checks= | ||
| + | -o header_checks= | ||
| + | qmgr fifo n | ||
| + | #qmgr | ||
| + | tlsmgr | ||
| + | rewrite | ||
| + | bounce | ||
| + | defer | ||
| + | trace | ||
| + | verify | ||
| + | flush | ||
| + | proxymap | ||
| + | proxywrite unix - | ||
| + | smtp unix - | ||
| + | direct | ||
| + | # When relaying mail as backup MX, disable fallback_relay to avoid MX loops | ||
| + | relay | ||
| + | showq | ||
| + | error | ||
| + | retry | ||
| + | discard | ||
| + | local | ||
| + | virtual | ||
| + | -o virtual_destination_rate_delay=1 | ||
| + | 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. | ||
| + | # ==================================================================== | ||
| + | # ... | ||
| + | # ... | ||
| + | # | ||
| + | # flags= | ||
| + | dbmail-lmtp | ||
| + | -o disable_dns_lookups=yes | ||
| + | # clamav clamsmtpd + spamassassin spamd | ||
| + | scan unix - | ||
| + | -o smtp_send_xforward_command=yes | ||
| + | 127.0.0.1: | ||
| + | -o content_filter= | ||
| + | -o receive_override_options=no_unknown_recipient_checks, | ||
| + | -o smtpd_helo_restrictions= | ||
| + | -o smtpd_client_restrictions= | ||
| + | -o smtpd_sender_restrictions= | ||
| + | -o smtpd_recipient_restrictions=permit_mynetworks, | ||
| + | -o mynetworks_style=host | ||
| + | -o smtpd_authorized_xforward_hosts=127.0.0.1 | ||
| + | spamassassin | ||
| + | user=spamassassin | ||
| + | mailman unix - | ||
| + | flags=FR user=list: | ||
| + | argv=/ | ||
| + | </ | ||
| + | |||
| + | === Dbmail sql query === | ||
| + | |||
| + | Création de / | ||
| + | sudo nano / | ||
| user = dbmail | user = dbmail | ||
| password = password | password = password | ||
| Ligne 98: | Ligne 325: | ||
| query | query | ||
| - | Création de / | + | Création de / |
| - | sudo vim / | + | sudo nano / |
| user = dbmail | user = dbmail | ||
| password = password | password = password | ||
| Ligne 106: | Ligne 333: | ||
| query | query | ||
| - | Redémarrage | + | Création de /etc/postfix/ |
| < | < | ||
| - | sudo /etc/init.d/ | + | sudo nano /etc/postfix/ |
| - | sudo postfix reload | + | user = dbmail |
| + | password = password | ||
| + | hosts = 127.0.0.1 | ||
| + | dbname | ||
| + | query = SELECT alias FROM dbmail_aliases WHERE alias=' | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Envoyer Directement === | ||
| + | |||
| + | * relayhost= | ||
| + | * renseigner transport_maps | ||
| + | |||
| + | * transport_maps = hash:/ | ||
| + | < | ||
| + | sudo nano / | ||
| + | mydomain.tld | ||
| + | # | ||
| + | </ | ||
| + | < | ||
| + | sudo postmap hash:/ | ||
| + | </ | ||
| + | |||
| + | * / | ||
| + | < | ||
| + | www postfix/ | ||
| + | </ | ||
| + | |||
| + | === Envoyer Indirectement (par relais) === | ||
| + | |||
| + | * relayhost=[smtp.sfr.fr]: | ||
| + | * ou relayhost= | ||
| + | |||
| + | * si le relais nécessite une // | ||
| + | < | ||
| + | sudo nano / | ||
| + | [smtp.sfr.fr]: | ||
| + | </ | ||
| + | sudo postmap hash:/ | ||
| + | |||
| + | < | ||
| + | sudo nano / | ||
| + | #cas 1 | ||
| + | # | ||
| + | mydomain.tld | ||
| + | #cas 2 | ||
| + | #gmail.com smtp: | ||
| + | # | ||
| + | # cas 3 | ||
| + | * | ||
| + | </ | ||
| + | sudo postmap hash:/ | ||
| + | |||
| + | * exemples; | ||
| + | < | ||
| + | expéditeur -> destinataire (transport) | ||
| + | toto@mydomain.tld envoie un mail vers tata@mydomain.tld | ||
| + | toto@mydomain.tld envoie un mail vers polo@gmail.com en utilisant le relais [smtp.gmail.com]: | ||
| + | toto@mydomain.tld envoie un mail vers arthur@orange.fr en utilisant le [smtp.sfr.fr]: | ||
| + | </ | ||
| + | |||
| + | * / | ||
| + | < | ||
| + | www postfix/ | ||
| + | </ | ||
| + | |||
| + | == SMTP accès à partir | ||
| + | |||
| + | D' | ||
| + | - Interdit: depuis l' | ||
| + | - Autorisé : en 127.0.0.1, pas d' | ||
| + | - filtrage spamd clamsmtpd | ||
| + | |||
| + | * Serveur Sortant: smtp.domain.tld | ||
| + | * Port : 25, | ||
| + | * Nom utilisateur: | ||
| + | * Méthode d' | ||
| + | * Sécurité de la connexion : STARTTLS, TLS/SSL | ||
| + | |||
| + | ==x509 client== | ||
| + | |||
| + | * **Connexion forte** | ||
| + | a/ Si un certficat x509 client (format .p12) dans le magasin des certificats de thunderbird est associé à toto@domain.tld, | ||
| + | < | ||
| + | sudo nano / | ||
| + | A8: | ||
| + | </ | ||
| + | L' | ||
| + | |||
| + | b/ Cela ouvre la possibilité d' | ||
| + | Par exemple en adaptant un port existant ou en ajoutant; | ||
| + | |||
| + | < | ||
| + | 5678 inet n | ||
| + | -o content_filter=spamassassin: | ||
| + | -o receive_override_options=no_unknown_recipient_checks, | ||
| + | -o smtpd_sasl_auth_enable=no | ||
| + | -o smtp_sasl_auth_enable=no | ||
| + | -o smtpd_enforce_tls=yes | ||
| + | -o smtpd_tls_ask_ccert=yes | ||
| + | -o smtpd_tls_req_ccert=yes | ||
| + | -o smtpd_client_restrictions=permit_tls_clientcerts, | ||
| + | -o smtpd_relay_restrictions=permit_tls_clientcerts, | ||
| + | -o smtpd_sender_restrictions=reject_unlisted_sender, | ||
| + | </ | ||
| + | Au niveau du MUA type thunderbird, | ||
| + | -nom du serveur SMTP= smtp.domain.tld | ||
| + | -Port= 5678 | ||
| + | -Nom utilisateur= non spécifié | ||
| + | -Méthode d' | ||
| + | -Sécurité de la connexion= STARTTLS obligatoire | ||
| + | |||
| + | //telnet avec x509client// | ||
| + | < | ||
| + | openssl s_client -connect smtp.domain.tld: | ||
| + | .... | ||
| + | Acceptable client certificate | ||
| + | </ | ||
| + | Pour le telnet, il faut le format certificat.pem et key.pem au lieu du p12 | ||
| + | |||
| + | //telnet sans x509client// | ||
| + | < | ||
| + | openssl s_client -connect smtp.domain.tld: | ||
| + | ... | ||
| + | No client certificate presented | ||
| + | </ | ||
| + | La session échoue après le ehlo. | ||
| + | |||
| + | * **Signature forte** | ||
| + | Pour signer votre mail, il vous faut le format .p12 (pkcs12). La signature sera traduite en pkcs7. | ||
| + | |||
| + | * **Chiffrement fort** | ||
| + | Pour chiffrer un mail en utilisant une authentification forte, il faut le x509 client du destinataire au format pem, sans sa clef privée. Si Toto veut envoyer un mail chiffré (SMIME pkcs7) à Tata, alors toto doit avoir dans le magasin des certficats x509 thunderbird: | ||
| + | |||
| + | == Service == | ||
| + | |||
| + | < | ||
| + | sudo postfix | ||
| </ | </ | ||
| Ligne 116: | Ligne 480: | ||
| ===== Dbmail 3.x ===== | ===== Dbmail 3.x ===== | ||
| - | * prend désormais en charge imaps | + | * gestion et stockage via les tables mysql, postgresql, oracle |
| - | | + | |
| * adapté à la messagerie de masse et aux méthodes virtuelles de Postfix. | * adapté à la messagerie de masse et aux méthodes virtuelles de Postfix. | ||
| - | * les tables mysql ou postgresql sont également incompatibles avec celles de dbmail 2.2 | + | |
| sudo nano / | sudo nano / | ||
| < | < | ||
| - | # squeeze | + | # stable all deb |
| - | deb http:// | + | deb http:// |
| # sid | # sid | ||
| deb http:// | deb http:// | ||
| # lucid | # lucid | ||
| deb http:// | deb http:// | ||
| - | #precise oneiric maverick lucid hardy | + | # ppa Leonel Nunez |
| deb http:// | deb http:// | ||
| deb-src http:// | deb-src http:// | ||
| Ligne 135: | Ligne 497: | ||
| < | < | ||
| < | < | ||
| - | **[[apt:// | + | |
| [[http:// | [[http:// | ||
| Ligne 142: | Ligne 504: | ||
| * / | * / | ||
| < | < | ||
| - | * Chacun des appels apt-get va se plaindre de dépendances manquantes. Juste les installer manuellement, | + | * Chacun des appels apt-get va se plaindre de dépendances manquantes |
| < | < | ||
| sudo apt-get -b source libsieve | sudo apt-get -b source libsieve | ||
| Ligne 152: | Ligne 514: | ||
| </ | </ | ||
| - | ==== Dbmail 2.2 ==== | + | === build-from-tar.tgz=== |
| - | Présent normalement dans les dépôts. | + | |
| - | **[[apt://dbmail,dbmail-mysql|]]**. | + | * Installer les lib-dev relatives à GLIB, GMIME, SIEVE, MHASH, ZDB, LIBEVENT (*note) |
| + | < | ||
| + | ./configure --with-zdb=/ | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | make all | ||
| + | sudo make install | ||
| + | </ | ||
| + | Les fichiers sont copiés par défault dans / | ||
| + | |||
| + | |||
| + | ==== Dbmail 2.2 (obsolète)==== | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| ==== dbmail 3.0 ==== | ==== dbmail 3.0 ==== | ||
| - | [[http:// | + | [[http:// |
| Ligne 207: | Ligne 599: | ||
| * -a //ajouter un nouveau Compte// | * -a //ajouter un nouveau Compte// | ||
| * -w //mot de passe// | * -w //mot de passe// | ||
| - | * -p // | + | * -p // |
| * -c //mise à jour du compte// | * -c //mise à jour du compte// | ||
| * -s //créer// une adresse mail ou plusieurs alias -s toto@domain.tld, | * -s //créer// une adresse mail ou plusieurs alias -s toto@domain.tld, | ||
| * -S // | * -S // | ||
| - | * -m //quota// -m 50M | + | * -m //quota// -m 50M |
| * -d // | * -d // | ||
| * -x toto@domain.tld -t forward@domain2.tld2 | * -x toto@domain.tld -t forward@domain2.tld2 | ||
| Ligne 230: | Ligne 622: | ||
| http:// | http:// | ||
| - | | + | |
| - | Dbmail utilise saslauthd comme démon d' | + | Dbmail utilise saslauthd comme démon d' |
| - | Rimap (Requête d' | + | Rimap (Requête d' |
| Pam n'est pas vraiment adapté pour la messagerie de masse et il y a toujours moyen de convertir un user unix/pam en virtual/ | Pam n'est pas vraiment adapté pour la messagerie de masse et il y a toujours moyen de convertir un user unix/pam en virtual/ | ||
| Ligne 261: | Ligne 653: | ||
| OPTIONS=" | OPTIONS=" | ||
| </ | </ | ||
| - | * Service | + | * Service |
| < | < | ||
| sudo service saslauthd restart|reload | sudo service saslauthd restart|reload | ||
| Ligne 268: | Ligne 660: | ||
| === main.cf === | === main.cf === | ||
| à titre d' | à titre d' | ||
| - | < | + | |
| - | broken_sasl_auth_clients = yes | + | |
| - | smtp_sasl_auth_enable = yes | + | |
| - | smtp_sasl_password_maps = hash:/ | + | |
| - | smtp_sasl_security_options = noanonymous | + | |
| - | smtpd_recipient_restrictions = permit_auth_destination, | + | |
| - | smtpd_sasl_auth_enable = yes | + | |
| - | smtpd_sasl_authenticated_header = no | + | |
| - | smtpd_sasl_local_domain = domain.tld | + | |
| - | smtpd_sasl_path = smtpd | + | |
| - | smtpd_sasl_security_options = noanonymous | + | |
| - | smtpd_sasl_type = cyrus | + | |
| - | </ | + | |
| == smtp_sasl_password_maps == | == smtp_sasl_password_maps == | ||
| Sert principalement à s' | Sert principalement à s' | ||
| Ligne 288: | Ligne 668: | ||
| < | < | ||
| [11.22.22.44]: | [11.22.22.44]: | ||
| - | smtp.gmail.com: | + | [smtp.gmail.com]:587 compte@gmail.com: |
| </ | </ | ||
| < | < | ||
| - | sudo postmap | + | sudo postmap / |
| sudo postconf -e ' | sudo postconf -e ' | ||
| </ | </ | ||
| === master.cf === | === master.cf === | ||
| - | la même chose pour smtp, | + | |
| < | < | ||
| submission | submission | ||
| Ligne 301: | Ligne 681: | ||
| -o smtpd_sasl_auth_enable=yes | -o smtpd_sasl_auth_enable=yes | ||
| -o smtpd_client_restrictions=permit_sasl_authenticated, | -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
| - | ... | ||
| </ | </ | ||
| + | Optionnellement, | ||
| + | |||
| ==== Mise en place du CRAM-MD5 ==== | ==== Mise en place du CRAM-MD5 ==== | ||
| - | - authentification en clair : PLAIN, LOGIN (rétro-compatibilité) | + | - authentification en clair : PLAIN, LOGIN |
| - | - authentifcation | + | - authentifcation |
| * le mech_list n'a aucun rapport avec le type de stockage des mots de passe. | * le mech_list n'a aucun rapport avec le type de stockage des mots de passe. | ||
| - | * cram-md5 a un stockage // | + | * cram-md5 a un stockage // |
| [[http:// | [[http:// | ||
| < | < | ||
| sudo dbmail-users -c toto@domain.tld -p plaintext -w password | sudo dbmail-users -c toto@domain.tld -p plaintext -w password | ||
| </ | </ | ||
| - | * / | + | * / |
| < | < | ||
| sudo ln -s / | sudo ln -s / | ||
| Ligne 329: | Ligne 710: | ||
| < | < | ||
| pwcheck_method: | pwcheck_method: | ||
| - | mech_list: CRAM-MD5 | + | mech_list: CRAM-MD5 |
| auxprop_plugin: | auxprop_plugin: | ||
| + | log_level: 2 | ||
| sql_engine: mysql | sql_engine: mysql | ||
| sql_hostnames: | sql_hostnames: | ||
| Ligne 337: | Ligne 719: | ||
| sql_database: | sql_database: | ||
| sql_verbose: | sql_verbose: | ||
| - | sql_select: SELECT passwd FROM dbmail_users WHERE userid = '%u'@'%r' | + | sql_select: SELECT passwd FROM dbmail_users WHERE userid = ' |
| </ | </ | ||
| - | [[http:// | + | NB: userid = ' |
| + | [[http:// | ||
| - | * / | + | * postfix main.cf |
| - | AUTH=LOGIN AUTH=CRAM-MD5 | + | |
| < | < | ||
| - | ... | + | smtp_sasl_mechanism_filter |
| - | # Provide a CAPABILITY to override the default | + | |
| - | # | + | |
| - | # capability = IMAP4 IMAP4rev1 AUTH=LOGIN ACL RIGHTS=texk NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE | + | |
| - | ... | + | |
| </ | </ | ||
| - | * postfix main.cf | + | * / |
| < | < | ||
| - | smtp_sasl_mechanism_filter = cram-md5 login | + | postfix/ |
| + | postfix/ | ||
| </ | </ | ||
| - | | + | |
| + | | ||
| < | < | ||
| sudo testsaslauthd -f / | sudo testsaslauthd -f / | ||
| 0: OK " | 0: OK " | ||
| </ | </ | ||
| - | === test avec roundcube | + | * test avec roundcube |
| < | < | ||
| 18:49:46 www roundcube: [77EB] C: A0001 ID (" | 18:49:46 www roundcube: [77EB] C: A0001 ID (" | ||
| Ligne 366: | Ligne 746: | ||
| 18:49:46 www roundcube: [77EB] C: A0002 AUTHENTICATE CRAM-MD5 | 18:49:46 www roundcube: [77EB] C: A0002 AUTHENTICATE CRAM-MD5 | ||
| 18:49:46 www roundcube: [77EB] S: + MTM0MzA2MjE4Ni4xOTIzMy4yNkAobm9uZSk= | 18:49:46 www roundcube: [77EB] S: + MTM0MzA2MjE4Ni4xOTIzMy4yNkAobm9uZSk= | ||
| - | 18:49:46 www roundcube: [77EB] C: ZXJyb3JAbS50aXRvdS5pbmZvIDczZmQwYmY4NWNiZjQ3YTM3YjliYzNhMWYwOTA5Nzcy | + | 18:49:46 www roundcube: [77EB] C: dG90b0Bkb21haW4udGxkIDI1NmMyNmIxYmY4MjE5YjJlZjUxMTNlNTVjYjAwYmFk |
| 18:49:46 www roundcube: [77EB] S: A0002 OK [CAPABILITY IMAP4rev1 ACL RIGHTS=texk NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE | 18:49:46 www roundcube: [77EB] S: A0002 OK [CAPABILITY IMAP4rev1 ACL RIGHTS=texk NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE | ||
| STARTTLS ID] User toto@domain.tld authenticated | STARTTLS ID] User toto@domain.tld authenticated | ||
| Ligne 411: | Ligne 791: | ||
| sudo nano / | sudo nano / | ||
| < | < | ||
| - | yoko pierre.durand@gmail.com | + | yoko babar@monmail.com |
| - | yoko@domain.tld | + | yoko@domain.tld |
| </ | </ | ||
| < | < | ||
| Ligne 423: | Ligne 803: | ||
| yoko@pc:~$ echo ' | yoko@pc:~$ echo ' | ||
| </ | </ | ||
| - | yoko devient | + | yoko devient |
| === Recevoir et Faire Suivre automatiquement le courrier=== | === Recevoir et Faire Suivre automatiquement le courrier=== | ||
| - | le courrier à destination de toto@domain.tld est renvoyé chez durand.pierre@free.fr | + | le courrier à destination de toto@domain.tld est renvoyé chez casimir@free.fr |
| < | < | ||
| - | sudo dbmail-users -x toto@domain.tld -t durand.pierre@free.fr | + | sudo dbmail-users -x toto@domain.tld -t casimir@free.fr |
| </ | </ | ||
| Ligne 462: | Ligne 842: | ||
| # Configure the ISP accounts (POP server, users and respective passwords) | # Configure the ISP accounts (POP server, users and respective passwords) | ||
| poll imap.gmail.com with protocol IMAP: | poll imap.gmail.com with protocol IMAP: | ||
| - | user "pierre.durand@gmail.com" with pass " | + | user "babar@monmail.com" with pass " |
| smtphost smtp.domain.tld | smtphost smtp.domain.tld | ||
| </ | </ | ||
| [[http:// | [[http:// | ||
| - | Fetchmail relève toutes les heures les mails de pierre.durand@gmail.com et les rapatrie directement sur yoko@domain.tld. | + | Fetchmail relève toutes les heures les mails de babar@monmail.com et les rapatrie directement sur yoko@domain.tld. |
| * keep signifie que fetchmail crée une copie du mail sans le détruire sur le serveur distant. | * keep signifie que fetchmail crée une copie du mail sans le détruire sur le serveur distant. | ||
| * sender_canonical_maps a été défini. | * sender_canonical_maps a été défini. | ||
| * sudo service fetchmail restart # pour relançer le démon. | * sudo service fetchmail restart # pour relançer le démon. | ||
| - | Fetchmail fait un doublon, voir inutile, | + | Fetchmail fait un doublon, voir inutile, |
| * exemple en modifiant le main.inc.php de roundcube | * exemple en modifiant le main.inc.php de roundcube | ||
| Ligne 507: | Ligne 887: | ||
| </ | </ | ||
| - | Dès qu'un mail arrive chez modo@domain.tld(user_idnr=' | + | Dès qu'un mail arrive chez modo@domain.tld(user_idnr=' |
| Attention, autonotify@dbmail génère une erreur car évidemment le récipient n'est pas connu. | Attention, autonotify@dbmail génère une erreur car évidemment le récipient n'est pas connu. | ||
| Ligne 513: | Ligne 893: | ||
| ==== dbmail_auto_replies ==== | ==== dbmail_auto_replies ==== | ||
| - | Chaque utilisateur peut spécifier un message de réponse automatique à tous les messages entrants. | + | Chaque utilisateur peut spécifier un message de réponse automatique à tous les messages entrants. |
| >/ | >/ | ||
| AUTO_REPLY | AUTO_REPLY | ||
| Ligne 538: | Ligne 918: | ||
| Ces boîtes sont appelées boîtes aux lettres partagées - Elles sont décrites dans la table // | Ces boîtes sont appelées boîtes aux lettres partagées - Elles sont décrites dans la table // | ||
| - | Lister les identifiants et récupérer le user_idnr | + | Lister les identifiants et récupérer le user_idnr |
| < | < | ||
| select user_idnr, | select user_idnr, | ||
| Ligne 570: | Ligne 950: | ||
| DBMAIL[_dbmail_driver]=" | DBMAIL[_dbmail_driver]=" | ||
| </ | </ | ||
| - | modifier pour dbmail 3.x à proximité de function get_all_acls() | + | modifier pour dbmail 3.x à proximité de function get_all_acls() |
| < | < | ||
| $MYSQL_CLIENT -N -e " | $MYSQL_CLIENT -N -e " | ||
| Ligne 658: | Ligne 1038: | ||
| {{: | {{: | ||
| - | |||
| - | ==== #Anyone ==== | ||
| - | < | ||
| - | sudo dbmail-users -a open@domain.tld -s open@domain.tld -w open | ||
| - | sudo bash ~/ | ||
| - | </ | ||
| - | ajouter une adresse mail ' | ||
| - | < | ||
| - | insert into dbmail_aliases ( alias, deliver_to, client_idnr ) value ( ' | ||
| - | </ | ||
| - | {{: | ||
| ===== Mailman ===== | ===== Mailman ===== | ||
| ==== Ajouter les Recipients ==== | ==== Ajouter les Recipients ==== | ||
| - | C'est l' | + | C'est l' |
| sudo nano dbmail-add-list | sudo nano dbmail-add-list | ||
| Ligne 762: | Ligne 1131: | ||
| Ne pas oublier d' | Ne pas oublier d' | ||
| - | Exemple avec shorewall : | + | Exemple avec shorewall : |
| sudo vim / | sudo vim / | ||
| IMAP/ | IMAP/ | ||
| Ligne 769: | Ligne 1138: | ||
| redémarrage du pare-feu | redémarrage du pare-feu | ||
| sudo / | sudo / | ||
| + | |||
| + | ===== Auth Basic Apache SASL SMTP===== | ||
| + | |||
| + | Juste un extra de configuration, | ||
| + | |||
| + | * Ajouter sasldb à MECHANISMS dans le / | ||
| + | < | ||
| + | MECHANISMS=" | ||
| + | </ | ||
| + | / | ||
| + | < | ||
| + | pwcheck_method: | ||
| + | mech_list: CRAM-MD5 PLAIN LOGIN | ||
| + | saslauthd_path: | ||
| + | sasldb_path: | ||
| + | auxprop_plugin: | ||
| + | log_level: 7 | ||
| + | sql_engine: mysql | ||
| + | sql_hostnames: | ||
| + | sql_user: dbmail | ||
| + | sql_passwd: pass | ||
| + | sql_database: | ||
| + | sql_verbose: | ||
| + | sql_select: SELECT passwd FROM dbmail_users WHERE userid=' | ||
| + | </ | ||
| + | * Virtualhost apache | ||
| + | < | ||
| + | #requis saslauthd + sasldb | ||
| + | |||
| + | Alias / | ||
| + | < | ||
| + | ... | ||
| + | AuthType Basic | ||
| + | AuthName " | ||
| + | AuthBasicProvider sasl | ||
| + | AuthBasicAuthoritative On | ||
| + | AuthSaslPwcheckMethod sasldb | ||
| + | AuthSaslRealm domain.tld | ||
| + | AuthSaslDbPath / | ||
| + | AuthSaslServiceName smtp | ||
| + | Require user toto@domain.tld | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | sudo ln -s /etc/sasldb / | ||
| + | #creation de toto@domain.tld | ||
| + | sudo saslpasswd2 | ||
| + | #listing de la database | ||
| + | sudo sasldblistusers2 -f /etc/sasldb | ||
| + | </ | ||
| + | login: toto@domain.tld ; mot-de-passe: | ||
| + | |||
| + | ===== Auth Digest Apache dbmail_users ===== | ||
| + | |||
| + | Dans l' | ||
| + | |||
| + | Virtualhost avec mod_auth_digest, | ||
| + | < | ||
| + | DBDriver mysql | ||
| + | DBDParams " | ||
| + | DBDMin | ||
| + | DBDKeep 2 | ||
| + | DBDMax | ||
| + | DBDExptime 240 | ||
| + | |||
| + | Alias /example2 "/ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | Order allow,deny | ||
| + | Allow from all | ||
| + | AuthType Digest | ||
| + | AuthDigestAlgorithm MD5 | ||
| + | AuthName " | ||
| + | AuthDigestProvider dbd | ||
| + | Require valid-user | ||
| + | # passwd a été stocké en plaintext | ||
| + | AuthDBDUserRealmQuery " | ||
| + | </ | ||
| + | </ | ||
| + | |||
| ===== Voir aussi ===== | ===== Voir aussi ===== | ||
