Tıpkı web sitelerine göz atmak ya da dosya indirmek gibi, e-posta göndermek de kendi özel protokolünü kullanır. Bu protokolün adı SMTP’dir (Simple Mail Transfer Protocol – Basit Posta Aktarma Protokolü). SMTP, bir e-posta istemcisinin (örneğin Outlook, Thunderbird veya Gmail gibi) bir e-posta sunucusuyla nasıl konuşacağını ve e-posta sunucularının birbiriyle nasıl mesaj alışverişi yapacağını tanımlar.
🏣 Postane Benzetmesi:
SMTP’yi, bir kargoyu yerel bir postaneye götürmeye benzetebiliriz. Görevliye selam verirsiniz (oturum başlatırsınız), paketin gideceği adresi ve gönderen bilgilerini verirsiniz (MAIL FROM & RCPT TO), paketi teslim edersiniz (DATA komutu), sonra işlemi bitirirsiniz. Bazı ülkelerde kimliğinizi göstermeniz gerekebilir, bu da kimlik doğrulama aşamasına benzetilebilir.
📩 SMTP Komutları:
İşte bir e-posta istemcisinin e-posta göndermek için SMTP sunucusuna gönderdiği temel komutlar:
-
HELO veya EHLO: SMTP oturumunu başlatır. (EHLO, HELO'nun gelişmiş sürümüdür, modern sunucular bunu tercih eder.)
-
MAIL FROM: Gönderenin e-posta adresini belirtir.
-
RCPT TO: Alıcının e-posta adresini belirtir.
-
DATA: Artık mesajın içeriğini göndereceğimizi belirtir.
-
. (nokta): Sadece bir nokta olan satır, mesajın bittiğini belirtir.
-
QUIT: Oturumu kapatır.
🖥 Telnet ile SMTP Örneği:
-
25
TCP portu, SMTP’nin varsayılan portudur. -
Sunucu bağlantıyı kabul eder ve bir karşılama mesajı döner.
-
Kullanıcı komutları sırasıyla gönderir: HELO, MAIL FROM, RCPT TO, DATA...
-
Mesaj içeriği yazılır ve tek satırdaki nokta ile sonlandırılır.
-
QUIT ile oturum düzgün bir şekilde kapatılır.
🔍 Wireshark ile İnceleme:
Wireshark gibi bir ağ analiz aracında bu SMTP trafiğini gözlemleyebilirsiniz. İstemcinin (client) mesajları kırmızı, sunucunun (server) yanıtları mavi renkle gösterilir. Burada görebileceğiniz birçok bilgi, istemci tarafından görülemeyen ama arka planda gerçekleşen iletişimdir.
🧠 Ekstra Bilgi:
-
SMTP sadece e-posta göndermek için kullanılır. Almak için değil.
-
E-posta almak için kullanılan protokoller: POP3 (Post Office Protocol) ve IMAP (Internet Message Access Protocol).
-
SMTP kimlik doğrulama olmadan çalışabilir, ama modern sunucular genellikle SMTP AUTH ile şifre ister.
📬 ENGLISH EXPLANATION (Expanded):
Just like browsing the web or downloading files requires its own protocols (like HTTP or FTP), sending an email uses its own specific protocol — called SMTP, or Simple Mail Transfer Protocol. SMTP defines how an email client (like Outlook, Thunderbird, or Gmail) communicates with an email server, and how that server communicates with other mail servers to deliver the message.
🏣 Analogy: Post Office
Think of SMTP like going to the post office to send a package. You greet the staff (start session), provide sender and recipient information (MAIL FROM & RCPT TO), hand over the package (DATA), and indicate that you're done (a single period .
). In some places, you might even need to show ID — just like SMTP authentication in real servers.
📩 SMTP Commands:
Here are some basic commands your email client sends behind the scenes:
-
HELO or EHLO: Starts the session. EHLO is the extended version and is used in modern clients.
-
MAIL FROM: Specifies the sender’s email address.
-
RCPT TO: Specifies the recipient’s email address.
-
DATA: Indicates that the email body is about to be sent.
-
. (dot): A dot on a line by itself ends the message.
-
QUIT: Closes the session.
🖥 Telnet SMTP Example:
-
Port
25
is the default TCP port for SMTP. -
The server returns a greeting.
-
The user types HELO, MAIL FROM, RCPT TO, then DATA, the message body, and ends with a single dot (
.
). -
Finally, the QUIT command closes the session.
🔍 Wireshark Insight:
Using Wireshark, you can inspect the actual packets exchanged between your email client and the SMTP server. Client messages are shown in red, and server responses in blue. Many details like server version, headers, or timestamps are exchanged — but invisible to the end user.
🧠 Bonus Knowledge:
-
SMTP is used only for sending emails.
-
To receive emails, protocols like POP3 and IMAP are used.
-
Modern SMTP often requires authentication via
AUTH LOGIN
orAUTH PLAIN
before sending is allowed. -
Secure versions of SMTP use port 465 (SMTPS) or 587 (STARTTLS) for encrypted communication.