Postfix pb d'envoie vers l'extérieur

Bonjour à tous,

Alors j’ai soit une question soit un problème. Donc on va commencer par la question et peut être que la suite n’a pas besoin d’être lu ^^
La voici : Afin d’envoyer des mails vers l’extérieur me faut-il obligatoirement acheter un nom de domaine chez OVH par exemple ? Ou peut-on tester Postfix sans nom de domaine ?

Voici les informations demandé via la FAQ et infos complémentaires :

root@server:~# uname -a Linux server 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686 GNU/Linux

Je suis actuellement sous VMWare :
Server DNS/DHCP/POSTFIX/COURIER-IMAP :
Configuration de mon server : 172.17.2.10 (localhost -IP Fixe)
Configuration pour l’accès internet : 192.168.152.10 (NAT- IP Fixe)

Machine cliente test :
Configuration de mon server : 172.17.2.21 (localhost - DHCP)

Sinon voici moi problème : J’ai actuellement installé un DNS sur ma machine. Et je souhaiterais envoyer des mails vers l’extérieur…( en locale ça fontionne très bien ! ) Quand j’essaye sur n’importe quel domaine (hotmail, gmail etc) bien ça ne fonctionne pas…
Au début je pensais que c’était mon DNS qui ne fonctionnait pas…car j’avais des DNS not found dans les fichiers de log :

Voici le fichier de conf de bind9 :
vi /etc/bind/mondomaine.plop

[code]@ IN SOA mondomaine.plop. root.mondomaine.plop. (
20120524 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns
@ IN MX 10 mail.mondomaine.plop.

ns IN A 172.17.2.10
mail IN A 172.17.2.10
server IN A 172.17.2.10

imap IN CNAME server
pop3 IN CNAME server
smtp IN CNAME server
[/code]
Je suppose que ma configuration est correcte et je vous épargne ma configuration du named.conf.options pour les forwarders (ceux de google)

Voici ma configuration main.cf :

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/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
# information on enabling SSL in the smtp client.
myhostname = mail.mondomaine.plop

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
home_mailbox = Maildir/
mydestination = mondomaine.plop, server.mondomaine.plop, localhost.mondomaine.plop, localhost
mynetwork = 127.0.0.0/28, 192.168.0.0/24, 172.17.0.0/24
mailbox_size_limit = 0
relayhost = verdandi.sucemoilaqu.eu
recipient_delimiter = +
inet_interfaces = all
#mailbox_command = procmail -a "$EXTENSION"
inet_protocols = ipv4

En regardant les logs de postfix j’ai une erreur qui me dit que le port 25 n’est pas ouvert… enfin j’ai un timed out… Mais j’arrive très bien à faire :

root@server:~# telnet 172.17.2.10 25
Trying 172.17.2.10...
Connected to 172.17.2.10.
Escape character is '^]'.
220 mail.mondomaine.plop ESMTP Postfix (Ubuntu)
MAIL FROM: root@mondomaine.plop
250 2.1.0 Ok
RCPT TO: XXXX.XXXXX@gmail.com
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: plop
this is a test
.
250 2.0.0 Ok: queued as 960D5117170
QUIT
221 2.0.0 Bye [/code]

Si je tape : 
[code]root@server:~# mail

>N 10 Mail Delivery Syst Fri Feb  1 10:41   78/2863  Undelivered Mail Returned to Sender
? 10
Auto-Submitted: auto-replied
Content-Type: multipart/report; report-type=delivery-status;
        boundary="960D5117170.1359711715/mail.mondomaine.plop"
Status: R

Part 1:
Content-Description: Notification
Content-Type: text/plain; charset=us-ascii

This is the mail system at host mail.mondomaine.plop.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<XXXXXXX.XXXXXXXX@gmail.com>: host gmail-smtp-in.l.google.com[173.194.67.26] said:
    550-5.7.1 [82.127.79.230] The IP you're using to send mail is not
    authorized to 550-5.7.1 send email directly to our servers. Please use the
    SMTP relay at your 550-5.7.1 service provider instead. Learn more at 550
    5.7.1 http://support.google.com/mail/bin/answer.py?answer=10336
    q1si2664528wjr.19 - gsmtp (in reply to end of DATA command)

Part 2:
Content-Description: Delivery report
Content-Type: message/delivery-status


Part 3:
Content-Description: Undelivered Message
Content-Type: message/rfc822

Et si je fais ceci : (je n’ai mis que la partie nécessaire)

root@server:~# tail -30 /var/log/mail.log
Feb  1 10:41:37 server postfix/cleanup[1683]: 960D5117170: message-id=<20130201094118.960D5117170@mail.mondomaine.plop>
Feb  1 10:41:37 server postfix/qmgr[1547]: 960D5117170: from=<root@mondomaine.plop>, size=363, nrcpt=1 (queue active)
Feb  1 10:41:42 server postfix/smtpd[1676]: disconnect from unknown[172.17.2.10]
Feb  1 10:41:55 server postfix/smtp[1684]: 960D5117170: to=<XXXXXXX.XXXXXX@gmail.com>, relay=gmail-smtp-in.l.google.com[173.194.67.26]:25, delay=46, delays=28/0.01/13/5.8, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[173.194.67.26] said: 550-5.7.1 [82.127.79.230] The IP you're using to send mail is not authorized to 550-5.7.1 send email directly to our servers. Please use the SMTP relay at your 550-5.7.1 service provider instead. Learn more at 550 5.7.1 http://support.google.com/mail/bin/answer.py?answer=10336 q1si2664528wjr.19 - gsmtp (in reply to end of DATA command))
Feb  1 10:41:55 server postfix/cleanup[1683]: E9D38117174: message-id=<20130201094155.E9D38117174@mail.mondomaine.plop>
Feb  1 10:41:55 server postfix/qmgr[1547]: E9D38117174: from=<>, size=2859, nrcpt=1 (queue active)
Feb  1 10:41:55 server postfix/bounce[1685]: 960D5117170: sender non-delivery notification: E9D38117174

Il me demande d’utiliser le relayhost de mon FAI… mais j’ai essayé en précisant dans le relayhost = [smtp.free.fr]:587 (vu sur des tutos car souvent les FAI bloquent le port 25…) et ça ne fonctionne pas non plus… Je suis aussi allé dans le fichier /etc/postfix/master.cf et j’ai rajouté une ligne pour ouvrir le port 587 mais ça n’a rien changé. donc j’ai enlevé les configurations à la ligne relayhost en attendant votre aide.

Merci de m’avoir lu jusqu’au bout :slightly_smiling:
Cordialement,
msi71

Bonsoir tout le monde,

J’ai réussi du coup :slightly_smiling:
Il faut simplement ouvrir le port 25 sur la box et ça marche beaucoup mieux.

Amicalement,
msi71