Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 03/09/2012, à 18:51

spectre3brad

Postfix + Dovecot + SSL/TLS

Bonjour,

a présent que mon Postfix fonctionne correctement (Mais sans le SSL/TLS pour le moment) je cherche a activer le IMAP et POP via Dovecot mais problème il n'accepte même pas la connexion ni en IMAP ni en POP (sans SSL/TLS pour commencer) testé depuis mon Thunderbird.

En finalité je cherche a obtenir les services SMTP/IMAP/POP en SSL/TLS.


Voici mes fichiers de configurations actuels:

Resultat de la commande 'postconf -n':

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
masquerade_domains = $mydomain
mydestination = tit-association.eu, nom-de-mon-serveur.mon-domaine.tld, localhost.mon-domaine.tld, localhost
mydomain = mon-domaine.tld
myhostname = nom-de-mon-serveur.mon-domaine.tld
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

Fichier dovecot.conf:

## Dovecot configuration file

# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration

# "doveconf -n" command gives a clean output of the changed settings. Use it
# instead of copy&pasting files when posting to the Dovecot mailing list.

# '#' character and everything after it is treated as comments. Extra spaces
# and tabs are ignored. If you want to use either of these explicitly, put the
# value inside quotes, eg.: key = "# char and trailing whitespace  "

# Default values are shown for each setting, it's not required to uncomment
# those. These are exceptions to this though: No sections (e.g. namespace {})
# or plugin settings are added by default, they're listed only as examples.
# Paths are also just examples with the real defaults being based on configure
# options. The paths listed here are for configure --prefix=/usr
# --sysconfdir=/etc --localstatedir=/var

# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol

# A comma separated list of IPs or hosts where to listen in for connections. 
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::

# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/

# Name of this instance. Used to prefix all Dovecot processes in ps output.
#instance_name = dovecot

# Greeting message for clients.
#login_greeting = Dovecot ready.

# Space separated list of trusted network ranges. Connections from these
# IPs are allowed to override their IP addresses and ports (for logging and
# for authentication checks). disable_plaintext_auth is also ignored for
# these networks. Typically you'd specify your IMAP proxy servers here.
#login_trusted_networks =

# Sepace separated list of login access check sockets (e.g. tcpwrap)
#login_access_sockets = 

# Show more verbose process titles (in ps). Currently shows user name and
# IP address. Useful for seeing who are actually using the IMAP processes
# (eg. shared mailboxes or if same uid is used for multiple accounts).
#verbose_proctitle = no

# Should all processes be killed when Dovecot master process shuts down.
# Setting this to "no" means that Dovecot can be upgraded without
# forcing existing client connections to close (although that could also be
# a problem if the upgrade is e.g. because of a security fix).
#shutdown_clients = yes

# If non-zero, run mail commands via this many connections to doveadm server,
# instead of running them directly in the same process.
#doveadm_worker_count = 0
# UNIX socket or host:port used for connecting to doveadm server
#doveadm_socket_path = doveadm-server

# Space separated list of environment variables that are preserved on Dovecot
# startup and passed down to all of its child processes. You can also give
# key=value pairs to always set specific settings.
#import_environment = TZ

##
## Dictionary server settings
##

# Dictionary can be used to store key=value lists. This is used by several
# plugins. The dictionary can be accessed either directly or though a
# dictionary server. The following dict block maps dictionary names to URIs
# when the server is used. These can then be referenced using URIs in format
# "proxy::<name>".

dict {
  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}

# Most of the actual configuration gets included below. The filenames are
# first sorted by their ASCII value and parsed in that order. The 00-prefixes
# in filenames are intended to make it easier to understand the ordering.
!include conf.d/*.conf

# A config file can also tried to be included without giving an error if
# it's not found:
!include_try local.conf

Fichier imapd.protocol:

protocols = $protocols imap

Fichier 20-imap.conf:

##
## IMAP specific settings
##

protocol imap {
  # Maximum IMAP command line length. Some clients generate very long command
  # lines with huge mailboxes, so you may need to raise this if you get
  # "Too long argument" or "IMAP command line too large" errors often.
  #imap_max_line_length = 64k

  # Maximum number of IMAP connections allowed for a user from each IP address.
  # NOTE: The username is compared case-sensitively.
  #mail_max_userip_connections = 10

  # Space separated list of plugins to load (default is global mail_plugins).
  #mail_plugins = $mail_plugins

  # IMAP logout format string:
  #  %i - total number of bytes read from client
  #  %o - total number of bytes sent to client
  #imap_logout_format = bytes=%i/%o

  # Override the IMAP CAPABILITY response. If the value begins with '+',
  # add the given capabilities on top of the defaults (e.g. +XFOO XBAR).
  #imap_capability = 

  # How long to wait between "OK Still here" notifications when client is
  # IDLEing.
  #imap_idle_notify_interval = 2 mins

  # ID field names and values to send to clients. Using * as the value makes
  # Dovecot use the default value. The following fields have default values
  # currently: name, version, os, os-version, support-url, support-email.
  #imap_id_send = 

  # ID fields sent by client to log. * means everything.
  #imap_id_log =

  # Workarounds for various client bugs:
  #   delay-newmail:
  #     Send EXISTS/RECENT new mail notifications only when replying to NOOP
  #     and CHECK commands. Some clients ignore them otherwise, for example OSX
  #     Mail (<v2.1). Outlook Express breaks more badly though, without this it
  #     may show user "Message no longer in server" errors. Note that OE6 still
  #     breaks even with this workaround if synchronization is set to
  #     "Headers Only".
  #   tb-extra-mailbox-sep:
  #     With mbox storage a mailbox can contain either mails or submailboxes,
  #     but not both. Thunderbird separates these two by forcing server to
  #     accept '/' suffix in mailbox names in subscriptions list.
  #   tb-lsub-flags:
  #     Show \Noselect flags for LSUB replies with LAYOUT=fs (e.g. mbox).
  #     This makes Thunderbird realize they aren't selectable and show them
  #     greyed out, instead of only later giving "not selectable" popup error.
  #
  # The list is space-separated.
  #imap_client_workarounds = 
}

Merci pour votre aide.

Dernière modification par spectre3brad (Le 09/09/2012, à 15:33)

Hors ligne

#2 Le 08/09/2012, à 19:03

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

Je n'y arrive toujours pas sad Dovecot 2.0 a l'air vraiment particulier...

Hors ligne

#3 Le 08/09/2012, à 19:50

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

Lors de mon dernier test:

$ telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

Hors ligne

#4 Le 08/09/2012, à 23:46

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

J'ai reconfiguré les certificats et a present voila ce que j'ai:

telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
telnet localhost imap
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready.
telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 nom-de-mon-serveur.mon-domaine.tld ESMTP Postfix (Ubuntu)

Mais avec Thunderbird je n'arrive pas a configurer ni pour IMAP ni pour SMTP.

Dernière modification par spectre3brad (Le 09/09/2012, à 15:33)

Hors ligne

#5 Le 09/09/2012, à 00:03

src

Re : Postfix + Dovecot + SSL/TLS

Alors voici la manière dont je procède :

main.cf (postfix)
Ajouter l'option

home_mailbox = Maildir/

Et supprimer ce qui se rapporte à procmail.

Ainsi les mails seront stockés dans les /home des utilisateurs au format Maildir qui est plus propre que celui par défaut (mailbox dans /var/mail)

Ensuite pour dovecot, 10-mail.conf :

mail_location = maildir:~/Maildir

Et voilà c'est tout, dovecot vient déjà avec des certificats. Normalement depuis Thunderbird tu accède en IMAP (et POP si installé) à tes boites mail.


Actuellement sur Manjaro Xfce (amd64)

Hors ligne

#6 Le 09/09/2012, à 01:40

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

Super! Le Maildir fonctionne et Thunderbird se connecte au service IMAP en STARTTLS sur le port 143 avec "MOT DE PASSE NORMAL" c'est bon niveau port c'est bien chiffré de toute facon avec STARTTLS ?

Merci src wink

Reste plus que l'AUTH sur Postfix.

Hors ligne

#7 Le 09/09/2012, à 12:54

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

J'ai ajouté ceci a la fin de ma configuration Postfix:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options = noanonymous

smtp_use_tls = yes
smtp_enforce_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crtsmtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated

L'identification a l'air de bien se faire pour SMTP mais je ne peut que envoyer vers une adresse email de mon domaine et il me faut envoyer vers n'importe qu'elle adresse email.

Comment faire?

Merci.

Hors ligne

#8 Le 09/09/2012, à 15:32

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

Avec ceci a la fin de mon fichier de configuration Postfix j'arrive a recevoir et envoyer les email depuis la section lecture email client de Webmin:

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated, permit
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        check_relay_domains

Par contre depuis Thunderbird qui est separé du serveur Postfix/Dovecot par Internet je n'arrive que a recevoir. Lors d'un envoi le mot de passe est demandé comme c'est le cas normalement mais une fois renseigné voici le message d'erreur donné:

L'identification sur le serveur smtp.mon-domaine.tld a échoué.

Hors ligne

#9 Le 09/09/2012, à 17:05

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

C'est bon après un nettoyage a fond tout semble a nouveau fonctionner. Wireshark semble donner le tout en chiffré. Reste plus que les dossiers partagés entre les clients pour partager des emails.

Hors ligne

#10 Le 09/09/2012, à 20:56

src

Re : Postfix + Dovecot + SSL/TLS

Pour l'envoi de mails vers l'extérieur, c'est peut-être un blocage côté FAI.
S'agit-il d'un serveur dédié ou d'un auto-hébergement chez toi?

Beaucoup de FAI bloquent le port 25 TCP sortant, du coup tu ne peux rien envoyer.


Actuellement sur Manjaro Xfce (amd64)

Hors ligne

#11 Le 09/09/2012, à 21:26

spectre3brad

Re : Postfix + Dovecot + SSL/TLS

Merci pour ton aide src,

pour le blocage le seveur et sur une Freebox avec le port 25 debloqué et pour les tests je suis derriere une Livebox qui elle bloque le 25 vers d'autres serveurs que les SMTP Orange donc j'ai ouvert le port 465 sur Postfix qui permet de passer outre le blocage FAI ainsi.

Ensuite j'ai refait tout la configuration a zero donnée ici: http://doc.ubuntu-fr.org/postfix

Ce qui me donne:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myhostname = nom-serveur.domaine.tld
mydomain = domaine.tld
myorigin = /etc/mailname
masquerade_domains = $mydomain
home_mailbox = Maildir/
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = domaine.tld, nom-serveur.domaine.tld, localhost.domaine.tld, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

Pour ce qui ont le meme soucis bien entendu remplacer nom-serveur.domaine.tld et domaine.tld par votre propre domaine et nom machine.

A présent que la base fonctionne:
- Postfix chiffré avec port 465 contre blocage FAI
- Dovecot IMAP et POP3 en chiffré
- Webmail Roundcube

Il me reste les dossiers partagé pour échanger des emails pour certains clients.

Hors ligne

#12 Le 10/09/2012, à 19:11

src

Re : Postfix + Dovecot + SSL/TLS

Tu n'as pas compris, le port 25 est bloqué dans le sens sortant. Autrement dit ton serveur ne peut pas envoyer de mails vers un autre serveur, car il essaierai de le contacter sur le port 25, qui est bloqué. Pour contourner cela tu es obligé de spécifier un relayhost sur un port différent (465 ou 587) qui lui n'a pas son port 25 bloqué et pourra donc relayer ton message sur le serveur destinataire correctement.

Le port 25 entrant n'est pas bloqué. Du coup tu peux recevoir normalement des messages.

Ce blocage a été mis en place car grâce à l'état déplorable de l'informatique grand public, des programmes malicieux étaient en fait des "serveurs mails" envoyant du spam. Le blocage du port 25 sortant les stoppe. Par contre les FAI ont abusé car certains ne donnent pas la possibilité de désactiver ce blocage.

Dernière modification par src (Le 10/09/2012, à 19:13)


Actuellement sur Manjaro Xfce (amd64)

Hors ligne