<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.r00tedvw.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.r00tedvw.com/index.php?action=history&amp;feed=atom&amp;title=General_Info%2FMail_Server_CLI%2FIMAP</id>
		<title>General Info/Mail Server CLI/IMAP - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.r00tedvw.com/index.php?action=history&amp;feed=atom&amp;title=General_Info%2FMail_Server_CLI%2FIMAP"/>
		<link rel="alternate" type="text/html" href="https://wiki.r00tedvw.com/index.php?title=General_Info/Mail_Server_CLI/IMAP&amp;action=history"/>
		<updated>2026-08-12T07:33:15Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>https://wiki.r00tedvw.com/index.php?title=General_Info/Mail_Server_CLI/IMAP&amp;diff=822&amp;oldid=prev</id>
		<title>R00t: Created page with &quot;Mail Server CLI | POP | IMAP | [[General Info/Mail Server CLI/ESMTP...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.r00tedvw.com/index.php?title=General_Info/Mail_Server_CLI/IMAP&amp;diff=822&amp;oldid=prev"/>
				<updated>2015-07-20T03:45:04Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php/General_Info/Mail_Server_CLI&quot; title=&quot;General Info/Mail Server CLI&quot;&gt;Mail Server CLI&lt;/a&gt; | &lt;a href=&quot;/index.php/General_Info/Mail_Server_CLI/POP&quot; title=&quot;General Info/Mail Server CLI/POP&quot;&gt;POP&lt;/a&gt; | &lt;a href=&quot;/index.php/General_Info/Mail_Server_CLI/IMAP&quot; title=&quot;General Info/Mail Server CLI/IMAP&quot;&gt;IMAP&lt;/a&gt; | [[General Info/Mail Server CLI/ESMTP...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[General Info/Mail Server CLI|Mail Server CLI]] | [[General Info/Mail Server CLI/POP|POP]] | [[General Info/Mail Server CLI/IMAP|IMAP]] | [[General Info/Mail Server CLI/ESMTP|ESMTP]]&lt;br /&gt;
== IMAP Overview ==&lt;br /&gt;
;IMAP&lt;br /&gt;
:Internet Message Access Protocol : Application layer internet standard protocol that uses TCP/IP. Currently version 4 revision 1 is the standard.&lt;br /&gt;
&lt;br /&gt;
Testing from a command line interface provides a virtually guaranteed way of confirming basic requirements for a successfully connection. Observations and responses observed come directly from the mail server rather than trying to interpret an application's translation of the scenario. Keep in mind that testing from a command line is generally in '''plain text''', which is '''insecure''', unless you use a connect application such as openssl&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
While much easier to test from a Linux terminal, it is possible to test from a windows command prompt, however, keep in mind that Windows does not allow you to backspace or delete any mistakes that you make. While unconfirmed, based on behavior it appears that Windows actively submits every keystroke to the mail server rather than waiting for &amp;quot;return&amp;quot;.&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
All IMAP commands passed to the server must be proceeded by a character and a space.  The character can be pretty much be anything.&lt;br /&gt;
 . login username password&lt;br /&gt;
&lt;br /&gt;
== IMAP Commands ==&lt;br /&gt;
&lt;br /&gt;
===== LOGIN =====&lt;br /&gt;
:Command used for logging into the desired mailbox &lt;br /&gt;
 . login username password&lt;br /&gt;
 . OK LOGIN completed.&lt;br /&gt;
&lt;br /&gt;
===== CAPABILITY =====&lt;br /&gt;
:Provides a listing of what commands the server supports.  Generally it lists what version of IMAP is supported, then any additional commands.&lt;br /&gt;
 . CAPABILITY&lt;br /&gt;
 * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN CHILDREN IDLE NAMESPACE LITERAL+&lt;br /&gt;
 . OK CAPABILITY completed.&lt;br /&gt;
&lt;br /&gt;
===== LIST =====&lt;br /&gt;
:Provides a listing of folders within the mailbox.  You can specify a specific folder, or you can use a wildcard, like the example below. Blank double quotes would represent the parent directory, however, you cannot use this on its own and it must be combined with a wildcard.&lt;br /&gt;
&lt;br /&gt;
 . list &amp;quot;&amp;quot; &amp;quot;*&amp;quot;&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; Calendar&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; Contacts&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; &amp;quot;Conversation History&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 . list &amp;quot;INBOX&amp;quot; &amp;quot;*&amp;quot;&lt;br /&gt;
 * LIST (\Marked \HasChildren) &amp;quot;/&amp;quot; INBOX&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; INBOX/Applications&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; &amp;quot;INBOX/Client Notifications&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== SELECT =====&lt;br /&gt;
:Selects the desired folder. You must first select the folder before you can view or modify messages within it.&lt;br /&gt;
 . select Drafts&lt;br /&gt;
 * 4 EXISTS&lt;br /&gt;
 * 4 RECENT&lt;br /&gt;
 * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)&lt;br /&gt;
 * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags&lt;br /&gt;
 * OK [UNSEEN 2] Is the first unseen message&lt;br /&gt;
 * OK [UIDVALIDITY 3516] UIDVALIDITY value&lt;br /&gt;
 * OK [UIDNEXT 2551] The next unique identifier value&lt;br /&gt;
 . OK [READ-WRITE] SELECT completed.&lt;br /&gt;
&lt;br /&gt;
===== FETCH =====&lt;br /&gt;
Fetch displays message information, either in whole or just certain parts, however, you must have selected a folder first.  I will only cover the basic options for fetch, if you want to learn more, visit [http://www.google.com/#hl=en&amp;amp;sugexp=les%3B&amp;amp;gs_nf=1&amp;amp;cp=11&amp;amp;gs_id=17&amp;amp;xhr=t&amp;amp;q=imap+fetch+command&amp;amp;pf=p&amp;amp;output=search&amp;amp;sclient=psy-ab&amp;amp;oq=imap+fetch+&amp;amp;gs_l=&amp;amp;pbx=1&amp;amp;bav=on.2,or.r_gc.r_pw.r_qf.&amp;amp;fp=af706205faec9df2&amp;amp;bpcl=35243188&amp;amp;biw=1439&amp;amp;bih=717 Google]. You must specify the command, followed by the message number, then the fetch option.&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
;FULL&lt;br /&gt;
:fetches all of the internet headers and message body.&lt;br /&gt;
 . fetch 4 full&lt;br /&gt;
 * 4 FETCH (FLAGS (\Draft) INTERNALDATE &amp;quot;25-Jul-2012 17:50:30 -0400&amp;quot; RFC822.SIZE 34269 ENVELOPE (NIL NIL NIL NIL NIL NIL NIL NIL NIL &amp;quot;&lt;br /&gt;
 &amp;lt;3D4A65565EFB3D4B9A541F98D0DA17D714DE9791@S1P5DAG2C.EXCHPROD.USA.NET&amp;gt;&amp;quot;)&lt;br /&gt;
 BODY ((&amp;quot;text&amp;quot; &amp;quot;html&amp;quot; (&amp;quot;charset&amp;quot; &amp;quot;us-ascii&amp;quot;) NIL NIL &amp;quot;quoted-printable&amp;quot; 28175 545)(&amp;quot;image&amp;quot; &amp;quot;jpeg&amp;quot; (&amp;quot;name&amp;quot; &amp;quot;image001.jpg&amp;quot;) &amp;quot;&amp;lt;image001.jpg@01CD6A8D.FB234CA0&amp;gt;&amp;quot; &amp;quot;image001.jpg&amp;quot; &amp;quot;base64&amp;quot; 5778) &amp;quot;related&amp;quot;))&lt;br /&gt;
 . OK FETCH completed.&lt;br /&gt;
&lt;br /&gt;
;RFC822.HEADER&lt;br /&gt;
:fetches just the header information of the message&lt;br /&gt;
 . fetch 309 rfc822.header&lt;br /&gt;
 * 309 FETCH (RFC822.HEADER {2498}&lt;br /&gt;
 Received: from gwsin07.mbox.net [165.212.64.38] by cmsmail03.cms.usa.net via mtad (C8.MAIN.3.82G) &lt;br /&gt;
 	with ESMTP id 764RHEPn11280M03; Sat, 31 Aug 2013 15:39:52 -0000&lt;br /&gt;
 Return-Path: &amp;lt;584-HKV-900.0.1182.0.0.1299.7.741263@em-sj-77.mktomail.com&amp;gt;&lt;br /&gt;
 Received: from gwsin07.mbox.net (gwsin.mbox.net [165.212.65.100])&lt;br /&gt;
 	by gwsin07.mbox.net (Postfix) with ESMTP id 3cS1vr3nBfzfhnrQ&lt;br /&gt;
 	for &amp;lt;ilathrop@farmersagent.com&amp;gt;; Sat, 31 Aug 2013 15:39:52 +0000 (UTC)&lt;br /&gt;
 X-USANET-Received: from emd2.mbox.net [165.212.64.9] by gwsin07.mbox.net via mtad (C8.MAIN.3.82G) &lt;br /&gt;
 	with ESMTP id 335RHEPnt1248Ms7; Sat, 31 Aug 2013 15:39:44 -0000&lt;br /&gt;
 X-USANET-Routed: 10 gwsin-externalarchive C:gwsarchive:625 fv9fwv5kp@incoming02.seccas.com&lt;br /&gt;
 X-USANET-Routed: 1 gwsin-bmcheck Q:bmcheck&lt;br /&gt;
 X-USANET-Routed: 10 gwsin-externalarchive C:gwsarchive:625 farmersagent.com.gw.9987@incoming02.seccas.com&lt;br /&gt;
 X-USANET-Routed: 5 gwsin-gwsd Q:gwsd&lt;br /&gt;
 X-USANET-Routed: 2 gwsin-vs Q:bmrelayvs&lt;br /&gt;
 X-USANET-Routed: 100 IN-RELAY R:gwsin:650&lt;br /&gt;
 X-USANET-GWS2-Tenant: farmersagent.com&lt;br /&gt;
 X-USANET-GWS2-Tagid: FI03&lt;br /&gt;
 Received: from em-sj-82.mktomail.com [199.15.215.82] by emd2.mbox.net via smtad (C8.MAIN.3.90S) &lt;br /&gt;
 	with ESMTP id XID703RHEPnt3527Xd2; Sat, 31 Aug 2013 15:39:45 -0000&lt;br /&gt;
 X-USANET-Source: 199.15.215.82   IN   584-HKV-900.0.1182.0.0.1299.7.741263@em-sj-77.mktomail.com em-sj-82.mktomail.com&lt;br /&gt;
 X-USANET-MsgId: XID703RHEPnt3527Xd2&lt;br /&gt;
 X-USANET-ApprovedSender: UNK&lt;br /&gt;
 X-MSFBL: aWxhdGhyb3BAZmFybWVyc2FnZW50LmNvbUBkdnAtMTk5LTE1LTIxNS04MkBiZy1z&lt;br /&gt;
 	ai0wMUA1ODQtSEtWLTkwMDo1NDU6MTE4MjoyMzY0OjA6MTI5OTo3Ojc0MTI2Mw==&lt;br /&gt;
 Received: from [10.0.8.1] ([10.0.8.1:50392] helo=sjmas01.marketo.org)&lt;br /&gt;
 	by sjmta03.marketo.org (envelope-from &amp;lt;events@inc.com&amp;gt;)&lt;br /&gt;
 	(ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP&lt;br /&gt;
 	id 28/32-06769-14E02225; Sat, 31 Aug 2013 10:39:45 -0500&lt;br /&gt;
 Date: Sat, 31 Aug 2013 10:39:45 -0500 (CDT)&lt;br /&gt;
 From: National Association of Professional Women &amp;lt;events@inc.com&amp;gt;&lt;br /&gt;
 Reply-To: events@inc.com&lt;br /&gt;
 To: ilathrop@farmersagent.com&lt;br /&gt;
 Message-ID: &amp;lt;184676378.25376245.1377963585053.JavaMail.root@bg-sj-01&amp;gt;&lt;br /&gt;
 Subject: You're Invited: Join us at the Inc. Women's Summit and save!&lt;br /&gt;
 MIME-Version: 1.0&lt;br /&gt;
 Content-Type: multipart/alternative; &lt;br /&gt;
 	boundary=&amp;quot;----=_Part_25376236_472772387.1377963585045&amp;quot;&lt;br /&gt;
 X-Report-Abuse: Please report abuse here: http://www.marketo.com/policy&lt;br /&gt;
 breadcrumbId: ID-sjmas01-marketo-org-41295-1377720176785-0-64443348&lt;br /&gt;
 X-MarketoID: 584-HKV-900:545:1182:2364:0:1299:7:741263&lt;br /&gt;
 X-Mailfrom: 584-HKV-900.0.1182.0.0.1299.7.741263@em-sj-77.mktomail.com&lt;br /&gt;
 X-Binding: bg-sj-01&lt;br /&gt;
 &lt;br /&gt;
 )&lt;br /&gt;
 . OK FETCH completed&lt;br /&gt;
&lt;br /&gt;
;RFC822&lt;br /&gt;
:fetches pretty much everything in the message&lt;br /&gt;
 . fetch 4 rfc822&lt;br /&gt;
 * 4 FETCH (RFC822 {34941}&lt;br /&gt;
 Subject:&lt;br /&gt;
 Thread-Index: AQHNarFoJpF7uLMAEkGPm8GPw83Wvw==&lt;br /&gt;
 Message-ID:&lt;br /&gt;
 &amp;lt;3D4A65565EFB3D4B9A541F98D0DA17D714DE9791@S1P5DAG2C.EXCHPROD.USA.NET&amp;gt;&lt;br /&gt;
 Content-Language: en-US&lt;br /&gt;
 X-MS-Has-Attach: yes&lt;br /&gt;
 X-MS-TNEF-Correlator:&lt;br /&gt;
 Content-Type: multipart/related;&lt;br /&gt;
 	boundary=&amp;quot;_002_3D4A65565EFB3D4B9A541F98D0DA17D714DE9791S1P5DAG2CEXCHPR_&amp;quot;;&lt;br /&gt;
 	type=&amp;quot;text/html&amp;quot;&lt;br /&gt;
 MIME-Version: 1.0&lt;br /&gt;
 &lt;br /&gt;
 --_002_3D4A65565EFB3D4B9A541F98D0DA17D714DE9791S1P5DAG2CEXCHPR_&lt;br /&gt;
 Content-Type: text/html; charset=&amp;quot;us-ascii&amp;quot;&lt;br /&gt;
 Content-Transfer-Encoding: quoted-printable&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;html xmlns:v=3D&amp;quot;urn:schemas-microsoft-com:vml&amp;quot; xmlns:o=3D&amp;quot;urn:schemas-micr=&lt;br /&gt;
 osoft-com:office:office&amp;quot; xmlns:w=3D&amp;quot;urn:schemas-microsoft-com:office:word&amp;quot; =&lt;br /&gt;
 xmlns:m=3D&amp;quot;http://schemas.microsoft.com/office/2004/12/omml&amp;quot; xmlns=3D&amp;quot;http:=&lt;br /&gt;
 //www.w3.org/TR/REC-html40&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;head&amp;gt;&lt;br /&gt;
 &amp;lt;meta http-equiv=3D&amp;quot;Content-Type&amp;quot; content=3D&amp;quot;text/html; charset=3Dus-ascii&amp;quot;=&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
 &amp;lt;o:shapelayout v:ext=3D&amp;quot;edit&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;o:idmap v:ext=3D&amp;quot;edit&amp;quot; data=3D&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/o:shapelayout&amp;gt;&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
 &amp;lt;/head&amp;gt;&lt;br /&gt;
 &amp;lt;body lang=3D&amp;quot;EN-US&amp;quot; link=3D&amp;quot;blue&amp;quot; vlink=3D&amp;quot;purple&amp;quot; style=3D&amp;quot;tab-interval:.=&lt;br /&gt;
 5in&amp;quot;&amp;gt;&lt;br /&gt;
 Content-ID: &amp;lt;image001.jpg@01CD6A8D.FB234CA0&amp;gt;&lt;br /&gt;
 Content-Transfer-Encoding: base64&lt;br /&gt;
 &lt;br /&gt;
 /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcG&lt;br /&gt;
 BwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwM&lt;br /&gt;
 DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAA2AMgDASIA&lt;br /&gt;
 2Q==&lt;br /&gt;
 &lt;br /&gt;
 --_002_3D4A65565EFB3D4B9A541F98D0DA17D714DE9791S1P5DAG2CEXCHPR_--&lt;br /&gt;
  FLAGS (\Seen \Draft))&lt;br /&gt;
 . OK FETCH completed.&lt;br /&gt;
 &lt;br /&gt;
;FLAGS&lt;br /&gt;
:fetches what flags have been set for the message.  Flags define everything from whether or not you can see the message, what folder it is organized under, and if it needs to be deleted.  This is why you commonly see &amp;quot;Purge&amp;quot; options in email clients, like Outlook, when you have configured an IMAP account.  When you delete a message, it only adds the delete flag to the message,  but does not delete it.  You then must close your session for the new flag options to be applied.&lt;br /&gt;
 . fetch 4 flags&lt;br /&gt;
 * 4 FETCH (FLAGS (\Seen \Draft))&lt;br /&gt;
 . OK FETCH completed.&lt;br /&gt;
&lt;br /&gt;
===== LOGOUT =====&lt;br /&gt;
:Does the obvious, logs you out.&lt;br /&gt;
 . logout&lt;br /&gt;
 * BYE Microsoft Exchange Server 2010 IMAP4 server signing off.&lt;br /&gt;
 . OK LOGOUT completed.&lt;br /&gt;
&lt;br /&gt;
== Full Session Example ==&lt;br /&gt;
 Franks-MacBook-Pro:~ fvazquez$ telnet exchange.postoffice.net 143&lt;br /&gt;
 Trying 165.212.120.200...&lt;br /&gt;
 Connected to exchange.postoffice.net.&lt;br /&gt;
 Escape character is '^]'.&lt;br /&gt;
 * OK The Microsoft Exchange IMAP4 service is ready.&lt;br /&gt;
 . login username password&lt;br /&gt;
 . OK LOGIN completed.&lt;br /&gt;
 . CAPABILITY&lt;br /&gt;
 * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN CHILDREN IDLE NAMESPACE LITERAL+&lt;br /&gt;
 . OK CAPABILITY completed.&lt;br /&gt;
 . list &amp;quot;&amp;quot; &amp;quot;*&amp;quot;&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; Calendar&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; Contacts&lt;br /&gt;
 * LIST (\HasNoChildren) &amp;quot;/&amp;quot; &amp;quot;Conversation History&amp;quot;&lt;br /&gt;
 . select Drafts&lt;br /&gt;
 * 4 EXISTS&lt;br /&gt;
 * 4 RECENT&lt;br /&gt;
 * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)&lt;br /&gt;
 * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags&lt;br /&gt;
 * OK [UNSEEN 2] Is the first unseen message&lt;br /&gt;
 * OK [UIDVALIDITY 3516] UIDVALIDITY value&lt;br /&gt;
 * OK [UIDNEXT 2551] The next unique identifier value&lt;br /&gt;
 . OK [READ-WRITE] SELECT completed.&lt;br /&gt;
 . fetch 4 full&lt;br /&gt;
 * 4 FETCH (FLAGS (\Draft) INTERNALDATE &amp;quot;25-Jul-2012 17:50:30 -0400&amp;quot; RFC822.SIZE 34269 ENVELOPE (NIL NIL NIL NIL NIL NIL NIL NIL NIL &amp;quot;&lt;br /&gt;
 &amp;lt;3D4A65565EFB3D4B9A541F98D0DA17D714DE9791@S1P5DAG2C.EXCHPROD.USA.NET&amp;gt;&amp;quot;)&lt;br /&gt;
 BODY ((&amp;quot;text&amp;quot; &amp;quot;html&amp;quot; (&amp;quot;charset&amp;quot; &amp;quot;us-ascii&amp;quot;) NIL NIL &amp;quot;quoted-printable&amp;quot; 28175 545)(&amp;quot;image&amp;quot; &amp;quot;jpeg&amp;quot; (&amp;quot;name&amp;quot; &amp;quot;image001.jpg&amp;quot;) &amp;quot;&amp;lt;image001.jpg@01CD6A8D.FB234CA0&amp;gt;&amp;quot; &amp;quot;image001.jpg&amp;quot; &amp;quot;base64&amp;quot; 5778) &amp;quot;related&amp;quot;))&lt;br /&gt;
 . OK FETCH completed.&lt;br /&gt;
 . fetch 4 flags&lt;br /&gt;
 * 4 FETCH (FLAGS (\Seen \Draft))&lt;br /&gt;
 . OK FETCH completed.&lt;br /&gt;
 . logout&lt;br /&gt;
 * BYE Microsoft Exchange Server 2010 IMAP4 server signing off.&lt;br /&gt;
 . OK LOGOUT completed.&lt;/div&gt;</summary>
		<author><name>R00t</name></author>	</entry>

	</feed>