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 25/09/2014, à 19:33

alain25500

Problème avec Postfix via Gmail

Bonjour à tous,

J'ai un site internet, je veux recevoir les mails que les utilisateurs m'envoient via le formulaire de contact du site.

Je viens d'installer postfix en faisant :

apt-get install postfix

Ensuite j'ai suivi le tutoriel pour configurer mon adresse mail gmail.

dans le relay j'ai mi [smtp.gmail.com]:587

Je ne reçois aucun mail de mon site internet.

Voici le fichier /etc/postfix/main.cf :

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

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
#SASL parameters
smtp_sasl_auth_enable =yes
smtp_sasl_password_maps = hash: /etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
# information on enabling SSL in the smtp client.

myhostname = pfl.port-frejus-location.fr
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = port-frejus-location.fr, pfl.port-frejus-location.fr, localhost.port-frejus-location.fr, localhost
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

Aussi j'ai créé un fichier sasl_passwd dans /etc/postfix/

[smtp.gmail.com]:587 utilisateur@gmail.com

j'ai sécurisé le fichier /etc/postfix/sasl_passwd :

 chmod 400 /etc/postfix/saslpasswd

Ensuite j'ai dit à postfix de le prendre en compte le fichier :

postmap /etc/postfix/sasl/sasl_passwd

J'ai redémarré postfix :

service postfix restart

Quand je teste l'envoi je fais en même temps un tail -f /var/log/mail.log

Sep 25 19:31:51 pfl postfix/sendmail[5504]: fatal: open /etc/postfix/main.cf: Permission denied
Sep 25 19:32:16 pfl postfix/smtp[5505]: fatal: open dictionary: expecting "type:name" form instead of "hash:"
Sep 25 19:32:17 pfl postfix/master[4575]: warning: process /usr/lib/postfix/smtp pid 5505 exit status 1
Sep 25 19:32:17 pfl postfix/master[4575]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling

Est ce que j'ai oublié une ligne de commande ?

Comment puis je faire ?

Qui peut m'aider ?

Merci

Cordialement,

Dernière modification par alain25500 (Le 28/09/2014, à 13:35)

Hors ligne

#2 Le 25/09/2014, à 20:37

Yooxel

Re : Problème avec Postfix via Gmail

Salut,

C'est sûrement SELinux qui fout le bordel. Essaie ça :

man restorecon # historie de comprendre ce que tu fais
restorecon -v /etc/postfix/main.cf

(source)
Et ça c'est que pour la première erreur. En espérant que ça règle les autres.


Y

Hors ligne

#3 Le 25/09/2014, à 20:44

alain25500

Re : Problème avec Postfix via Gmail

Yooxel a écrit :

Salut,

C'est sûrement SELinux qui fout le bordel. Essaie ça :

man restorecon # historie de comprendre ce que tu fais
restorecon -v /etc/postfix/main.cf

(source)
Et ça c'est que pour la première erreur. En espérant que ça règle les autres.

Bonsoir,

Merci pour ta réponse,
J'ai essayé le man restorecon je n'ai pas c'ette commande.
J'ai mis à jour toute la procédure que j'ai fait.

Pour info, je suis sur un serveur dédié sous Esxi et une debian.

Comment faire ?

Dernière modification par alain25500 (Le 25/09/2014, à 20:47)

Hors ligne

#4 Le 25/09/2014, à 21:28

bruno

Re : Problème avec Postfix via Gmail

Donne-nous le retour de :

ls -al /etc/postfix

et commente cette ligne dans le main.cf :

alias_maps = hash:/etc/aliases
# alias_database = hash:/etc/aliases
myorigin = /etc/mailname

Hors ligne

#5 Le 25/09/2014, à 21:41

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Donne-nous le retour de :

ls -al /etc/postfix

et commente cette ligne dans le main.cf :

alias_maps = hash:/etc/aliases
# alias_database = hash:/etc/aliases
myorigin = /etc/mailname

Bonsoir,

Voilà ce que tu m'a demandé :

root@pfl:/etc/postfix# ls -al /etc/postfix
total 100
drwxr-xr-x  3 postfix root  4096 sept. 25 16:33 .
drwxr-xr-x 91 root    root  4096 sept. 25 19:10 ..
-rw-r-----  1 root    root   274 sept. 25 16:22 dynamicmaps.cf
-rw-r-----  1 root    root  1553 sept. 25 18:57 main.cf
-rw-r-----  1 root    root  5531 sept. 25 16:22 master.cf
-rw-r-----  1 root    root 19707 mars   6  2013 postfix-files
-rw-r-----  1 root    root  8729 mars   6  2013 postfix-script
-rw-r-----  1 root    root 26498 mars   6  2013 post-install
drw-r-----  2 root    root  4096 mars   6  2013 sasl
-rw-r-----  1 root    root    53 sept. 25 18:52 sasl_passwd
-rw-r-----  1 root    root 12288 sept. 25 18:52 sasl_passwd.db

J'ai mis en commentaire ces lignes

#alias_maps = hash:/etc/aliases
# alias_database = hash:/etc/aliases
#myorigin = /etc/mailname

J'attends ton retour.

Merci

Hors ligne

#6 Le 25/09/2014, à 21:53

bruno

Re : Problème avec Postfix via Gmail

Bon, les droits sur tes fichiers ne sont pas corrects (postfix ne peut pas les lire !) :

chmod -R a+r /etc/postfix
chmod +x postfix-script postfix-install

et c'est uniquement cette ligne qu'il faut commenter :

# alias_database = hash:/etc/aliases

ensuite :

service postfix restart

Dernière modification par bruno (Le 25/09/2014, à 21:53)

Hors ligne

#7 Le 25/09/2014, à 22:10

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Bon, les droits sur tes fichiers ne sont pas corrects (postfix ne peut pas les lire !) :

chmod -R a+r /etc/postfix
chmod +x postfix-script postfix-install

et c'est uniquement cette ligne qu'il faut commenter :

# alias_database = hash:/etc/aliases

ensuite :

service postfix restart

Merci pour la réponse, mais quand je fait :

chmod +x postfix-script postfix-install

Il me met :

root@pfl:/etc/postfix# chmod +x postfix-script postfix-install
chmod: impossible d'accéder à « postfix-install »: Aucun fichier ou dossier de ce type

Ensuite je fais un test sur mon site.

je fais la commande tail -f /var/log/mail.log.

Il me met :

Sep 25 22:12:10 pfl postfix/sendmail[6629]: fatal: www-data(33): No recipient addresses found in message header
Sep 25 22:12:10 pfl postfix/sendmail[6629]: fatal: www-data(33): No recipient addresses found in message headerSep 25 22:12:34 pfl postfix/smtp[6631]: fatal: open dictionary: expecting "type:name" form instead of "hash:"
Sep 25 22:12:35 pfl postfix/master[6606]: warning: process /usr/lib/postfix/smtp pid 6631 exit status 1
Sep 25 22:12:35 pfl postfix/master[6606]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Sep 25 22:13:35 pfl postfix/smtp[6632]: fatal: open dictionary: expecting "type:name" form instead of "hash:"
Sep 25 22:13:36 pfl postfix/master[6606]: warning: process /usr/lib/postfix/smtp pid 6632 exit status 1
Sep 25 22:13:36 pfl postfix/master[6606]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling

Comment faire ?

Merci

Dernière modification par alain25500 (Le 25/09/2014, à 22:14)

Hors ligne

#8 Le 25/09/2014, à 22:24

bruno

Re : Problème avec Postfix via Gmail

Ça t'apprendra à faire des copier coller de commandes…

chown +x post-install

et il manquait aussi

chown +x sasl

Et tu as une espace en trop sur cette ligne :

smtp_sasl_password_maps = hash: /etc/postfix/sasl_passwd

il faut enlever l'espace après hash:

Hors ligne

#9 Le 25/09/2014, à 22:35

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Ça t'apprendra à faire des copier coller de commandes…

chown +x post-install

et il manquait aussi

chown +x sasl

Et tu as une espace en trop sur cette ligne :

smtp_sasl_password_maps = hash: /etc/postfix/sasl_passwd

il faut enlever l'espace après hash:

Mais c'est un chmod ou un chown ?

J'ai fait un chmod + x post-install et de même pour sasl

Est ce bon ?

Merci

Hors ligne

#10 Le 25/09/2014, à 22:41

bruno

Re : Problème avec Postfix via Gmail

Il fallait lire chmod, bien sûr. Je suis fatigué…

Hors ligne

#11 Le 25/09/2014, à 22:49

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Il fallait lire chmod, bien sûr. Je suis fatigué…

C'est bien ce que je pensais.

Donc j'ai refait un essais sur mon site.

je fais la commande tail -f /var/log/mail.log.

Il me met :

Sep 25 22:37:24 pfl postfix/sendmail[6880]: fatal: www-data(33): No recipient addresses found in message header
Sep 25 22:41:31 pfl postfix/pickup[6867]: B1EAA300069: uid=33 from=<www-data>
Sep 25 22:41:31 pfl postfix/cleanup[6907]: B1EAA300069: message-id=<20140925204131.B1EAA300069@pfl.port-frejus-location.fr>
Sep 25 22:41:31 pfl postfix/qmgr[6868]: B1EAA300069: from=<www-data@port-frejus-location.fr>, size=632, nrcpt=1 (queue active)
Sep 25 22:41:31 pfl postfix/smtp[6909]: B1EAA300069: to=<utilisateur@gmail.com>, relay=smtp.gmail.com[64.233.161.108]:587, delay=0.22, delays=0.01/0.01/0.16/0.04, dsn=5.7.0, status=bounced (host smtp.gmail.com[64.233.161.108] said: 530 5.7.0 Must issue a STARTTLS command first. uj2sm1154337lbc.28 - gsmtp (in reply to MAIL FROM command))
Sep 25 22:41:31 pfl postfix/cleanup[6907]: F1BD930006A: message-id=<20140925204131.F1BD930006A@pfl.port-frejus-location.fr>
Sep 25 22:41:31 pfl postfix/bounce[6910]: B1EAA300069: sender non-delivery notification: F1BD930006A
Sep 25 22:41:31 pfl postfix/qmgr[6868]: F1BD930006A: from=<>, size=2739, nrcpt=1 (queue active)
Sep 25 22:41:31 pfl postfix/qmgr[6868]: B1EAA300069: removed
Sep 25 22:41:32 pfl postfix/local[6911]: F1BD930006A: to=<www-data@port-frejus-location.fr>, relay=local, delay=0.13, delays=0/0.01/0/0.12, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Sep 25 22:41:32 pfl postfix/qmgr[6868]: F1BD930006A: removed

Voilà ce qui'il me met.

Comment puis je faire ?

Merci

Hors ligne

#12 Le 25/09/2014, à 23:24

Pseudo supprimé

Re : Problème avec Postfix via Gmail

supprime sendmail

#13 Le 26/09/2014, à 08:11

alain25500

Re : Problème avec Postfix via Gmail

Titouan a écrit :

supprime sendmail

Bonjour,

Pourquoi supprimer sendmail ?

Merci

Hors ligne

#14 Le 26/09/2014, à 08:58

bruno

Re : Problème avec Postfix via Gmail

Supprimer sendmail ? Je ne vois pas pourquoi…

Bon cela progresse. Gmail refuse ton courriel avec ce message :

(host smtp.gmail.com[64.233.161.108] said: 530 5.7.0 Must issue a STARTTLS command first

Essaie d'ajouter ces lignes dans ton main.cf :

smtp_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtp_tls_note_starttls_offer = yes

Hors ligne

#15 Le 26/09/2014, à 20:15

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Supprimer sendmail ? Je ne vois pas pourquoi…

Bon cela progresse. Gmail refuse ton courriel avec ce message :

(host smtp.gmail.com[64.233.161.108] said: 530 5.7.0 Must issue a STARTTLS command first

Essaie d'ajouter ces lignes dans ton main.cf :

smtp_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtp_tls_note_starttls_offer = yes

Bonjour Bruno,

J'ai rajouté les ligne suivante ci-dessus :

Quand je teste l'envoi je fais en même temps un tail -f /var/log/mail.log :

Sep 26 20:06:23 pfl postfix/pickup[10742]: C0A3E300069: uid=0 from=<root@pfl.port-frejus-location.fr>
Sep 26 20:06:23 pfl postfix/cleanup[10758]: C0A3E300069: message-id=<20140926180623.C0A3E300069@pfl.port-frejus-location.fr>
Sep 26 20:06:23 pfl postfix/qmgr[10743]: C0A3E300069: from=<root@pfl.port-frejus-location.fr>, size=388, nrcpt=1 (queue active)
Sep 26 20:06:24 pfl postfix/smtp[10760]: Host offered STARTTLS: [smtp.gmail.com]
Sep 26 20:06:24 pfl postfix/smtp[10760]: C0A3E300069: to=<utilisateur@gmail.com>, relay=smtp.gmail.com[173.194.71.108]:587, delay=0.35, delays=0.01/0/0.3/0.04, dsn=5.7.0, status=bounced (host smtp.gmail.com[173.194.71.108] said: 530 5.7.0 Must issue a STARTTLS command first. us3sm2130259lbc.24 - gsmtp (in reply to MAIL FROM command))
Sep 26 20:06:24 pfl postfix/cleanup[10758]: 2C8E630006A: message-id=<20140926180624.2C8E630006A@pfl.port-frejus-location.fr>
Sep 26 20:06:24 pfl postfix/bounce[10761]: C0A3E300069: sender non-delivery notification: 2C8E630006A
Sep 26 20:06:24 pfl postfix/qmgr[10743]: 2C8E630006A: from=<>, size=2493, nrcpt=1 (queue active)
Sep 26 20:06:24 pfl postfix/qmgr[10743]: C0A3E300069: removed
Sep 26 20:06:24 pfl postfix/cleanup[10758]: 2EB7B300068: message-id=<20140926180624.2C8E630006A@pfl.port-frejus-location.fr>
Sep 26 20:06:24 pfl postfix/local[10762]: 2C8E630006A: to=<root@pfl.port-frejus-location.fr>, relay=local, delay=0.01, delays=0/0.01/0/0, dsn=2.0.0, status=sent (forwarded as 2EB7B300068)
Sep 26 20:06:24 pfl postfix/qmgr[10743]: 2EB7B300068: from=<>, size=2650, nrcpt=1 (queue active)
Sep 26 20:06:24 pfl postfix/qmgr[10743]: 2C8E630006A: removed
Sep 26 20:06:24 pfl postfix/smtp[10760]: Host offered STARTTLS: [smtp.gmail.com]
Sep 26 20:06:24 pfl postfix/smtp[10760]: 2EB7B300068: to=<utilisateur@gmail.com>, orig_to=<root@pfl.port-frejus-location.fr>, relay=smtp.gmail.com[173.194.71.108]:587, delay=0.5, delays=0/0/0.46/0.04, dsn=5.7.0, status=bounced (host smtp.gmail.com[173.194.71.108] said: 530 5.7.0 Must issue a STARTTLS command first. o4sm2110458lao.32 - gsmtp (in reply to MAIL FROM command))
Sep 26 20:06:24 pfl postfix/qmgr[10743]: 2EB7B300068: removed

Voici le fichier main.cf de postfix :

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


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtp_tls_note_starttls_offer = yes
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
#SASL parameters
smtp_sasl_auth_enable =yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
# information on enabling SSL in the smtp client.
myhostname = pfl.port-frejus-location.fr
alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = port-frejus-location.fr, pfl.port-frejus-location.fr, localhost.port-frejus-location.fr, localhost
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

Comment faire ?

Merci

Hors ligne

#16 Le 27/09/2014, à 19:02

alain25500

Re : Problème avec Postfix via Gmail

Bonjour à tous,

Qui peux m'aider pour résoudre mon problème ?

Merci

Cordialement,

Hors ligne

#17 Le 28/09/2014, à 13:24

bruno

Re : Problème avec Postfix via Gmail

Je ne vois pas cette ligne que je t'ai conseillé (essentielle ! C'est certainement ce qui provoque l'erreur dans les logs) :

smtp_use_tls=yes

et il faut modifier ainsi  la directive smtp_sasl_security_options

smtp_sasl_security_options = 

et supprimer cette ligne :
smtp_sasl_tls_security_options = noanonymous

Dernière modification par bruno (Le 28/09/2014, à 13:25)

Hors ligne

#18 Le 28/09/2014, à 13:58

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Je ne vois pas cette ligne que je t'ai conseillé (essentielle ! C'est certainement ce qui provoque l'erreur dans les logs) :

smtp_use_tls=yes

et il faut modifier ainsi  la directive smtp_sasl_security_options

smtp_sasl_security_options = 

et supprimer cette ligne :
smtp_sasl_tls_security_options = noanonymous

Bonjour,
J'ai désactivé la ligne :

smtp_sasl_tls_security_options = noanonymous

Mais j'ai toujours pareil :

Sep 28 13:47:58 pfl postfix/pickup[22111]: 139D330006B: uid=0 from=<root@pfl.port-frejus-location.fr>
Sep 28 13:47:58 pfl postfix/cleanup[22127]: 139D330006B: message-id=<20140928114758.139D330006B@pfl.port-frejus-location.fr>
Sep 28 13:47:58 pfl postfix/qmgr[22112]: 139D330006B: from=<root@pfl.port-frejus-location.fr>, size=388, nrcpt=1 (queue active)
Sep 28 13:47:58 pfl postfix/smtp[22129]: Host offered STARTTLS: [smtp.gmail.com]
Sep 28 13:47:58 pfl postfix/smtp[22129]: 139D330006B: to=<utilisateur@gmail.com>, relay=smtp.gmail.com[173.194.78.108]:587, delay=0.06, delays=0.01/0/0.04/0.01, dsn=5.7.0, status=bounced (host smtp.gmail.com[173.194.78.108] said: 530 5.7.0 Must issue a STARTTLS command first. k10sm12274932wjb.28 - gsmtp (in reply to MAIL FROM command))
Sep 28 13:47:58 pfl postfix/cleanup[22127]: 24304300070: message-id=<20140928114758.24304300070@pfl.port-frejus-location.fr>
Sep 28 13:47:58 pfl postfix/bounce[22130]: 139D330006B: sender non-delivery notification: 24304300070
Sep 28 13:47:58 pfl postfix/qmgr[22112]: 24304300070: from=<>, size=2495, nrcpt=1 (queue active)
Sep 28 13:47:58 pfl postfix/qmgr[22112]: 139D330006B: removed
Sep 28 13:47:58 pfl postfix/cleanup[22127]: 2602C300069: message-id=<20140928114758.24304300070@pfl.port-frejus-location.fr>
Sep 28 13:47:58 pfl postfix/local[22131]: 24304300070: to=<root@pfl.port-frejus-location.fr>, relay=local, delay=0.01, delays=0/0.01/0/0, dsn=2.0.0, status=sent (forwarded as 2602C300069)
Sep 28 13:47:58 pfl postfix/qmgr[22112]: 2602C300069: from=<>, size=2652, nrcpt=1 (queue active)
Sep 28 13:47:58 pfl postfix/qmgr[22112]: 24304300070: removed
Sep 28 13:47:58 pfl postfix/smtp[22129]: Host offered STARTTLS: [smtp.gmail.com]
Sep 28 13:47:58 pfl postfix/smtp[22129]: 2602C300069: to=<dosreisalain@gmail.com>, orig_to=<root@pfl.port-frejus-location.fr>, relay=smtp.gmail.com[173.194.78.109]:587, delay=0.03, delays=0/0/0.02/0.01, dsn=5.7.0, status=bounced (host smtp.gmail.com[173.194.78.109] said: 530 5.7.0 Must issue a STARTTLS command first. wm6sm62524wjb.5 - gsmtp (in reply to MAIL FROM command))
Sep 28 13:47:58 pfl postfix/qmgr[22112]: 2602C300069: removed

Voici mon fichier de configuration :

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


# Debian specific: Specifying a file name will cause the first line of that file to be used as the name.  The Debian default is
#/etc/mailname. myorigin = /etc/mailname
#myorigin = port-frejus-location.fr
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

readme_directory = no

# TLS parameters
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
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtp_tls_note_starttls_offer = yes
[b][u]#smtp_sasl_tls_security_options = noanonymous[/b][/u]

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
#SASL parameters
smtp_sasl_auth_enable =yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
[u][b]#smtp_sasl_security_options = noanonymous[/b][/u]
[b][u]smtp_sasl_security_options =[/u][/b]
# information on enabling SSL in the smtp client.
[u][b]smtpd_use_tls=yes[/b][/u]
myhostname = pfl.port-frejus-location.fr
alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = port-frejus-location.fr, pfl.port-frejus-location.fr, localhost.port-frejus-location.fr, localhost
relayhost = [smtp.gmail.com]:587
#relayhost = smtp.gmail.com:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#soft_bounce = yes
smtp_fallback_relay = [relay.google.com]

J'ai mis en commentaire les choses à supprimer ou desactivé avec le #.

A priori j'ai vu que ça vient du TLS avec le code erreur   

530 5.7.0
host smtp.gmail.com[173.194.78.109] said: 530 5.7.0 Must issue a STARTTLS command first. 

Je ne sais pas si le TLS est installé ?

Comment puis je faire ?
Merci

Hors ligne

#19 Le 28/09/2014, à 14:07

bruno

Re : Problème avec Postfix via Gmail

Il y a plein de [ u ][ b ] dans ton fichier…je suppose que c'est une erreur de manipulation sur le forum…

Pourquoi ne fais-tu pas c que je te dis ? Il manque toujours cette ligne hmm

smtp_use_tls =yes

Hors ligne

#20 Le 28/09/2014, à 14:39

alain25500

Re : Problème avec Postfix via Gmail

bruno]Il y a plein de [ u ][ b ] dans ton fichier…je suppose que c'est une erreur de manipulation sur le forum…

Pourquoi ne fais-tu pas c que je te dis ? Il manque toujours cette ligne hmm

smtp_use_tls =yes

Si j'ai bien :

smtp_use_tls =yes

Mais moi il me met :

smtpd_use_tls =yes

donc j'ai enlever le smtpd en smtp comme tu me le conseil.

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


# Debian specific: Specifying a file name will cause the first line of that file to be used as the name.  The Debian default is
#/etc/mailname. myorigin = /etc/mailname
#myorigin = port-frejus-location.fr
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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
smtp_use_tls =yes
readme_directory = no

# TLS parameters
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
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtp_tls_note_starttls_offer = yes
#smtp_sasl_tls_security_options = noanonymous

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
#SASL parameters
smtp_sasl_auth_enable =yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#smtp_sasl_security_options = noanonymous
smtp_sasl_security_options =
# information on enabling SSL in the smtp client.
#smtpd_use_tls=yes
myhostname = pfl.port-frejus-location.fr
alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = port-frejus-location.fr, pfl.port-frejus-location.fr, localhost.port-frejus-location.fr, localhost
relayhost = [smtp.gmail.com]:587
#relayhost = smtp.gmail.com:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#soft_bounce = yes
smtp_fallback_relay = [relay.google.com]

J'ai refait :

echo test | mail -s "test message" utilisateur@gmail.com

Et ensuite j'ai fait :

tail -f /var/log/mail.log

Quand je fais le test sur le serveur avec la commande echo je reçois bien le message mais quand c'est sur le site ça me met :


Sep 28 14:28:19 pfl postfix/pickup[22659]: 306D530006B: uid=0 from=<root@pfl.port-frejus-location.fr>
Sep 28 14:28:19 pfl postfix/cleanup[22676]: 306D530006B: message-id=<20140928122819.306D530006B@pfl.port-frejus-location.fr>
Sep 28 14:28:19 pfl postfix/qmgr[22660]: 306D530006B: from=<root@pfl.port-frejus-location.fr>, size=388, nrcpt=1 (queue active)
Sep 28 14:28:21 pfl postfix/smtp[22678]: 306D530006B: to=<utilisateur@gmail.com>, relay=smtp.gmail.com[173.194.78.108]:587, delay=1.9, delays=0.01/0.02/0.61/1.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1411907305 t1sm8374444wiy.8 - gsmtp)
Sep 28 14:28:21 pfl postfix/qmgr[22660]: 306D530006B: removed
Sep 28 14:30:54 pfl postfix/sendmail[22691]: fatal: www-data(33): No recipient addresses found in message header

Comment faire ?

Merci

Hors ligne

#21 Le 28/09/2014, à 16:15

bruno

Re : Problème avec Postfix via Gmail

Si tu appliques des directives sans les comprendre…

smtp_use_tls=yes c'est pour le client (tu es client pour gmail)
smtpd_use_tls=yes c'est pour le serveur

Il faut les deux.

je reçois bien le message

Donc maintenant cela marche.
La dernière erreur :

Sep 28 14:30:54 pfl postfix/sendmail[22691]: fatal: www-data(33): No recipient addresses found in message header

ne concerne pas Postfix, c'est un problème avec le script sur ton serveur web qui n'envoie pas les courriels correctement.
« No recipient addresses found in message header », c'est à dire aucune adresse de destinataire dans les en-têtes du message, donc forcément postfix ne sait pas quoi en faire…

Dernière modification par bruno (Le 28/09/2014, à 16:16)

Hors ligne

#22 Le 28/09/2014, à 16:35

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Si tu appliques des directives sans les comprendre…

smtp_use_tls=yes c'est pour le client (tu es client pour gmail)
smtpd_use_tls=yes c'est pour le serveur

Il faut les deux.

je reçois bien le message

Donc maintenant cela marche.
La dernière erreur :

Sep 28 14:30:54 pfl postfix/sendmail[22691]: fatal: www-data(33): No recipient addresses found in message header

ne concerne pas Postfix, c'est un problème avec le script sur ton serveur web qui n'envoie pas les courriels correctement.
« No recipient addresses found in message header », c'est à dire aucune adresse de destinataire dans les en-têtes du message, donc forcément postfix ne sait pas quoi en faire…

Merci beaucoup.
Par contre je débute dans postfix, je vais acheter un livre pour bien comprendre chaque ligne.
Donc maintenant je vais voir le problème avec wordpress.

Je vais faire un mini tuto de tout ce que tu m'as dit.

Je te mettrai le lien en message privé pour me dire ce que tu en penses.

Merci encore.

Hors ligne

#23 Le 28/09/2014, à 16:45

bruno

Re : Problème avec Postfix via Gmail

Tu n'est pas obligé d'acheter un livre :

- doc officielle en anglais : http://www.postfix.org/documentation.html
- en français, mais pas à jour par rapport à la doc en anglais : http://x.guimard.free.fr/postfix/
- une bonne lecture pour comprendre le fonctionnement de SMTP : http://irp.nain-t.net/doku.php/170smtp:start

Pour wordpress, tu as probablement oublier de renseigner le champ« destinataire » dans tes paramètres de formulaire.

Pour le message privé, c'est inutile wink

Dernière modification par bruno (Le 28/09/2014, à 16:46)

Hors ligne

#24 Le 28/09/2014, à 16:56

alain25500

Re : Problème avec Postfix via Gmail

bruno a écrit :

Tu n'est pas obligé d'acheter un livre :

- doc officielle en anglais : http://www.postfix.org/documentation.html
- en français, mais pas à jour par rapport à la doc en anglais : http://x.guimard.free.fr/postfix/
- une bonne lecture pour comprendre le fonctionnement de SMTP : http://irp.nain-t.net/doku.php/170smtp:start

Pour wordpress, tu as probablement oublier de renseigner le champ« destinataire » dans tes paramètres de formulaire.

Pour le message privé, c'est inutile wink

Encore merci pour Tout.

Je vais suivre tes conseils.

Je te tiens informer pour le mini tuto avec les explications de commande et erreurs.

Merci merci

Cordialement,

Hors ligne