Bonjour,
je voudrais envoyer des mèls en utilisant l'application sendmail d'une machine (HP-UX B.11.11 U 9000/785) a laquelle j'ai accès au boulot avec un compte.
Il se trouve que quand j'envoie le mail depuis telnet sur le smtp de ma boite, cela se passe bien :
Je suis cemendant obligÅ de dÅsigner le smtp/mailscanner de ma boite par son IP, sinon, quand je le designe par son nom, ma machine me rÅpond :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 $ telnet aaa.bbb.ccc.ddd 25 Trying... Connected to aaa.bbb.ccc.ddd. Escape character is '^]'. 220 mailscanner.ma_boite.net ESMTP Sendmail 8.14.3/8.14.3; Fri, 17 Sep 2010 08:21:30 +0200 EHLO ma_boite.net 250-mailscanner.ma_boite.net Hello reverse.completel.net [213.244.31.210] (may be forged), pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-AUTH DIGEST-MD5 CRAM-MD5 250-DELIVERBY 250 HELP MAIL FROM: <moi@ma_boite.net> 250 2.1.0 <moi@ma_boite.net>... Sender ok RCPT TO: <moi@ma_boite.net> 250 2.1.5 <moi@ma_boite.net>... Recipient ok RCPT TO: <moi@numericable.fr> 250 2.1.5 <moi@numericable.fr>... Recipient ok DATA 354 Enter mail, end with "." on a line by itself Subject: test message blah, blah, blah, blah, blah, blah. . 250 2.0.0 o8H6LUii025786 Message accepted for delivery QUIT 221 2.0.0 mailscanner.ma_boite.net closing connection Connection closed by foreign host. $
Ceci me laisse subodorer qu'il y a un probleme de rÅsolution de noms.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 $ telnet smtp.ma_boite.net smtp.ma_boite.net: Unknown host $ telnet mailscanner.ma_boite.net mailscanner.ma_boite.net: Unknown host
Et j'ai obtenu cette IP en utilisant le DNS de mon propre FAI, a savoir numericable, en faisant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 $ $ nslookup - 89.2.0.1 ------------ Specifying a nameserver has overridden the switch policy order. The reset command will reinstate the order specified by the switch policy. Default Name Server: ns1.numericable.net Address: 89.2.0.1 > smtp.ma_boite.net ------------ Non-authoritative answer: Name: smtp.ma_boite.net Address: aaa.bbb.ccc.ddd
Ci dessous se trouve la retranscription des échanges entre cette
application et un programme en C que j'ai fait sur le modèle trouve ici,
<http://broux.developpez.com/articles/protocoles/smtp/>
http://broux.developpez.com/articles/protocoles/smtp/ .
Voici ce qui se passe si j'essaye d'utiliser ce programme en C :
Ceci corrobore, a mon avis, le fait que ma machine ne soit pas bien "accrochee" a l'internet; en effet je suis obligÅ d'utiliser le DNS de mon propre FAI pour faire un lookup de l'adresse IP du smtp de ma boite.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 $ ./mail mail.txt ret=sethostent = 0 ret=gethostname = 0 ; hostname : ishp170 hostinfo->h_name="ishp170" (0) hostinfo->h_aliases="" (1) hostinfo->h_addrtype=2 (2) hostinfo->h_length=4 (3) inet_ntoa((in_addr)hostinfo->s_addr) hostname : (4) 192.168.11.20 ishp170 hostinfo->h_addr=1073769292 (5) hostinfo->h_name="ishp170" (7) sin.sin_addr="c0a80b14" sip2="192.168.11.20" la connexion semble Ok (8) read response(11): 220 ishp170 ESMTP Sendmail 8.9.3 (PHNE_29774)/8.9.3; Fri, 17 Sep 2010 08:21:47 +0100 (WETDST) send HELP command: HELP write_server: buffer: HELP read response(12): 214-This is Sendmail version 8.9.3 (PHNE_29774) filename=mail.txt (11.5) send EHLO buffer lu = "ma_boite.net". (12) command: EHLO ma_boite.net write_server: buffer: EHLO ma_boite.net read response(13): 250-ishp170 Hello dael@ishp170 [192.168.11.20], pleased to meet you send VERB command: VERB write_server: buffer: VERB read response(14): 250 Verbose mode send MAIL FROM command: MAIL FROM: <moi@ma_boite.net> write_server: buffer: MAIL FROM: <moi@ma_boite.net> read response(15): 051 ma_boite.net: Name server timeout
Il est a noter de plus que le fichier nsswitch.conf n'existe pas :Est il possible de specifier au smtp un DNS a utiliser pour rÅsoudre les adresses des destinataires du mail ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2$ more /etc/nsswitch.conf /etc/nsswitch.conf: No such file or directory
David
Partager