Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

IMAP Protocol- IOT Part 47

By Priya October 23, 2018

Emails are the most commonly used communication in the today’s digital era. The emails can also be way of communication with IoT devices. The emails can be used to pass commands to IoT devices. The devices can then be programmed and configured to read emails received and act accordingly. There can be interesting applications built this way. For receiving emails, the IoT devices need to configure as an Email Client. They can retrieve emails only over a standard email protocol. Internet Message Access Protocol (IMAP) is one of the standard email message protocols. 
 
It is standard email messaging protocol used worldwide in 21st century.  After the internet era started gaining momentum, most of the emailing and messaging tasks were based on POP (Post Office Protocol). As the need of more robust, flexible and advanced messaging protocol emerges, Mark Crispin invented a remote mailbox protocol in 1986 known as IMAP. It was also known as Interactive mail access protocol and interim mail access protocol. IMAP was designed with the goal of complete management of email box from multiple email clients. Clients generally leaves a message on the server until the user explicitly deletes them. 
 
Advantage of IMAP over previous version POP – 
 
IMAP offers several advantages over previous POP versions like as follow – 
 
1) Fast Response – IMAP version 4 stays connected to the server unlike POP where connection is lost briefly after download of mail is completed. IMAPv4 allows faster and swift response because it stays connected to the server. 
 
2) Multiple clients simultaneously connected to same mailbox – IMAP allows multiple clients to be connected to same mailbox unlike POP where currently connected clients’ need to be the only client connected to mailbox. IMAP allows us to open the Gmail from PC, phone, or tab at the same time. 
 
3) Message state information – There are different flags in IMAP for different state of email data. For example, the status of the email can be checked whether it is received, read or replied. These flags are stored at server end, so opening the mailbox from any device is able to update the flag and status can be seen from any device.
 
4) Server-side Search – IMAP provides the search at server end, so client do not need to download every data to its device for searching. This helps in decreasing data payload and faster use of email database. 
Though, there are many advantages of the IMAP, the disadvantage is that it adds complexity in the implementation relative to POP.
 
Functioning of IMAP protocol – 
 
An IMAP server usually listen to requests on port number 143 and if SSL (Secure Socket Layer) is present then, port number 993. Transmission and Reception of emails is done using two protocols: SMTP (Simple mail transfer protocol) and IMAP. The emails are received using IMAP protocol in the following steps – 
 
1. Open Connection 
2. Authentication 
3. Select Folder
4. Fetch
5. Logout
 
A basic algorithm of receiving emails on IMAP is summarized in the image below – 
 
Protocol Email Retrieving Algorithm
Fig.1 : Protocol Email Retrieving Algorithm
 
1. Open Connection – To initialize the mail retrieving process, there must first open a socket object. A socket is internal end point for sending and receiving data at a single node in computer network. The data can be sent or received using this socket object.
 
2. Authentication: Once there is an established socket, username and password must be transmitted for the authentication. The server will respond OK for correct credentials and query if credentials are incorrect. 
 
3. Select Folder: Once credentials are authorized, the complete mail box access and folders list can be accessed by sending folder commands. The server will respond with folders list such as “Inbox”, “Sent”, “Trash”, “Drafts” etc. Before receiving any mail data from server, a folder must be selected for which user want to see/manage the data. 
 
4. Fetch: Once the folder is selected, the data can be received using fetch commands. The user will receive the list of mails, unread mails and mail data from the selected folder. He has the ability to edit data, mark them Read/Unread or delete if required.
 
5. Logout: When the user log out of the server, the server closes the connection, thus socket object is closed. No data/signal can be transmitted or received using IMAP once the connection is closed.
 
While implementing IMAP protocol, STARTTLS can be used to provide secure communication between various nodes of sender/receiver. 
 
Applications – 
 
All the emailing servers like Gmail, Yahoo supports IMAP protocols for email management. A user is able to read and manage his emails from multiple devices using IMAP. A real-world example is of wearable devices. The emails are stored at Google, yahoo servers and IMAP help in retrieving and managing the email data on the wearables. The wearables devices have a built-in app which supports IMAP. When connected with internet, app initializes a socket object and asks for the username and password. The credentials are sent to the server and after verification generally the user see the data of Inbox folder. The inbox folder is selected in the app by default, and later the UI of the app allows to see other folders too. It allows to manage the mailbox like the user can delete mails, mark them as read/unread etc. 
 
In the next tutorial, learn to receive commands through Email on a Raspberry Pi based IoT device. 
 

Filed Under: Tutorials

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • What is the purpose of the diode from gate to GND in normal Colpitts oscillator Circuits?
  • Antiparallel Schottky Diodes VDI-Load Pull
  • interfacing gsm and gps in proteus
  • 12VAC to 12VDC 5A on 250ft 12AWG
  • My array have wrong radiation pattern

RSS Electro-Tech-Online.com Discussions

  • how to work on pcbs that are thick
  • Actin group needed for effective PCB software tutorials
  • Kawai KDP 80 Electronic Piano Dead
  • Doing consultancy work and the Tax situation?
  • How to repair this plug in connector where wires came loose

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • ITG Electronics releases gate drive transformers with 200 – 450 V DC capability
  • Stackpole introduces HCJ jumpers with 70.7 amp continuous current capability
  • Infineon releases MCU with 128K flash and multi-sense capabilities
  • ST introduces 600V GaN gate drivers with 300 ns start-up time
  • ABLIC releases S-19116 automotive voltage detector with 6.8μs response time

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe