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 27/02/2013, 03:42] – [postfix sasl] titouan | dbmail [Le 02/03/2023, 00:34] (Version actuelle) – Ajout tag sefran | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | {{tag> | + | {{tag> |
| ---- | ---- | ||
| Ligne 17: | 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 nano /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 === | ||
| < | < | ||
| - | domain.com</ | + | domain.tld</ |
| - | + | ||
| - | * // | + | |
| - | *// smtp.domain.com// | + | |
| - | * le mailto: // | + | |
| - | NB: valable également pour un // | + | |
| + | * // | ||
| + | *// smtp.domain.tld// | ||
| + | * le mailto: // | ||
| + | NB: valable également pour un // | ||
| + | * /etc/hosts | ||
| < | < | ||
| - | 127.0.0.1 www.domain.tld smtp.domain.com dynamic.noip.tld ... localhost | + | 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 // | + | Il n'est pas nécessaire de fixer // |
| < | < | ||
| smtp_host_lookup = native, dns | 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 === | ||
| Ligne 58: | Ligne 81: | ||
| sudo nano / | sudo nano / | ||
| < | < | ||
| - | # niveau 1 | + | # maj 11 03 2013 |
| - | smtpd_banner | + | # Requis |
| + | alias_database = hash:/ | ||
| + | alias_maps = hash:/ | ||
| + | append_dot_mydomain | ||
| biff = no | biff = no | ||
| + | readme_directory = no | ||
| + | config_directory = / | ||
| recipient_delimiter = + | recipient_delimiter = + | ||
| - | append_dot_mydomain | + | smtpd_banner |
| - | alias_database | + | receive_override_options |
| - | alias_maps = hash:/ | + | |
| - | smtp_host_lookup = native, dns | + | |
| - | myhostname = smtp.domain.com | + | inet_interfaces = all |
| - | mydomain = domain.com | + | inet_protocols = ipv4 |
| - | # supprimer mydestination, | + | |
| - | mydestination | + | myhostname = smtp.domain.tld |
| - | relay_domains = $mydestination | + | mydomain = domain.tld |
| - | relay_recipient_maps = mysql:/ | + | mynetworks |
| - | | + | |
| myorigin = $mydomain | myorigin = $mydomain | ||
| - | relayhost | + | mydestination |
| - | mynetworks | + | relay_domains |
| - | #transport_maps = hash:/ | + | relay_recipient_maps = mysql:/ |
| + | relayhost = | ||
| + | transport_maps = hash:/ | ||
| - | inet_interfaces = all | + | # Selon chaque config DNS |
| - | inet_protocols | + | smtp_host_lookup |
| - | smtpd_recipient_restrictions | + | smtp_cname_overrides_servername |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| + | # 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:/ | ||
| - | |||
| - | # Debogage Erreur Log | ||
| - | # master.cf | ||
| - | # smtp inet ... smtpd -v | ||
| - | # smtp inet ... smtp -v | ||
| - | # postfix restart :(reload insuffisant | ||
| - | |||
| - | # 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 | ||
| - | # | ||
| - | # | ||
| - | |||
| - | # SASL niveau 2 | ||
| - | # | ||
| - | smtp_sender_dependent_authentication = yes | ||
| + | # Requis SASL | ||
| broken_sasl_auth_clients = yes | broken_sasl_auth_clients = yes | ||
| smtp_sasl_auth_enable = yes | smtp_sasl_auth_enable = yes | ||
| Ligne 120: | Ligne 121: | ||
| smtp_sasl_password_maps = hash:/ | smtp_sasl_password_maps = hash:/ | ||
| smtp_sasl_security_options = noanonymous | smtp_sasl_security_options = noanonymous | ||
| + | # | ||
| smtpd_sasl_auth_enable = yes | smtpd_sasl_auth_enable = yes | ||
| smtpd_sasl_authenticated_header = no | smtpd_sasl_authenticated_header = no | ||
| - | smtpd_sasl_local_domain = domain.tld sous.domain.tld domain2.tld2 | + | smtpd_sasl_local_domain = domain.tld list.domain.tld sous.domain.tld domain2.tld2 |
| smtpd_sasl_path = smtpd | smtpd_sasl_path = smtpd | ||
| smtpd_sasl_security_options = noanonymous | smtpd_sasl_security_options = noanonymous | ||
| smtpd_sasl_type = cyrus | smtpd_sasl_type = cyrus | ||
| - | # tls niveau 3 | + | # Requis STARTTLS/ |
| - | smtp_tls_CAfile = /etc/.../...pem | + | smtp_tls_CAfile = / |
| - | smtp_tls_CApath = /etc/../ | + | smtp_tls_CApath = /etc/ssl/certs |
| - | smtp_tls_cert_file = /etc/.../...pem | + | smtp_tls_cert_file = / |
| - | smtp_tls_key_file = /etc/.../...pem | + | smtp_tls_key_file = / |
| + | # | ||
| + | smtp_tls_scert_verifydepth = 2 | ||
| smtp_tls_security_level = may | smtp_tls_security_level = may | ||
| smtp_tls_session_cache_database = btree: | smtp_tls_session_cache_database = btree: | ||
| + | smtp_tls_session_cache_timeout = 900s | ||
| smtp_use_tls = yes | smtp_use_tls = yes | ||
| - | smtpd_tls_CAfile = /etc/.../...pem | + | smtpd_tls_CAfile = / |
| - | smtpd_tls_CApath = /etc/.../ | + | smtpd_tls_CApath = /etc/ssl/certs |
| smtpd_tls_ask_ccert = yes | smtpd_tls_ask_ccert = yes | ||
| smtpd_tls_auth_only = yes | smtpd_tls_auth_only = yes | ||
| - | smtpd_tls_ccert_verifydepth = 1 | + | smtpd_tls_ccert_verifydepth = 2 |
| - | smtpd_tls_cert_file = /etc/.../...pem | + | smtpd_tls_cert_file = / |
| - | smtpd_tls_key_file = /etc/.../...pem | + | smtpd_tls_key_file = / |
| smtpd_tls_loglevel = 2 | smtpd_tls_loglevel = 2 | ||
| smtpd_tls_mandatory_ciphers = medium | smtpd_tls_mandatory_ciphers = medium | ||
| - | smtpd_tls_mandatory_protocols = SSLv3, | + | smtpd_tls_mandatory_protocols = TLSv1, SSLv3 |
| smtpd_tls_received_header = no | smtpd_tls_received_header = no | ||
| smtpd_tls_session_cache_database = btree: | smtpd_tls_session_cache_database = btree: | ||
| - | smtpd_tls_session_cache_timeout = 3600s | + | smtpd_tls_session_cache_timeout = 900s |
| smtpd_use_tls = yes | smtpd_use_tls = yes | ||
| tls_random_source = dev:/ | tls_random_source = dev:/ | ||
| - | # niveau 4 x509_client | + | # Options Restrictions |
| - | # relay_clientcerts = hash:/ | + | 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 | ||
| </ | </ | ||
| - | Création de / | + | sudo nano / |
| - | sudo vim / | + | < |
| + | # | ||
| + | # 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 | ||
| + | -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 164: | Ligne 325: | ||
| query | query | ||
| - | Création de / | + | Création de / |
| - | sudo vim / | + | sudo nano / |
| user = dbmail | user = dbmail | ||
| password = password | password = password | ||
| Ligne 172: | 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 182: | 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 201: | Ligne 497: | ||
| < | < | ||
| < | < | ||
| - | **[[apt:// | + | |
| [[http:// | [[http:// | ||
| Ligne 208: | 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 218: | 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 273: | 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 296: | 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 327: | Ligne 653: | ||
| OPTIONS=" | OPTIONS=" | ||
| </ | </ | ||
| - | * Service | + | * Service |
| < | < | ||
| sudo service saslauthd restart|reload | sudo service saslauthd restart|reload | ||
| Ligne 342: | Ligne 668: | ||
| < | < | ||
| [11.22.22.44]: | [11.22.22.44]: | ||
| - | smtp.gmail.com: | + | [smtp.gmail.com]:587 compte@gmail.com: |
| </ | </ | ||
| < | < | ||
| Ligne 361: | Ligne 687: | ||
| - authentification en clair : PLAIN, LOGIN | - 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 395: | Ligne 721: | ||
| sql_select: SELECT passwd FROM dbmail_users WHERE userid = ' | sql_select: SELECT passwd FROM dbmail_users WHERE userid = ' | ||
| </ | </ | ||
| - | NB: userid = ' | + | NB: userid = ' |
| [[http:// | [[http:// | ||
| - | * / | ||
| - | < | ||
| - | # Provide a CAPABILITY to override the default | ||
| - | capability = IMAP4 IMAP4rev1 AUTH=CRAM-MD5 AUTH=PLAIN ACL .... | ||
| - | </ | ||
| * postfix main.cf | * postfix main.cf | ||
| < | < | ||
| Ligne 418: | Ligne 739: | ||
| 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 425: | 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 470: | Ligne 791: | ||
| sudo nano / | sudo nano / | ||
| < | < | ||
| - | yoko pierre.durand@gmail.com | + | yoko babar@monmail.com |
| - | yoko@domain.tld | + | yoko@domain.tld |
| </ | </ | ||
| < | < | ||
| Ligne 482: | 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 521: | 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 566: | 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 572: | 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 597: | 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 629: | 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 721: | Ligne 1042: | ||
| ===== 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 810: | Ligne 1131: | ||
| Ne pas oublier d' | Ne pas oublier d' | ||
| - | Exemple avec shorewall : | + | Exemple avec shorewall : |
| sudo vim / | sudo vim / | ||
| IMAP/ | IMAP/ | ||
| Ligne 817: | 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 ===== | ||
