|
|||||
Interrogation d'un serveur mail avec telnet | |||||
Objectif : Il est parfois utile de pouvoir tester un serveur mail sans configurer un logiciel client. La connexion à l'aide de telnet fait l'objectif de ce TP. Voici donc quelques séquences de connexion SMTP, POP et IMAP simples. 1) Connexion SMTP :
telnet serveur4.pfe.tn 25 Trying 192.168.38.50.... Connected to serveur4.pfe.tn. Escape character is '^]'. 220 serveur4.pfe.tn ESMTP Sendmail 8.13.1/8.13.1
data 354 End data with <CR> <LF>. <CR> <LF>; Salut Mr. Root, Comment vas-tu ? (enter) . (enter) Bye Bye… // Pour terminer la saisie du message il faut un point entre deux retour à la ligne. Read-Receipt-To: [email protected] //Exemple de tag pour demander un accusé de réception Subject: Envoi de message avec telnet au root de serveur4 // Chaque élément d'entête doit être constitué du 'tag' et de la valeur associée. (ici : le sujet du mail) // Le corps du message est saisi directement après l'entête // Le ‘ point' pour terminer le message. 250 Ok: queued as 9501834B659 // Le message a bien été envoyé 2) Connexion POP :
telnet serveur4.pfe.tn 110
Trying 192.168.38.50... Connected to serveur4.pfe.tn. Escape character is '^]'. +OK mail.easymac.fr Cyrus POP3 v2.2.12-OS X 10.4.0 server ready <1770852571.1148452588@mail>
user root +OK Name is a valid mailbox pass monmotdepasse +OK Mailbox locked and ready
list 1 4923 // Le premier mail a un taille de 4923 octets 2 1981 3 9071 ... 16876 17789 16877 5195 . // Le 'point' annonce la fin de la liste, il y a 16877 mails
. retr 1 +OK Message follows Return-Path: <[email protected]> Received: from serveur4.pfe.tn ([unix socket]) by serveur4.pfe.tn (Sendmail v8.13.1) with ESMTP; Tue, 03 Oct 2006 11:38:35 +0200 Received: from mail.yahoo.fr (mail.yahoo.fr [213.228.0.62]) by mail.yahoo.fr (Postfix) with ESMTP id A7D363457F for <[email protected]>; Tue, 7 Sep 2004 11:38:34 +0200 (CEST) Received: from imp6-q.free.fr (imp6-q.free.fr [212.27.42.6]) by postfix4-1.free.fr (Postfix) with ESMTP id 56A45184A25 for <root@pfe>; Tue, 7 Sep 2004 11:38:29 +0200 (CEST) Message-ID: <[email protected]> Date: Tue, 4 Oct 2006 11:37:49 +0200 From: [email protected] To: Root Pfe <[email protected]> Subject: Voici la liste des enseigants References: <BD624665.7D2F%[email protected]> In-Reply-To: <BD624665.7D2F%[email protected]> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.5 X-Originating-IP: 62.147.102.43 Voici la liste des enseignants: * Krout Wiem * Rabboudi Aymen * Bouagina Mannoubiyya * Bouachir Ghaylen //
dele 1 ------------>N° de message.
+OK message deleted
exit +OK Connection closed by foreign host. 3) Connexion IMAP :
telnet serveur4.pfe.tn 143
Trying 192.168.38.50... Connected to serveur4.pfe.tn Escape character is '^]'. * OK serveur4.pfe.tn Sendmail IMAP4 v2.2.12-OS X 10.4.0 server ready
a001 login user pass
a001 OK User logged in
a002 select inbox
a002 select inbox //on selectionne sa mailbox * 2 EXISTS * 2 RECENT * OK [UIDVALIDITY 1008871592] UID validity status * OK [UIDNEXT 3] Predicted next UID * FLAGS (\Answered \Flagged \Deleted \Draft \Seen) * OK [PERMANENTFLAGS (\* \Answered \Flagged \Deleted \Draft \Seen)] Permanent flags * OK [UNSEEN 1] first unseen message in /var/spool/mail/pop11529 a002 OK [READ-WRITE] SELECT completed
a003 fetch 1 full
* 1 FETCH (FLAGS (\Seen $NotJunk MessageJunkMailLevel JunkRecorded) INTERNALDATE " 7- Sep-2004 11:38:35 +0200" RFC822.SIZE 1615 ENVELOPE ("Tue, 7 Sep 2004 11:37:49 +0200" "La liste des enseignant" ((NIL NIL "poste5" "pfe.tn")) ((NIL NIL "poste5" "pfe.tn")) ((NIL NIL "poste5" "pfe.tn")) (("Poste5" NIL "Poste5" "pfe.tn")) NIL NIL {41} <BD624665.7D2F%[email protected]> "<1094549869.413d816d738ae@imp6- q.free.fr>") BODY ("TEXT" "PLAIN" ("CHARSET" "ISO-8859-1") NIL NIL "8BIT" 195 4)) a003 OK Completed (0.000 sec)
a004 fetch 1 body
* 1 FETCH (BODY ("TEXT" "PLAIN" ("CHARSET" "ISO-8859-1") NIL NIL "8BIT" 195 4)) a003 OK Completed (0.000 sec) a003 fetch 1 body[text] * 1 FETCH (BODY[TEXT] {195} ok root, Liste réçu... a003 OK Completed (0.000 sec)
a004 logout * BYE LOGOUT received a004 OK Completed Connection closed by foreign host. |
Révisé le :11-06-2009| © www.technologuepro.com