ایمیل (پست الکترونیکی) یکی از قدیمیترین و پرکاربردترین ابزارهای ارتباطی در اینترنت است. درک نحوه عملکرد آن در سطوح پایینتر، از پروتکلها تا سرورها، برای متخصصان شبکه و امنیت اطلاعات ضروری است. این صفحه به بررسی عمیق فرآیندهای پشت پرده ارسال و دریافت ایمیل میپردازد.
سیستم DNS نقش حیاتی در ارسال ایمیل ایفا میکند، به خصوص در یافتن سرورهای مقصد و اعتبارسنجی فرستنده. رکوردهای اصلی DNS مرتبط با ایمیل عبارتند از:
mail.example.com. IN A 192.0.2.1mail.example.com. IN AAAA 2001:0db8::1example.com. IN MX 10 mail.example.com.
example.com. IN MX 20 backupmail.example.com.example.com. IN TXT "v=spf1 include:_spf.google.com ~all"
selector._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD..."
_dmarc.example.com. IN TXT "v=DMARC1; p=quarantine; fo=1; ruf=mailto:dmarc_rua@example.com"1.2.0.192.in-addr.arpa. IN PTR mail.example.com.مراحل ارسال یک ایمیل از دیدگاه فنی به شرح زیر است:
smtp.example.com) متصل میشود. در این مرحله، احراز هویت کاربر انجام میشود (نام کاربری و رمز عبور). ارتباط در این مرحله با استفاده از SSL/TLS (نسخههای فعلی TLS 1.2 یا TLS 1.3) رمزنگاری میشود تا از محرمانگی و یکپارچگی دادهها اطمینان حاصل شود. این رمزنگاری شامل فرآیندهای Encryption (رمزگذاری دادهها قبل از ارسال) و Decryption (رمزگشایی دادهها پس از دریافت) است.Sample SMTP Conversation (Simplified):
Client: HELO myclient.com
Server: 250 smtp.example.com Hello myclient.com
Client: AUTH LOGIN
Server: 334 VXNlcm5hbWU6 (Base64 encoded "Username:")
Client: [Base64 Encoded Username]
Server: 334 UGFzc3dvcmQ6 (Base64 encoded "Password:")
Client: [Base64 Encoded Password]
Server: 235 2.1.0 Authentication successful
Client: MAIL FROM:<sender@example.com>
Server: 250 2.1.0 Ok
Client: RCPT TO:<receiver@destination.com>
Server: 250 2.1.5 Ok
Client: DATA
Server: 354 End data with <CR><LF>.<CR><LF>
Client: Subject: Test Email
From: sender@example.com
To: receiver@destination.com
This is a test email.
.
Server: 250 2.0.0 Ok: queued as [Message ID]
Client: QUIT
Server: 221 2.0.0 Bye
receiver@destination.com) را بررسی میکند تا دامنه (destination.com) را استخراج کند.destination.com اجرا میکند تا آدرس IP سرور MTA مربوط به دامنه گیرنده را پیدا کند.Example DNS MX record lookup (using dig or nslookup):
$ dig MX destination.com
Output (simplified):
destination.com. 3600 IN MX 10 mail.destination.com.
Then, an A record query is performed for mail.destination.com to find its IP address:
$ dig A mail.destination.com
Output (simplified):
mail.destination.com. 3600 IN A 203.0.113.45
receiver@destination.com) قرار میدهد.مراحل دریافت یک ایمیل از دیدگاه فنی به شرح زیر است:
pop.destination.com یا imap.destination.com) متصل میشود. احراز هویت کاربر در این مرحله انجام میشود. ارتباط در این پورتها با استفاده از SSL/TLS (نسخههای فعلی TLS 1.2 یا TLS 1.3) رمزنگاری میشود و شامل فرآیندهای Encryption (برای دادههای ارسالی از کلاینت) و Decryption (برای دادههای دریافتی از سرور) است.Sample POP3 Conversation (Simplified):
Client: USER receiver@destination.com
Server: +OK
Client: PASS [Password]
Server: +OK logged in.
Client: STAT
Server: +OK 2 320 (2 messages, 320 octets total)
Client: RETR 1
Server: +OK 120 octets
Subject: Test Email
From: sender@example.com
To: receiver@destination.com
This is a test email.
.
Client: DELE 1
Server: +OK marked for deletion
Client: QUIT
Server: +OK POP3 server signing off
Sample IMAP Conversation (Simplified):
Client: 1 LOGIN receiver@destination.com [Password]
Server: 1 OK LOGIN completed
Client: 2 SELECT INBOX
Server: * OK [READ-WRITE] INBOX selected. (Success)
Client: 3 FETCH 1 (BODY[HEADER.FIELDS (FROM SUBJECT)])
Server: * 1 FETCH (BODY[HEADER.FIELDS (FROM SUBJECT)] {56}
FROM: sender@example.com
SUBJECT: Test Email
)
Client: 4 LOGOUT
Server: * BYE IMAP4rev1 Server logging out
Server: 4 OK LOGOUT completed