Je suis étudiant stagiaire en entreprise et je crée un petit site web pour celle-ci, bref sur le site, il y a une section contact et je voudrai que les mails s'envoient directement par le serveur, et non pas que sa ouvre la messagerie (Outlook, Mail etc...) de l'utilisateur qui est sur le site. J'ai donc choisi d'installer Postfix sur mon serveur (qui est installé sous Ubuntu 10.04 Alternate, et j'ai utilisé Xampp comme serveur). Bref avant de tester quoi que ce soit avec le site, je me dis qu'il faut que j'arrive à envoyer un E-mail vers l'extérieur et non en local avec la commande "mail" sur mon serveur. Le problème est que je ne reçoi aucun Email.
J'ai suivi des pas mal de Tuto, essayé plusieurs manip, mais en vain, et comme je ne m'y connais pas trop dans ce domaine, il y a des chose que je règle peut être mal ou que j'adapte peut être pas à mon cas, je vais vous donner tous ce que je pense utilise meme si ça ne le sera peut être pas, voilà mon 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 (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
readme_directory = no
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.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
# information on enabling SSL in the smtp client.
myhostname = host.local.domain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $myhostname
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relayhost = [smtp.sfr.fr]
mynetworks_style = subnet
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mailbox_command = maildrop
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
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
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:/var/spool/postfix/smtp_tls_session_cache
smtp_generic_maps = hash:/etc/postfix/generic
maildirmake.courier = ~/Maildir
tls_random_source = dev:/dev/urandom
J'ai eu des doutes notamment par rapport à myhostname, je ne sais pas trop :/.
Quand je fais un
telnet localhost 25
J'obtiens :
Trying ::1... Connected to localhost 220 host.local.domain ESMTP Postfix (Ubuntu)
Je fais ensuite un :
EHLO somename.td 250-host.local.domain 250-PIPELINING 250- SIZE 10240000 250- VRFY 250-ETRN 250-STARTTLS 250- AUTH CRAM-MD5 PLAIN LOGIN DIGEST-MD5 NTML 250- AUTH=CRAM-MD5 PLAIN LOGIN DIGEST-MD5 NTML 250-ENHANCESDSTATUSCODES 250-8BITMIME 250-DSN
Quand j'envoi un email, et que je fais un mailq après, voila ce que j'obtiens :
-Queues ID- --Size-- ----Arrival Time---- -Sender/Recipient-----
6C7802076E* 356 Tue Jun 15 14:19:39 sam@host.local.domain
_____________________________________________________________mamessagerie@gmail.com
Voila mon mail.log :
Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: BB606206DC: from=<>, size=2334, nrcpt=1 (queue active) Jun 15 14:39:44 ServeurEmsat postfix/bounce[1488]: 6C7802076E: sender non-delivery notification: BB606206DC Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: E75F820746: from=<>, size=2784, nrcpt=1 (queue active) Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: 6C7802076E: removed Jun 15 14:39:44 ServeurEmsat postfix/bounce[1491]: 3ADFD20767: sender non-delivery notification: E75F820746 Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: 3ADFD20767: removed Jun 15 14:39:44 ServeurEmsat postfix/local[1500]: 03F7420793: to=<emsat@host.local.domain>, relay=local, delay=1.3, delays=0.32/0.85/0/0.12, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: 03F7420793: removed Jun 15 14:39:44 ServeurEmsat postfix/local[1504]: 0DF3620796: to=<emsat@host.local.domain>, relay=local, delay=1.4, delays=0.3/0.97/0/0.12, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: 0DF3620796: removed Jun 15 14:39:44 ServeurEmsat postfix/local[1500]: 52317206C9: to=<emsat@host.local.domain>, relay=local, delay=1.2, delays=0.11/0.95/0/0.1, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: 52317206C9: removed Jun 15 14:39:44 ServeurEmsat postfix/local[1504]: BB606206DC: to=<emsat@host.local.domain>, relay=local, delay=0.85, delays=0.37/0.36/0/0.13, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: BB606206DC: removed Jun 15 14:39:44 ServeurEmsat postfix/local[1500]: E75F820746: to=<emsat@host.local.domain>, relay=local, delay=0.78, delays=0.19/0.49/0/0.1, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:44 ServeurEmsat postfix/qmgr[1094]: E75F820746: removed Jun 15 14:39:49 ServeurEmsat postfix/local[1499]: 1209720797: to=<emsat@host.local.domain>, relay=local, delay=6, delays=0.22/0.2/0/5.6, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:49 ServeurEmsat postfix/qmgr[1094]: 1209720797: removed Jun 15 14:39:51 ServeurEmsat postfix/pickup[1302]: 58C31206DA: uid=1000 from=<emsat> Jun 15 14:39:51 ServeurEmsat postfix/cleanup[1493]: 58C31206DA: message-id=<20100615123951.58C31206DA@host.local.domain> Jun 15 14:39:51 ServeurEmsat postfix/qmgr[1094]: 58C31206DA: from=<emsat@host.local.domain>, size=351, nrcpt=1 (queue active) Jun 15 14:39:51 ServeurEmsat postfix/smtp[1485]: 58C31206DA: to=<mamessagerie@gmail.com>, relay=smtp.sfr.fr[93.17.128.5]:25, delay=0.46, delays=0.17/0/0.23/0.06, dsn=5.1.8, status=bounced (host smtp.sfr.fr[93.17.128.5] said: 553 5.1.8 <emsat@host.local.domain>: Sender address rejected: Domain not found (in reply to MAIL FROM command)) Jun 15 14:39:51 ServeurEmsat postfix/cleanup[1494]: D5161206DC: message-id=<20100615123951.D5161206DC@host.local.domain> Jun 15 14:39:51 ServeurEmsat postfix/bounce[1489]: 58C31206DA: sender non-delivery notification: D5161206DC Jun 15 14:39:51 ServeurEmsat postfix/qmgr[1094]: 58C31206DA: removed Jun 15 14:39:51 ServeurEmsat postfix/qmgr[1094]: D5161206DC: from=<>, size=2330, nrcpt=1 (queue active) Jun 15 14:39:51 ServeurEmsat postfix/local[1504]: D5161206DC: to=<emsat@host.local.domain>, relay=local, delay=0.12, delays=0.06/0/0/0.07, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:39:51 ServeurEmsat postfix/qmgr[1094]: D5161206DC: removed Jun 15 14:40:12 ServeurEmsat postfix/pickup[1302]: 5DB23206DA: uid=1000 from=<emsat> Jun 15 14:40:12 ServeurEmsat postfix/cleanup[1497]: 5DB23206DA: message-id=<20100615124012.5DB23206DA@host.local.domain> Jun 15 14:40:12 ServeurEmsat postfix/qmgr[1094]: 5DB23206DA: from=<emsat@host.local.domain>, size=358, nrcpt=1 (queue active) Jun 15 14:40:12 ServeurEmsat postfix/smtp[1492]: 5DB23206DA: to=<mamessagerie@gmail.com>, relay=smtp.sfr.fr[93.17.128.14]:25, delay=0.4, delays=0.11/0/0.23/0.06, dsn=5.1.8, status=bounced (host smtp.sfr.fr[93.17.128.14] said: 553 5.1.8 <emsat@host.local.domain>: Sender address rejected: Domain not found (in reply to MAIL FROM command)) Jun 15 14:40:12 ServeurEmsat postfix/cleanup[1498]: CE248206DC: message-id=<20100615124012.CE248206DC@host.local.domain> Jun 15 14:40:12 ServeurEmsat postfix/qmgr[1094]: CE248206DC: from=<>, size=2338, nrcpt=1 (queue active) Jun 15 14:40:12 ServeurEmsat postfix/bounce[1488]: 5DB23206DA: sender non-delivery notification: CE248206DC Jun 15 14:40:12 ServeurEmsat postfix/qmgr[1094]: 5DB23206DA: removed Jun 15 14:40:12 ServeurEmsat postfix/local[1500]: CE248206DC: to=<emsat@host.local.domain>, relay=local, delay=0.14, delays=0.06/0/0/0.08, dsn=2.0.0, status=sent (delivered to command: maildrop) Jun 15 14:40:12 ServeurEmsat postfix/qmgr[1094]: CE248206DC: removed Jun 15 14:43:03 ServeurEmsat postfix/scache[1496]: statistics: start interval Jun 15 14:39:43 Jun 15 14:43:03 ServeurEmsat postfix/scache[1496]: statistics: domain lookup hits=0 miss=2 success=0% Jun 15 14:43:03 ServeurEmsat postfix/scache[1496]: statistics: max simultaneous domains=1 addresses=2 connection=2
Je me suis peut être mal exprimer sur un point, ou si vous avez n'importe quel questions ou besoin de voir un fichier, n'hésitez pas.
Cordialement Samuel.
