imap

 

📌 IMAP (Internet Message Access Protocol) Nedir?

IMAP, bir e-posta istemcisinin (örneğin: Outlook, Thunderbird) e-postaları uzaktaki bir sunucu üzerinde yönetmesini sağlayan bir protokoldür. IMAP sayesinde e-postaları sunucuda tutarak farklı cihazlardan senkronize biçimde erişim sağlanabilir.


📦 POP3 vs IMAP Kıyaslaması:

ÖzellikPOP3IMAP
E-posta nerede tutulur?Genellikle istemciye indirilirSunucuda kalır
Çoklu cihaz desteğiSınırlı (indirilince sunucudan silinir)Harika (senkronizasyon desteklenir)
Erişim türüYerel erişim (offline)Online erişim, sürekli senkronizasyon
Varsayılan port110 (995 SSL ile)143 (993 SSL ile)

🧠 IMAP Ne Zaman Kullanılır?

  • Birden fazla cihazdan e-postalara erişiyorsan (örneğin hem telefon hem laptop),

  • E-postaların sunucuda kalmasını istiyorsan,

  • Klasörler (Inbox, Sent, Spam, vb.) arasında tam kontrol istiyorsan,

IMAP tercih edilmelidir.


🔑 Temel IMAP Komutları:

IMAP, daha gelişmiş bir protokol olduğu için komutları daha yapısaldır ve genellikle her komut bir etiket (tag) ile başlar (örneğin A001, A002, gibi). Bu etiketler, istemcinin sunucudan gelen cevapları hangi komutla eşleştireceğini anlamasını sağlar.

KomutAçıklama
A001 LOGIN kullanıcı şifreSunucuya kullanıcı adı ve şifre ile giriş yapılır
A002 SELECT InboxHangi klasörde işlem yapılacağı belirtilir
A003 FETCH 1 BODY[TEXT]1 numaralı e-posta mesajının gövdesi çekilir
A004 LOGOUTOturum kapatılır

🖥 Telnet ile IMAP Oturumu Örneği:

bash
telnet 10.10.187.214 143

Varsayılan IMAP portu 143’tür. Aşağıda örnek bir IMAP oturumu gösterilmiştir:

bash
* OK [CAPABILITY IMAP4rev1] IMAP Server ready A001 LOGIN linda Pa$$123 A001 OK LOGIN completed A002 SELECT INBOX * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) * 3 EXISTS * 0 RECENT A002 OK [READ-WRITE] SELECT completed A003 FETCH 3 BODY[TEXT] * 3 FETCH (BODY[TEXT] {150} Merhaba, bu e-posta IMAP üzerinden alındı. ) A003 OK FETCH completed A004 LOGOUT * BYE Logging out A004 OK LOGOUT completed

🔐 Güvenlik:

  • Telnet ile yapılan IMAP oturumları şifrelenmemiştir, dolayısıyla aynı POP3 gibi kullanıcı adı, şifre ve içerik düz metin olarak ağdan izlenebilir.

  • Güvenli IMAP bağlantısı için IMAPS (port 993) kullanılmalıdır.


📬 ENGLISH EXPLANATION (Expanded)

📌 What is IMAP?

IMAP (Internet Message Access Protocol) allows your email client (like Outlook or Thunderbird) to access and manage emails stored on a remote server.

Instead of downloading and deleting the email like POP3, IMAP leaves the message on the server, allowing multiple devices to access and synchronize your mailbox seamlessly.


📦 POP3 vs IMAP Comparison:

FeaturePOP3IMAP
Where are emails stored?Typically downloaded to the clientRemain on the server
Multi-device supportLimitedExcellent (perfect for smartphones + PCs)
Access styleOffline/localOnline with real-time synchronization
Default port110 (995 for SSL)143 (993 for SSL/TLS)

🧠 When to Use IMAP?

  • If you want to access your emails from multiple devices,

  • If you want to keep emails on the server for backup and sync,

  • If you want to organize emails into folders like Inbox, Sent, Drafts,

Then IMAP is the best choice.


🔑 Common IMAP Commands:

IMAP commands usually begin with a tag (e.g., A001, A002) to track which command gets which response.

CommandDescription
A001 LOGIN user passAuthenticates with the server
A002 SELECT InboxSelects the folder to work on
A003 FETCH 1 BODY[TEXT]Fetches the body of message #1
A004 LOGOUTCloses the session gracefully

🖥 Example IMAP Session via Telnet:

bash
telnet 10.10.187.214 143

Once connected:

bash
* OK [CAPABILITY IMAP4rev1] IMAP Server ready A001 LOGIN linda Pa$$123 A001 OK LOGIN completed A002 SELECT INBOX * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) * 3 EXISTS * 0 RECENT A002 OK [READ-WRITE] SELECT completed A003 FETCH 3 BODY[TEXT] * 3 FETCH (BODY[TEXT] {150} Hello, this email was received using IMAP. ) A003 OK FETCH completed A004 LOGOUT * BYE Logging out A004 OK LOGOUT completed

🔐 Security Warning:

Just like POP3, IMAP over Telnet is insecure — everything (username, password, message content) is sent in plain text. Anyone sniffing the network (with Wireshark, for example) can see your credentials and messages.

For secure communication, always use:

  • IMAPS (SSL/TLS) on port 993