rss
twitter
  • Showcase
  • Carrières
  • Support
  • GitLab
  • Espace client
  • Contact

Utiliser Telnet pour tester un serveur de mails

0

INDEX

Comment tester un serveur POP3 ?

iMac-de-Germain-:~ germain$ telnet mail.testdomaine.fr 110
Trying 212.43.245.241...
Connected to mail.testdomaine.fr.
Escape character is '^]'.
+OK host1.germain.co.uk Cyrus POP3 v2.3.8-OS X Server 10.5:	9C31 server ready <328828657.1234107880@host1.germain.co.uk>

user test@testdomaine.fr
+OK Name is a valid mailbox

pass votre_mot_de_passe
+OK Mailbox locked and ready

list
+OK scan listing follows
1 908
.

retr 1
+OK Message follows
Return-Path: <germain@germain.net>
Received: from host1.germain.co.uk ([unix socket])
	 by host1.germain.co.uk (Cyrus v2.3.8-OS X Server 10.5:	9C31) with LMTPA;
	 Sun, 08 Feb 2009 16:43:02 +0100
X-Sieve: CMU Sieve 2.3
Received: from [192.168.0.1] (mon75-17-88-175-208-34.fbx.proxad.net [88.175.208.34])
	by host1.germain.co.uk (Postfix) with ESMTP id 461B6E1437
	for <test@testdomaine.fr>; Sun,  8 Feb 2009 16:43:02 +0100 (CET)
Message-Id: <82BC4299-AE0E-4A58-B3F8-2033C0A1B2D3@germain.net>
From: Germain  germain <germain@germain.net>
To: test@testdomaine.fr
Content-Type: text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v930.3)
Subject: Test
Date: Sun, 8 Feb 2009 16:43:01 +0100
X-Mailer: Apple Mail (2.930.3)

Germain 
germain
+33 (0) 6 777 66 285
germain@germain.net

.

quit
+OK
Connection closed by foreign host.

À retenir :
– se connecter avec user
– s’identifier avec pass – liste des mails avec list
– lecture d’un mail avec retr <id_du_mail>

Comment tester un serveur IMAP4 ?

iMac-de-Germain-:~ germain$ telnet mail.testdomaine.fr 143
Trying 212.43.245.241...
Connected to mail.testdomaine.fr.
Escape character is '^]'.
* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS AUTH=PLAIN AUTH=LOGIN AUTH=CRAM-MD5] host1.germain.co.uk Cyrus IMAP4 v2.3.8-OS X Server 10.5:	9C31 server ready

test login test@testdomaine.fr monpasswd
test OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED AUTH=PLAIN AUTH=LOGIN AUTH=CRAM-MD5 ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH] user logged in

test select inbox
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotJunk $Junk)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotJunk $Junk \*)]  
* 1 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1234024423]  
* OK [UIDNEXT 2]  
* OK [NOMODSEQ] Sorry, modsequences have not been enabled on this mailbox
* OK [URLMECH INTERNAL]
test OK [READ-WRITE] Completed

test fetch 1 body
* 1 FETCH (BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII" "FORMAT" "flowed") NIL NIL "7BIT" 86 8))
test OK Completed (0.000 sec)

test fetch 2 body[text]
* 2 FETCH (FLAGS (\Recent \Seen) BODY[TEXT] {86}

Germain 
germain
+33 (0) 6 777 66 285
germain@germain.net

)
test OK Completed (0.000 sec)

test close
test OK Completed

test logout
* BYE LOGOUT received
test OK Completed
Connection closed by foreign host.

À retenir :
– se connecter avec login
– naviguer avec select (exemple : inbox)
– lire un mail avec fetch body[text]
– le flag peut être n’importe quoi, dans mon exemple c’est test.

Comment tester un serveur SMTP ?

iMac-de-Germain-:~ germain$ telnet mail.testdomaine.fr 25
Trying 212.43.245.241...
Connected to mail.testdomaine.fr.
Escape character is '^]'.
220 host1.germain.co.uk ESMTP Postfix

EHLO testdomaine.fr
250-host1.germain.co.uk
250-PIPELINING
250-SIZE 15728640
250-VRFY
250-AUTH LOGIN PLAIN CRAM-MD5
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

MAIL FROM:test@testdomaine.fr
250 2.1.0 Ok

RCPT TO:germain@gmail.com
554 5.7.1 <germain@gmail.com>: Relay access denied

RCPT TO:germain@germain.net
450 4.2.0 <germain@germain.net>: Recipient address rejected: Greylisted, see https://postgrey.schweikert.ch/help/germain.net.html

5 minutes plus tard…

RCPT TO:germain@germain.net
250 2.1.5 Ok

DATA
354 End data with <CR><LF>.<CR><LF>
Subject: un petit test

Voila un test
.
250 2.0.0 Ok: queued as 40125E147C

QUIT
221 2.0.0 Bye
Connection closed by foreign host.

À retenir :
– signaler sa présence avec EHLO
– initialiser un mail avec MAIL FROM:<expéditeur>
– router un mail avec RCPT TO:
– remplir le mail avec DATA :
– le sujet se met avec Subject: puis passer 2 lignes
– le corps se met avec normalement mails à la fin passez 2 lignes et taper un point. C’est le point qui déclenche l’envoi du mail.

Vous recevrez quelque chose comme ça :
img14

DATE 08 Fév 2009
by : Germain
Author / Auteur

Social Share / Partager

    Leave a Reply / Répondre Annuler la réponse

    *
    *

    More in Sysadmin : Linux, Apache, GIT

    • Recevoir un mail lors de la connexion root à un serveur
    • Maildev : tester l'envoi de mails durant ses développements
    • Quel php.ini (MAMP ou Linux), quelle valeur de phpinfo() ?
    • Pense-bête Apache Server-Side Includes (SSI)
    • Ubuntu 14 chroot sftp et rsync

    Search the blog

    Blog categories

    • Front-end : HTML, CSS (13)
    • Workflow (1)
    • Front-end : javascript, jQuery (33)
    • Back-end : PHP, CMS (42)
    • Back-end : SQL, MySQL (20)
    • Sysadmin : Linux, Apache, GIT (75)
    • Designers : tools, advice (2)
    • Desktop : OS X (37)
    • Desktop : Microsoft (12)
    • Uncategorized (8)

    ITALIC™ Resources

    • Paramètres de connexion au serveur mail
    • Graphistes : séduire un développeur web
    • Dév front : nos bonnes pratiques
    • Mailing : nos (bonnes ?) pratiques
    • Environnement de travail Mac

    Recent posts

    • Autoriser le chargement de contenus mixtes non-https dans Chrome (Mac)
    • Afficher les logs MySQL
    • Recevoir un mail lors de la connexion root à un serveur
    • Changer l’interclassement de plusieurs tables MySQL à la fois (ou presque
    • Maildev : tester l’envoi de mails durant ses développements
    © 2008-2017 ITALIC™ • 8 bis rue Abel • 75012 PARIS • Tel +33 (0)1 48 44 46 35 • RCS PARIS 508 228 772 • Powered by WordPress & GoodLayers
    Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site web.
    Cookie settingsACCEPTER
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Toujours activé
    Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
    Non-necessary
    Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
    Enregistrer & appliquer