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 20/09/2014, à 11:30

castrogne

Installation Postfix , STARTTLS inactif?

Bonjour,

Je suis en train d'essayer d'installer mon propre serveur (première fois que je le fais). Après quelques péripéties, j'ai maintenant un serveur  et un nom de domaine, avec bind9 configuré, et un hostname convenable. J'ai donc ajouté dans ma configuration DNS une ligne mail.mondomaine.fr et fait que mon serveur s'appelle maintenant "mail".

J'ai suivi comme beaucoup le tuto suivant :
http://doc.ubuntu-fr.org/postfix
https://help.ubuntu.com/community/Postfix

Dans les grandes lignes, je n'ai pas eu de problème, mais au moment du test avec telnet, je n'ai pas les lignes "STARTTLS" et "AUTH" (Voir plus loin). J'ai fouillé le net mais je n'arrive pas à trouver la solution... De plus, malgré mes essais, impossible de faire du telnet depuis l'extérieur.

Voici comme demandé ici les informations liées à Postfix :

$ sudo postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = mondomaine.fr, mail.mondomaine.fr, localhost.mondomaine.fr, localhost
myhostname = mail.mondomaine.fr
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 ip.public.chez.moi
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_auth_only = no
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

Voici le test en échec : (il manque 250-STARTTLS)

$ telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.mondomaine.fr ESMTP Sendmail 8.14.4/8.14.4/Debian-2.1ubuntu4; Sat, 20 Sep 2014 12:24:56 +0200; (No UCE/UBE) logging access from: localhost.localdomain(OK)-localhost.localdomain [127.0.0.1]
EHLO localhost
250-mail.mondomaine.fr Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
quit
221 2.0.0 mail.mondomaine.fr closing connection
Connection closed by foreign host.

2 autres choses que je viens de voir en écrivant ces lignes, je ne sais pas si c'est lié...
Lorsque je fait "service postfix restart" voici la ligne de log qui arrive :

Sep 20 12:17:19 mail postfix/master[6143]: fatal: bind 0.0.0.0 port 25: Address already in use

étrange, pourtant une fois postfix éteint (stop) , voici le résultat de netstat (plus de port 25)

$ netstat -a
Connexions Internet actives (serveurs et établies)
Proto Recv-Q Send-Q Adresse locale          Adresse distante        Etat
tcp        0      0 localhost.localdom:smtp *:*                     LISTEN
tcp        0      0 localhost.localdoma:953 *:*                     LISTEN
tcp        0      0 localhost.localdo:mysql *:*                     LISTEN
tcp        0      0 localhost.lo:submission *:*                     LISTEN
tcp        0      0 mail.modomaine:domain *:*                     LISTEN
tcp        0      0 127.0.0.2:domain        *:*                     LISTEN
tcp        0      0 localhost.locald:domain *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0      0 mail.mondomaine:ssh lns-bzn-47f-81-56:49608 ESTABLISHED
tcp        0     52 mail.mondomaine:ssh lns-bzn-47f-81-56:49609 ESTABLISHED
tcp6       0      0 localhost:953           [::]:*                  LISTEN
tcp6       0      0 [::]:http               [::]:*                  LISTEN
tcp6       0      0 [::]:ftp                [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
udp        0      0 mail.modomaine:domain *:*
udp        0      0 127.0.0.2:domain        *:*
udp        0      0 localhost.locald:domain *:*
Sockets du domaine UNIX actives (serveurs et établies)
Proto RefCnt Flags       Type       State         I-Node   Chemin
unix  2      [ ACC ]     STREAM     LISTENING     598336478 /var/spool/postfix/var/run/saslauthd/mux
unix  2      [ ACC ]     STREAM     LISTENING     598429249 /var/spool/postfix/var/run/saslauthd/mux
unix  2      [ ACC ]     STREAM     LISTENING     597697601 @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     597698829 /var/lib/syslog-ng/syslog-ng.ctl
unix  2      [ ACC ]     STREAM     LISTENING     597699173 /var/run/sendmail/mta/smcontrol
unix  12     [ ]         DGRAM                    597698820 /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     597699261 /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     597699041 /var/run/courier/authdaemon/socket.tmp
unix  3      [ ]         STREAM     CONNECTE      605996761
unix  3      [ ]         STREAM     CONNECTE      605996760
unix  2      [ ]         DGRAM                    605996483
unix  2      [ ]         DGRAM                    605993961
unix  2      [ ]         DGRAM                    605993934
unix  2      [ ]         DGRAM                    605993930
unix  3      [ ]         STREAM     CONNECTE      605989778
unix  3      [ ]         STREAM     CONNECTE      605989777
unix  2      [ ]         DGRAM                    605989191
unix  2      [ ]         DGRAM                    598429248
unix  2      [ ]         DGRAM                    598336477
unix  2      [ ]         DGRAM                    597731858
unix  2      [ ]         DGRAM                    597699170
unix  2      [ ]         DGRAM                    597699002
unix  2      [ ]         DGRAM                    597698894
unix  3      [ ]         STREAM     CONNECTE      597698140 @/com/ubuntu/upstart
unix  3      [ ]         STREAM     CONNECTE      597698123

Merci pour votre aide smile

Hors ligne

#2 Le 20/09/2014, à 11:35

castrogne

Re : Installation Postfix , STARTTLS inactif?

Salut,

Comme quoi écrire ouvre les yeux...

Je crois avoir trouvé en écrivant ces lignes. Regardez mon test telnet :
"220 mail.mondomaine.fr ESMTP >>>>>>>>>>>>>>>Sendmail<<<<<<<<<<<<"

Ceci mis à côté de mon log au restart "port 25: Address already in use" : Sendmail tourne toujours! On le voit même dans mon netstat

Donc après un petit service sendmail stop, tout rentre dans l'ordre :

$ telnet localhost 25
Trying ::1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 mail.mondomaine.fr ESMTP Postfix (Ubuntu)
EHLO localhost
250-mail.mondomaine.fr
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Je change donc de question :
Pourquoi ai-je encore sendmail? Il a pourtant été "désinstallé" lors de mon apt-get install postfix... Et comment le stoper définitivement (au prochain reboot)

Merci!

Hors ligne

#3 Le 23/09/2014, à 09:11

tiramiseb

Re : Installation Postfix , STARTTLS inactif?

Salut,

Pourquoi ai-je encore sendmail? Il a pourtant été "désinstallé" lors de mon apt-get install postfix... Et comment le stoper définitivement (au prochain reboot)

Peux-tu donner le retour de ces commandes ?

dpkg -l
ls /etc/init.d
ls /etc/init
ls /etc/rc*.d

Hors ligne