Envoyer un mail en ligne de commande sur une adresse Gmai

Bonjour,

Tout est dans le titre mais bon, je n’arrive pas a envoyer d’email sur les adresses Gmail.

Aucune adresse Gmail ne passe ?
Savez-vous pourquoi ?
Et sur une adresse Free ça marche ?

Je suis sur Debian squeeze 2.6.39.4.

cat /var/log/mail.log

Jan 14 07:04:24 debian postfix/qmgr[1896]: B3FDA52AF6: from=<serveur@debian>, size=420, nrcpt=1 (queue active) Jan 14 07:04:54 debian postfix/smtp[3444]: connect to gmail-smtp-in.l.google.com[173.194.67.26]:25: Connection timed out Jan 14 07:05:24 debian postfix/smtp[3444]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out Jan 14 07:05:54 debian postfix/smtp[3444]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out Jan 14 07:06:24 debian postfix/smtp[3444]: connect to alt3.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out Jan 14 07:06:54 debian postfix/smtp[3444]: connect to alt4.gmail-smtp-in.l.google.com[74.125.141.27]:25: Connection timed out Jan 14 07:06:55 debian postfix/smtp[3444]: B3FDA52AF6: to=<xxxxx@gmail.com>, relay=none, delay=30428, delays=30278/0.06/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.141.27]:25: Connection timed out) Jan 14 07:09:24 debian postfix/qmgr[1896]: 2439852A7D: from=<serveur@debian>, size=501, nrcpt=1 (queue active) Jan 14 07:09:24 debian postfix/qmgr[1896]: 0288352AD2: from=<serveur@debian>, size=432, nrcpt=1 (queue active) Jan 14 07:09:54 debian postfix/smtp[3460]: connect to gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out Jan 14 07:09:54 debian postfix/smtp[3461]: connect to gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out Jan 14 07:10:24 debian postfix/smtp[3460]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out Jan 14 07:10:24 debian postfix/smtp[3461]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.27]:25: Connection timed out Jan 14 07:10:54 debian postfix/smtp[3460]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.27]:25: Connection timed out Jan 14 07:10:54 debian postfix/smtp[3461]: connect to alt2.gmail-smtp-in.l.google.com[173.194.69.26]:25: Connection timed out Jan 14 07:11:24 debian postfix/smtp[3460]: connect to alt3.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out Jan 14 07:11:24 debian postfix/smtp[3461]: connect to alt3.gmail-smtp-in.l.google.com[74.125.143.27]:25: Connection timed out Jan 14 07:11:54 debian postfix/smtp[3460]: connect to alt4.gmail-smtp-in.l.google.com[74.125.141.27]:25: Connection timed out Jan 14 07:11:54 debian postfix/smtp[3461]: connect to alt4.gmail-smtp-in.l.google.com[74.125.141.26]:25: Connection timed out Jan 14 07:11:54 debian postfix/smtp[3460]: 2439852A7D: to=<xxxxx@gmail.com>, relay=none, delay=37428, delays=37278/0.05/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.141.27]:25: Connection timed out) Jan 14 07:11:54 debian postfix/smtp[3461]: 0288352AD2: to=<xxxxx@gmail.com>, relay=none, delay=36393, delays=36242/0.06/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.141.26]:25: Connection timed out) root@debian:~#

Le port 25 est ouvert

[code]serveur@debian:~$ nmap 192.168.0.1

Starting Nmap 5.00 ( http://nmap.org ) at 2013-01-14 07:28 CET
Interesting ports on 192.168.0.1:
Not shown: 991 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1099/tcp open unknown
1100/tcp open unknown
2000/tcp open callbook
10000/tcp open snet-sensor-mgmt

Nmap done: 1 IP address (1 host up) scanned in 1.04 seconds
Vous avez du nouveau courrier dans /var/mail/serveur
serveur@debian:~$ [/code]

Merci.

Peut être le nom de ta machine : from=serveur@debian
C’est tout ce que je voie dans la mesure ou ça marche chez free.

Bonjour,

[quote]Peut être le nom de ta machine : from=serveur@debian
C’est tout ce que je voie dans la mesure ou ça marche chez free.[/quote]
Vous voulez dire le hosts

root@debian:~# cat /etc/hosts 127.0.0.1 localhost 127.0.0.1 debian root@debian:~#

Question : dans quel fichier est il spécifié le smtp pour mail ? genre

Merci.

Ton reverse-DNS est correctement configuré ?

Bonjour,

Je ne sais pas si le reverse-DNS est correctement configuré.
Y a t’il un moyen de le vérifier ?

Sinon mon fichier de exim4 est comme ceci :

[code]# /etc/exim4/update-exim4.conf.conf

Edit this file and /etc/mailname by hand and execute update-exim4.conf

yourself or use ‘dpkg-reconfigure exim4-config’

Please note that this is not a dpkg-conffile and that automatic changes

to this file might happen. The code handling this will honor your local

changes, so this is usually fine, but will break local schemes that mess

around with multiple versions of the file.

update-exim4.conf uses this file to determine variable values to generate

exim configuration macros for the configuration file.

Most settings found in here do have corresponding questions in the

Debconf configuration, but not all of them.

This is a Debian specific file

dc_eximconfig_configtype='local’
dc_other_hostnames='debian’
dc_local_interfaces=‘127.0.0.1 ; ::1’
dc_readhost=’‘
dc_relay_domains=’'
dc_minimaldns=‘false’
dc_relay_nets=’‘
dc_smarthost=’'
CFILEMODE='644’
dc_use_split_config=‘false’
dc_hide_mailname=’'
dc_mailname_in_oh='true’
dc_localdelivery='mail_spool’
root@debian:~# [/code]

Merci.

En t’assurant d’abord que le paquet dns-utils est installé :

Ça doit normalement te renvoyer le nom d’hôte complet de ta machine (par exemple mail.tondomaine.com).

Re,

J’ai un problème avec le paquet dns-utils, qui est introuvable ?

root@debian:~# apt-get install dns-utils Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait E: Impossible de trouver le paquet dns-utils root@debian:~#

Merci.

dnsutils sans tiret, pardon. :blush:

Re,

Merci.
Voila ce qu’il me répond, mais c’est du charabia ???

[code]serveur@debian:~$ dig -x 192.168.0.1

; <<>> DiG 9.7.3 <<>> -x 192.168.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4559
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;1.0.168.192.in-addr.arpa. IN PTR

;; AUTHORITY SECTION:
168.192.in-addr.arpa. 10800 IN SOA localhost. nobody.invalid. 1 3600 1200 604800 10800

;; Query time: 33 msec
;; SERVER: 212.xx.xx.xxx#53(212.xx.xx.xxx)
;; WHEN: Mon Jan 14 10:24:59 2013
;; MSG SIZE rcvd: 101

serveur@debian:~$ [/code]

Je ne me rappelle plus si j’ai configuré exim4 ou postfix, car il y a longtemps que je l’ai fait.
Pour savoir lequel est utilisé j’ai fait ceci :

serveur@debian:~$ nc localhost 25 220 debian ESMTP Postfix (Debian/GNU) ^C donc si je comprends bien c’est postfix qui envoient les mails de free actuellement ?

Merci.

Bonjour,

J’ai vu parler de free, si tu es chez eux, il faut autoriser l’utilisation d’un smtp externe dans la console de la freebox, par défaut cette option est désactivée.

Si tu n’es pas chez eux, désolé pour le bruit :116

Usti

bonjour,

Je suis chez Free.
Dans le config de la freebox il y a bien d’indiqué :

Les mails ne passent pas aussi pour hotmail.fr

j’ai créer un fichier # touch /etc/postfix/transport
avec a l’interieur :

root@debian:~# cat /etc/postfix/transport hotmail.fr smtp:smtp.free.fr hotmail.com smtp:smtp.free.fr yahoo.fr smtp:smtp.free.fr yahoo.com smtp:smtp.free.fr gmail.com smtp:smtp.free.fr gmail.fr smtp:smtp.free.fr root@debian:~#
puis j’ai fait

root@debian:~# postmap /etc/postfix/transport root@debian:~#
et redemarrer postfix

root@debian:~# /etc/init.d/postfix restart Stopping Postfix Mail Transport Agent: postfix. Starting Postfix Mail Transport Agent: postfix. root@debian:~#
Mais rien n’a changé les emails pour hotmail.fr et gmail.com ne passe pas, et les emails de free.fr ne passent plus ???

J’ai supprimé “smtp.free.fr” du fichier “/etc/postfix/main.cf” à la ligne "relayhost = " les emails de free repassent mais hotmail.fr et gmail.com toujours pas.

Merci.

Désactive le port SMTP sortant.

Pour le reverse DNS, tu as une chance sur deux d’avoir un souci, il te faut faire

dig -x IP_Publique et non dig -x IP_locale.

Souvent (bien que ça ne soit pas dans les RFC), on vérifie que le revese DNS pointe vers le nolm du serveur de courrier.

Bonjour,

J’ai Désactivé le port SMTP sortant de la freebox : les emails de Free ne passent plus.

Voila le résultat :

[code]serveur@debian:~$ dig -x 78.xxx.xx.xxx

; <<>> DiG 9.7.3 <<>> -x 78.xxx.xx.xxx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13492
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;145.xxx.xx.xxx.in-addr.arpa. IN PTR

;; ANSWER SECTION:
145.xx.xxx.xx.in-addr.arpa. 86400 IN PTR tou83-1-78-xxx.xx.xxx.fbx.proxad.net.

;; Query time: 41 msec
;; SERVER: 212.xxx.xx.xxx0#53(212.xx.xx.xxx)
;; WHEN: Mon Jan 14 14:25:15 2013
;; MSG SIZE rcvd: 94

serveur@debian:~$
[/code]

root@debian:~# netstat -tlp
Connexions Internet actives (seulement serveurs)
Proto Recv-Q Send-Q Adresse locale          Adresse distante        Etat        PID/Program name    
tcp        0      0 smtp.free.fr:mysql      *:*                     LISTEN      1510/mysqld     
tcp        0      0 *:netbios-ssn           *:*                     LISTEN      1222/smbd       
tcp        0      0 *:rmiregistry           *:*                     LISTEN      745/mochad      
tcp        0      0 *:1100                  *:*                     LISTEN      745/mochad      
tcp        0      0 *:1101                  *:*                     LISTEN      745/mochad      
tcp        0      0 *:webmin                *:*                     LISTEN      1848/perl           
tcp        0      0 *:ssh                   *:*                     LISTEN      1615/sshd       
tcp        0      0 *:smtp                  *:*                     LISTEN      5244/master     
tcp        0      0 *:microsoft-ds          *:*                     LISTEN      1222/smbd       
tcp6       0      0 [::]:8585               [::]:*                  LISTEN      1254/apache2    
tcp6       0      0 [::]:www                [::]:*                  LISTEN      1254/apache2    
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      1615/sshd       
root@debian:~# 

serveur@debian:~$ host 78.xxx.xx.xxx 145.xx.xxx.xx.in-addr.arpa domain name pointer tou83-1-78-xxx-xx-xxx.fbx.proxad.net. Vous avez du nouveau courrier dans /var/mail/serveur serveur@debian:~$

Merci.