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 14/04/2012, à 13:31

bakalegum

[résolu] configuration serveur mail : tout fonctionne sauf en local!

Bonjour à tous,

la peche?

je viens vers vous car je suis face a un problème assez étrange. je poste dans la catégorie virtualisation, car il y a des chances que le soucis vienne de la. Je vais essayer de faire une description exhaustive , mais pas trop longue de mon soucis ( mon soucis est simple mais le contexte ps tant que ca..)

Contexte :

je suis sous promox, avec openVZ ( sur un dédié OVH) , j'ai 2 VM:

10.0.0.10 : mon serveur web (ubuntu serveur lts)
10.0.0.13 : mon serveur mail ( debian squeeze, ya juste postfix dovecot et roundcube d'installé, il répond au doux nom de mail.monNDD.fr)


j'ai plusieurs sites hebergés, pour chaque ndd j'ai donc un site et des adresses mails. Tout est configuré et marche trés bien.
je recois les mails a destination de mes ndd ( les mails a destination de monuser@monNDD.fr m'arivent bien) je peux envoyer des mail en tant que monuser@monndd.fr à qui je veux)

Mon serveur mail peux envoyer des mails a tout  le monde (gmail hotmail etc...) sendmail est installé desus. c'est bie rpatique pour que les utlisateurs de mes site puissent puissent recevoir des mail ( avec les mot de passe et autre)

Mon soucis: le serveur mails (10.0.0.10) , bien qu'il puisse envoyer des mail a tout le monde, ne peux pas envoyer de mail a nimportequi@monndd.fr ( peut importe le ndd)
Alors c'est assez etrange puisuqe 10.0.0.13 accepte les mail en provenance de n'importe ou pour les transferer a monuser@monndd.fr SAUF si ca vient de 10.0.0.10!


Voici ce qui se passe quand je suis logué en root sur 10.0.0.1 et que je veux envoyer des mails:

root@web:~# sendmail -v monnom@gmail.com < /dev/null

ca fonctionne nikel:

monnom@gmail.com... Connecting to [127.0.0.1] via relay...
220 web.ovh.net ESMTP Sendmail 8.14.3/8.14.3/Debian-9.1ubuntu1; Sat, 14 Apr 2012 00:14:13 +0200; (No UCE/UBE) logging access from: localhost.localdomain(OK)-localhost.localdomain [127.0.0.1]
>>> EHLO web.ovh.net
250-web.ovh.net 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
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<root@web.ovh.net> AUTH=root@web.ovh.net
250 2.1.0 <root@web.ovh.net>... Sender ok
>>> RCPT To:<monnom@gmail.com>
>>> DATA
250 2.1.5 <monnom@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <monnom@gmail.com>... Connecting to gmail-smtp-in.l.google.com. via esmtp...
050 220 mx.google.com ESMTP c1si4257440wiz.3
050 >>> EHLO web.ovh.net
050 250-mx.google.com at your service, [91.121.149.194]
050 250-SIZE 35882577
050 250-8BITMIME
050 250-STARTTLS
050 250-ENHANCEDSTATUSCODES
050 250 PIPELINING
050 >>> STARTTLS
050 220 2.0.0 Ready to start TLS
050 >>> EHLO web.ovh.net
050 250-mx.google.com at your service, [91.121.149.194]
050 250-SIZE 35882577
050 250-8BITMIME
050 250-ENHANCEDSTATUSCODES
050 250 PIPELINING
050 >>> MAIL From:<root@web.ovh.net> SIZE=270
050 250 2.1.0 OK c1si4257440wiz.3
050 >>> RCPT To:<monnom@gmail.com>
050 >>> DATA
050 250 2.1.5 OK c1si4257440wiz.3
050 354  Go ahead c1si4257440wiz.3
050 >>> .
050 250 2.0.0 OK 1334355254 c1si4257440wiz.3
050 <monnom@gmail.com>... Sent (OK 1334355254 c1si4257440wiz.3)
250 2.0.0 q3DMEDAU006263 Message accepted for delivery
monnom@gmail.com... Sent (q3DMEDAU006263 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 web.ovh.net closing connection
root@web:~# sendmail -v monnom@monNDD.fr < /dev/null

je tente d'envoyer un mail



monnom@monNDD.fr... Connecting to [127.0.0.1] via relay...
220 web.ovh.net ESMTP Sendmail 8.14.3/8.14.3/Debian-9.1ubuntu1; Sat, 14 Apr 2012 00:16:44 +0200; (No UCE/UBE) logging access from: localhost.localdomain(OK)-localhost.localdomain [127.0.0.1]
>>> EHLO web.ovh.net
250-web.ovh.net 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
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<root@web.ovh.net> AUTH=root@web.ovh.net
250 2.1.0 <root@web.ovh.net>... Sender ok
>>> RCPT To:<monnom@monNDD.fr>
>>> DATA
250 2.1.5 <monnom@monNDD.fr>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <monnom@monNDD.fr>... Connecting to mail.monNDD.fr. via esmtp...
050 <monnom@monNDD.fr>... Deferred: Connection refused by mail.monNDD.fr.
250 2.0.0 q3DMGir1007154 Message accepted for delivery
monnom@monNDD.fr... Sent (q3DMGir1007154 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 web.ovh.net closing connection

étrange n'est ce pas?

voii la config postfix sur mon serveur mail (10.0.0.13) (main.cf)

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

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 = 1h

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
relayhost =
recipient_delimiter = +



inet_interfaces = all
myorigin = /etc/mailname
mydestination = mail.monNDD.fr, localhost.monNDD.fr, localhost
mynetworks = 10.0.0.0/22 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myhostname = mail.monNDD.fr

mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
inet_protocols = ipv4

virtual_uid_maps = static:3000
virtual_gid_maps = static:3000
virtual_mailbox_base = /home/facteur

virtual_transport = dovecot

virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous

dovecot_destination_recipient_limit = 1

content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_tls_auth_only = no
smtp_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


une idée? 

Merci beaucoup

Dernière modification par bakalegum (Le 14/04/2012, à 20:20)

Hors ligne

#2 Le 14/04/2012, à 20:19

bakalegum

Re : [résolu] configuration serveur mail : tout fonctionne sauf en local!

alors .
j'ai trouvé une solution :
installer postfix en lieu et place de sendmail sur 10.0.0.10 et configurer en smarthost sur 10.0.0.13

et ca fonctionne.

(je comprends pas vraiment tout.. mais c'est réglé)

Hors ligne