SMTP - Simple Mail Transfer Protocol

What is SMTP?

SMTP stands for Simple Mail Transfer Protocol. It is a standard communication protocol used to send emails from one server to another over the internet.

Why is SMTP useful?

  • It enables email delivery between different email servers (e.g., from Gmail to Outlook).

  • Supports authentication and encryption to secure email transmission.

  • Works with other protocols like IMAP and POP3 to complete the email lifecycle (sending + receiving).

  • Widely supported by all major email clients and services.

How it works?

  • User sends an email using an email client (like Outlook or Gmail).

  • The email client connects to the SMTP server and sends the message.

  • The SMTP server processes the message and determines the recipient’s domain.

  • It forwards the email to the recipient’s mail server (using DNS to find it).

  • The recipient’s server stores the email, ready to be fetched by the user via IMAP or POP3.

Where is SMTP used?

  • Email clients (e.g., Outlook, Thunderbird, Apple Mail).

  • Mail servers (e.g., Microsoft Exchange, Postfix, Sendmail).

  • Webmail services (e.g., Gmail, Yahoo Mail, Zoho).

Why OSI Layer: Application Layer (Layer 7)?

  • It defines email commands (HELO, MAIL FROM, RCPT TO, DATA, etc.).

  • It interacts with user-facing applications (e.g., Outlook, Gmail).

  • It handles message formatting and transfer logic, not data transport or routing.

What are the key features?

  • Outbound Email Protocol.

  • Text-Based Protocol.

  • Supports Authentication (SMTP AUTH).

  • Port Flexibility.

What is an SMTP server?

A server that: * Accepts outgoing email. * Relays email to destination servers. * Examples: Sendmail, Postfix, Exim, Microsoft Exchange, Gmail SMTP.

What is a mail relay in SMTP?

A mail relay is when an SMTP server forwards email from one domain/server to another. Used in: * Email routing between domains. * Sending mail from client to provider’s SMTP.

Can SMTP be used over IPv6?

Yes. SMTP works over both IPv4 and IPv6 as long as the DNS records and mail servers support it.

What are some applications that use SMTP?

  • Email Clients.

  • Webmail Services.

  • Web Applications & Contact Forms.

  • Command-Line Tools & Scripts.

What is the working flow of SMTP?

User Composes Email * You write an email in a mail client (e.g., Outlook, Gmail, Thunderbird). * Click “Send”.

Mail Client Connects to SMTP Server * The client connects to the SMTP server on port: * 587 (with STARTTLS encryption – most common). * 465 (SSL/TLS). * 25 (for server-to-server).

Client Authenticates * The mail client logs in using: * Username and password. * Uses AUTH LOGIN or AUTH PLAIN commands.

Email Envelope is Sent * The client sends: * MAIL FROM: – sender’s email address. * RCPT TO: – recipient’s email address.

Message Content is Sent * The client sends: * DATA command. * Followed by the email body, subject, headers, and attachments (in MIME format). * Ends with a single dot . on a new line to finish the message.

Email is Queued or Relayed * The SMTP server either: * Delivers the email locally, or * Looks up recipient’s domain via DNS (MX record) and relays the message to the recipient’s mail server.

Recipient Server Accepts the Mail * The recipient mail server stores the email in the user’s inbox. * The recipient will later fetch it using POP3 or IMAP.

Client Sends QUIT * The SMTP session ends with the QUIT command. * The server closes the connection.

What are common SMTP server software options?

  • Postfix - Linux.

  • Sendmail - Linux/Unix.

  • Exim - Linux.

  • MailEnable - Windows.

  • hMailServer - Windows.

  • In this section, you are going to learn

  • Terminology

  • Version Info

S.No

Version

RFC

Year

contribution/core ideas

1

SMTP

RFC 821

1982

Original SMTP protocol for email transmission.

2

ESMTP

RFC 1869

1995

Introduced command extensions and capabilities.

3

SMTP Updated

RFC 5321

2008

Modern SMTP standard replacing RFC 2821.

4

SMTP with Enhanced Status Codes

RFC 3463

2003

Defines enhanced status codes for better diagnostics.

5

SMTP Service Extensions

RFC 4954

2007

Adds authentication (SMTP AUTH).

6

SMTP over TLS

RFC 3207

2002

Defines STARTTLS for secure SMTP communication.

  • setup

  • setup

SMTP COMMAND LINE Packet

S.No

Packet Components

Description

Size(Bytes)

1

Command Line

Text-based command sent by client to server

Variable (typically < 512)

(e.g., HELO, MAIL FROM, RCPT TO).

Command Keyword

SMTP command like HELO, DATA, QUIT, etc.

Variable (typically < 10)

Arguments

Parameters like domain name, email address, etc.

Variable

CRLF

Carriage Return + Line Feed to terminate the command

2

SMTP RESPONSE LINE Packet

2

Response Line

Server reply to client (e.g., 250 OK, 354 Start mail input)

Variable (typically < 512)

Status Code

3-digit numeric code indicating result (e.g., 220, 250,)

3

Message Text

Human-readable explanation of the status

Variable

CRLF

Terminates the response line

2

SMTP MESSAGE HEADER Packet

3

Message Header

Email metadata (e.g., From, To, Subject, Date)

Variable

Header Fields

Each field contains a key-value pair

Variable

CRLF

Separates each header line

2 per line

SMTP MESSAGE BODY Packet

4

Message Body

Actual content of the email message

Variable

Body Content

Plain text or HTML content

Variable

CRLF

Line breaks within the message

2 per line

SMTP END Of Data Marker Packet

S.No

Packet Components

Description

Size(Bytes)

5

End of Data Marker

A single period (.) on a line to indicate end of message data

3 (CRLF.)

S.No

Use Case

Description

1

Sending Emails

SMTP is the standard protocol for sending emails from clients to servers.

2

Server-to-Server Email Transfer

Used to relay emails between different mail servers across the internet.

3

Automated Notifications

Applications use SMTP to send alerts, reminders, and system notifications.

4

Email Marketing Campaigns

Bulk email tools use SMTP to deliver newsletters and promotional emails.

5

Contact Forms on Websites

Websites use SMTP to send form submissions to site administrators

6

Password Recovery Emails

SMTP is used to send password reset or account recovery links.

7

Two-Factor Authentication (2FA)

Sends verification codes or login alerts to users via email.

8

Application-to-User Messaging

Apps use SMTP to send transactional emails like receipts etc.

S.No

STMP features

Description

1

Text-Based Protocol

SMTP uses simple ASCII text commands for communication between

servers.

2

Client-Server Architecture

Operates on a request-response model between email clients and

servers.

3

Store-and-Forward Mechanism

Emails are queued and forwarded until successfully delivered.

4

Port-Based Communication

Commonly uses ports 25, 587, or 465 for sending emails.

5

Command Set

Includes commands like HELO, MAIL FROM, RCPT TO, DATA, QUIT, etc.

6

Encryption Support

Works with TLS/SSL to secure email transmission.

7

Interoperability

Compatible with all major email systems and protocols (IMAP, POP3).

8

Support for Authentication

Can use login credentials to verify sender identity (via SMTP AUTH).

9

Header and Body Separation

Clearly separates email metadata from the message content (body).

10

Reliable Delivery

Ensures messages are delivered or errors are reported back to the sender.

Text Based Protocol - Testcases

S.No

Test Case

Description

Expected Result

1

Connect to SMTP Server

Attempt to connect to the SMTP server

Connection established

2

Invalid Server Address

Use incorrect server address

Connection fails

3

Valid HELO Command

Send valid HELO command

Server responds with 250 OK

4

Invalid HELO Syntax

Send malformed HELO command

Server responds with 500 Syntax error

5

Valid EHLO Command

Send valid EHLO command

Server responds with capabilities

6

MAIL FROM Valid

Send valid MAIL FROM command

Server responds with 250 OK

7

MAIL FROM Invalid

Send MAIL FROM with invalid syntax

Server responds with 501 Syntax error

8

RCPT TO Valid

Send valid RCPT TO command

Server responds with 250 OK

9

RCPT TO Invalid

Send RCPT TO with invalid address

Server responds with 550 No such user

10

DATA Command Valid

Send DATA command after RCPT TO

Server responds with 354 Start mail input

11

DATA Command Without RCPT

Send DATA without RCPT TO

Server responds with 503 Bad sequence

12

Message Body Format

Send properly formatted message body

Server accepts message

13

Message Body Without End

Send message body without terminating with “.”

Server waits for termination

14

QUIT Command

Send QUIT command

Server responds with 221 Bye

15

AUTH LOGIN Valid

Authenticate with valid credentials

Server responds with 235 Authentication successful

16

AUTH LOGIN Invalid

Authenticate with invalid credentials

Server responds with 535 Authentication failed

17

AUTH PLAIN Valid

Use AUTH PLAIN with valid credentials

Server responds with 235 OK

18

AUTH PLAIN Invalid

Use AUTH PLAIN with invalid credentials

Server responds with 535 Error

19

STARTTLS Support

Check if server supports STARTTLS

Server lists STARTTLS in EHLO

20

STARTTLS Initiation

Initiate STARTTLS

Server responds with 220 Ready to start TLS

21

STARTTLS Without Support

Send STARTTLS to server without support

Server responds with 502 Command not implemented

22

Multiple RCPT TO

Send multiple RCPT TO commands

Server accepts all valid recipients

23

MAIL FROM After RCPT TO

Send MAIL FROM after RCPT TO

Server responds with 503 Bad sequence

24

Invalid Command

Send unknown command

Server responds with 500 Unrecognized command

25

Long Email Body

Send large email body

Server accepts and processes

26

Empty MAIL FROM

Send MAIL FROM with empty address

Server responds with 501 Syntax error

27

Empty RCPT TO

Send RCPT TO with empty address

Server responds with 501 Syntax error

28

Multiple MAIL FROM

Send multiple MAIL FROM commands

Server responds with 503 Bad sequence

29

Pipelining Support

Check if server supports pipelining

Server lists PIPELINING in EHLO

30

Send Email with Attachment

Simulate sending email with attachment

Server accepts MIME format

31

Invalid MIME Format

Send email with malformed MIME

Server responds with 554 Transaction failed

32

Timeout on Connection

Wait without sending data

Server closes connection

33

Reconnect After QUIT

Connect again after QUIT

Server allows new session

34

Multiple Emails in One Session

Send multiple emails in one session

Server processes all correctly

35

Invalid Email Address Format

Use invalid email format

Server responds with 501 Syntax error

36

Server Banner Check

Check server banner on connection

Server sends 220 greeting

37

VRFY Valid User

Use VRFY with valid user

Server responds with 250 User exists

38

VRFY Invalid User

Use VRFY with invalid user

Server responds with 550 No such user

39

EXPN Valid List

Use EXPN with valid mailing list

Server expands list

40

EXPN Disabled

Use EXPN when disabled

Server responds with 502 Command not implemented

41

HELP Command

Send HELP command

Server responds with help text

42

NOOP Command

Send NOOP command

Server responds with 250 OK

43

RSET Command

Send RSET to reset session

Server responds with 250 OK

44

MAIL FROM with Parameters

Use MAIL FROM with SIZE parameter

Server accepts if within limits

45

RCPT TO with Parameters

Use RCPT TO with NOTIFY parameter

Server accepts if supported

46

Message Size Limit

Send message exceeding size limit

Server responds with 552 Message too large

47

SMTP over SSL

Connect using SMTPS (port 465)

Connection secured

48

SMTP Port Check

Connect to port 25

Server responds if open

49

SMTP Relay Test

Attempt to relay without auth

Server responds with 554 Relay denied

50

Session Termination

Close session abruptly

Server logs disconnect

Client Server Architecture - Testcases

S.No

Test Case

Description

Expected Result

1

Server Initialization

Start the server process

Server starts and listens on specified port

2

Client Connection

Client attempts to connect to server

Connection established

3

Invalid Server Address

Client uses wrong server IP/hostname

Connection fails

4

Port Availability

Check if server port is open

Port is accessible

5

Multiple Clients

Connect multiple clients simultaneously

Server handles all connections

6

Data Transmission

Client sends data to server

Server receives and processes data

7

Server Response

Server sends response to client

Client receives correct response

8

Timeout Handling

Client waits without sending data

Server disconnects after timeout

9

Server Crash Recovery

Simulate server crash and restart

Server recovers and resumes service

10

Unauthorized Access

Client tries to access restricted resource

Server denies access

11

Authentication Required

Client connects to protected service

Server requests authentication

12

Valid Authentication

Client provides correct credentials

Server grants access

13

Invalid Authentication

Client provides wrong credentials

Server denies access

14

Data Integrity

Send and verify data consistency

Data received matches sent data

15

Encryption Support

Enable encrypted communication

Data is transmitted securely

16

Protocol Compliance

Use correct protocol (e.g., HTTP, FTP)

Server responds appropriately

17

Protocol Violation

Use incorrect protocol format

Server returns error

18

Server Load Test

Simulate high number of client requests

Server remains stable

19

Client Disconnection

Client disconnects gracefully

Server logs disconnect

20

Abrupt Client Disconnect

Client disconnects unexpectedly

Server handles without crash

21

Server Logging

Check server logs for activity

Logs contain accurate entries

22

Client Logging

Check client logs for communication

Logs reflect correct data exchange

23

Firewall Blocking

Block server port via firewall

Client cannot connect

24

DNS Resolution

Use domain name instead of IP

Server resolves correctly

25

IP Whitelisting

Allow only specific IPs

Unauthorized IPs are blocked

26

Session Management

Maintain session state

Session persists across requests

27

Stateless Communication

Use stateless protocol

Each request is independent

28

Resource Access

Client requests server resource

Server provides correct resource

29

Invalid Resource Request

Request non-existent resource

Server returns 404 or error

30

Server Shutdown

Gracefully shut down server

All connections closed properly

31

Server Restart

Restart server after shutdown

Server resumes service

32

Client Retry Logic

Retry on failed connection

Client reconnects successfully

33

Server Overload

Exceed server capacity

Server returns 503 or throttles

34

Load Balancing

Distribute requests across servers

Requests handled efficiently

35

Caching Mechanism

Use server-side caching

Cached data returned

36

Session Timeout

Inactive session expires

Server terminates session

37

Concurrent Data Access

Multiple clients access same data

Server handles concurrency

38

Data Update Propagation

Update data on server

Clients receive updated data

39

Version Compatibility

Client and server versions match

Communication succeeds

40

Version Mismatch

Client uses outdated version

Server returns compatibility error

41

API Rate Limiting

Exceed API call limits

Server returns rate limit error

42

Secure Login

Use HTTPS for login

Credentials transmitted securely

43

Server Configuration Change

Modify server settings

Server applies changes correctly

44

Client Configuration Change

Modify client settings

Client connects successfully

45

Network Latency

Simulate high latency

Server handles delays gracefully

46

Packet Loss

Simulate packet loss

Server retries or reports error

47

Server Monitoring

Monitor server health

Metrics are reported accurately

48

Client Monitoring

Monitor client activity

Logs and metrics are available

49

Error Handling

Trigger server error

Server returns appropriate error code

50

Graceful Degradation

Server under partial failure

Core services remain available

Store And forward Mechanism - Testcases

S.No

Test Case

Description

Expected Result

1

Queue Message

Send email when recipient server is down

Message is queued for retry

2

Retry Delivery

Retry sending queued message

Server retries after delay

3

Retry Interval

Check retry interval configuration

Server waits configured time before retry

4

Max Retry Limit

Exceed maximum retry attempts

Message is bounced

5

Queue Expiry

Message exceeds queue lifetime

Server returns delivery failure

6

Temporary Failure

Simulate temporary DNS failure

Message is queued

7

Permanent Failure

Simulate invalid recipient domain

Message is rejected immediately

8

Queue Monitoring

Monitor queued messages

Messages are visible in queue logs

9

Queue Size Limit

Exceed queue size

Server rejects new messages

10

Queue Prioritization

Prioritize urgent messages

High-priority messages sent first

11

Message Persistence

Server restarts during queue

Messages remain in queue

12

Queue Backup

Backup queued messages

Backup file created

13

Queue Restore

Restore from backup

Messages re-queued successfully

14

Message Format Integrity

Check message format in queue

Format remains unchanged

15

Queue Encryption

Encrypt queued messages

Messages stored securely

16

Queue Access Control

Restrict access to queue

Unauthorized access denied

17

Queue Logging

Log queue operations

Logs contain enqueue/dequeue events

18

Queue Flushing

Manually flush queue

Messages sent immediately

19

Queue Inspection

Inspect message headers

Headers are intact

20

Queue Delay Simulation

Simulate network delay

Message remains queued

21

Queue Message Count

Count messages in queue

Accurate count returned

22

Queue Message Size

Check size of queued message

Size matches original

23

Queue Message Order

Verify FIFO order

Messages dequeued in order

24

Queue Message Deletion

Delete specific message

Message removed from queue

25

Queue Message Resend

Resend queued message manually

Message sent successfully

26

Queue Overflow Handling

Simulate overflow

Server rejects new messages

27

Queue Alerting

Alert on queue threshold

Notification triggered

28

Queue Status API

Query queue status via API

API returns current state

29

Queue Message Duplication

Prevent duplicate messages

No duplicates in queue

30

Queue Message Compression

Compress queued messages

Storage optimized

31

Queue Message Routing

Route based on domain

Correct route selected

32

Queue Message TTL

Set time-to-live for messages

Message expires correctly

33

Queue Message Retry Count

Track retry attempts

Count is accurate

34

Queue Message Bounce

Bounce after max retries

Bounce message sent to sender

35

Queue Message Notification

Notify sender on delay

Notification sent

36

Queue Message Tracking

Track delivery status

Status updated correctly

37

Queue Message Filtering

Filter spam in queue

Spam removed or flagged

38

Queue Message Archiving

Archive old messages

Messages stored separately

39

Queue Message Forwarding

Forward queued message

Message sent to alternate address

40

Queue Message Validation

Validate message before enqueue

Invalid messages rejected

41

Queue Message Retry Policy

Apply retry policy

Policy executed correctly

42

Queue Message Retry Backoff

Use exponential backoff

Retry intervals increase

43

Queue Message Retry Logging

Log each retry attempt

Logs show retry history

44

Queue Message Retry Notification

Notify on each retry

Notification sent to admin

45

Queue Message Retry Override

Override retry settings

New settings applied

46

Queue Message Retry Success

Retry succeeds

Message delivered

47

Queue Message Retry Failure

Retry fails

Message bounced

48

Queue Message Retry Cancel

Cancel retry manually

Message removed from queue

49

Queue Message Retry Resume

Resume paused retry

Retry continues

50

Queue Message Retry Audit

Audit retry history

Complete audit trail available

Port Based Communication - Testcases

S.No

Test Case

Description

Expected Result

1

Default Port Connection

Connect to SMTP on port 25

Connection established

2

SMTPS Port Connection

Connect to SMTP on port 465

Secure connection established

3

Submission Port Connection

Connect to SMTP on port 587

Authenticated connection established

4

Invalid Port Number

Connect using an invalid port

Connection fails

5

Port Blocked by Firewall

Attempt connection with blocked port

Connection refused

6

Port Open Check

Verify if SMTP port is open

Port responds to connection

7

Port Scan Detection

Scan SMTP ports

Server logs scan attempt

8

Port Timeout

Connect to port with no response

Connection times out

9

Port Redirection

Redirect SMTP traffic to another port

Redirection successful

10

Port-Based Access Control

Restrict access to specific ports

Unauthorized access denied

11

Port Logging

Log all port-based connections

Logs contain accurate entries

12

Port Multiplexing

Handle multiple services on same port

Services respond correctly

13

Port Binding Conflict

Bind two services to same port

Error or conflict detected

14

Port-Based Load Balancing

Distribute traffic across ports

Load balanced successfully

15

Port-Based Protocol Detection

Detect protocol based on port

Correct protocol identified

16

Port-Based Encryption

Use encryption on specific port

Data transmitted securely

17

Port-Based Authentication

Require auth on specific port

Authentication enforced

18

Port-Based Rate Limiting

Limit requests per port

Excess requests blocked

19

Port-Based Monitoring

Monitor traffic on SMTP ports

Metrics collected accurately

20

Port-Based Alerting

Trigger alerts on port activity

Alerts sent on threshold breach

21

Port-Based Throttling

Throttle traffic on busy port

Traffic slowed appropriately

22

Port-Based Session Handling

Manage sessions per port

Sessions tracked correctly

23

Port-Based Protocol Switching

Switch protocols based on port

Correct protocol used

24

Port-Based NAT Traversal

Handle NAT for SMTP ports

Communication succeeds

25

Port-Based QoS

Apply Quality of Service rules

Priority traffic handled first

26

Port-Based Firewall Rules

Apply rules per port

Rules enforced correctly

27

Port-Based IDS/IPS

Detect intrusions on SMTP ports

Threats identified and blocked

28

Port-Based Logging Format

Verify log format for port activity

Logs are structured correctly

29

Port-Based Connection Retry

Retry failed port connection

Connection reattempted

30

Port-Based Connection Drop

Drop connection on specific port

Connection terminated

31

Port-Based Connection Persistence

Maintain persistent connection

Connection remains active

32

Port-Based Connection Termination

Terminate connection gracefully

Server sends termination response

33

Port-Based Connection Reuse

Reuse existing connection

Connection reused successfully

34

Port-Based Connection Pooling

Pool connections per port

Pool managed efficiently

35

Port-Based Connection Isolation

Isolate traffic per port

No cross-port interference

36

Port-Based Connection Encryption

Encrypt traffic per port

Data secured

37

Port-Based Connection Compression

Compress traffic per port

Data size reduced

38

Port-Based Connection Validation

Validate connection parameters

Parameters accepted

39

Port-Based Connection Filtering

Filter traffic per port

Unwanted traffic blocked

40

Port-Based Connection Statistics

Collect stats per port

Accurate metrics reported

41

Port-Based Connection Debugging

Debug issues per port

Logs and traces available

42

Port-Based Connection Testing

Test connection health

Connection verified

43

Port-Based Connection Failover

Switch to backup port

Failover successful

44

Port-Based Connection Recovery

Recover from port failure

Connection restored

45

Port-Based Connection Audit

Audit port usage

Detailed report generated

46

Port-Based Connection Security

Apply security policies

Policies enforced

47

Port-Based Connection Optimization

Optimize traffic per port

Performance improved

48

Port-Based Connection Configuration

Configure port settings

Settings applied correctly

49

Port-Based Connection Synchronization

Sync data across ports

Data synchronized

50

Port-Based Connection Verification

Verify connection integrity

Connection verified successfully

Command Set Feature - Testcases

S.No

Test Case

Description

Expected Result

1

HELO Command

Send valid HELO command

Server responds with 250 OK

2

EHLO Command

Send valid EHLO command

Server responds with capabilities

3

MAIL FROM Command

Send valid MAIL FROM command

Server responds with 250 OK

4

RCPT TO Command

Send valid RCPT TO command

Server responds with 250 OK

5

DATA Command

Send DATA command after RCPT TO

Server responds with 354 Start mail input

6

QUIT Command

Send QUIT command

Server responds with 221 Bye

7

RSET Command

Send RSET to reset session

Server responds with 250 OK

8

NOOP Command

Send NOOP command

Server responds with 250 OK

9

VRFY Command

Verify a valid user

Server responds with 250 User exists

10

EXPN Command

Expand a mailing list

Server responds with list or 502 if disabled

11

HELP Command

Request help information

Server responds with help text

12

AUTH LOGIN

Authenticate using LOGIN method

Server responds with 235 OK

13

AUTH PLAIN

Authenticate using PLAIN method

Server responds with 235 OK

14

AUTH CRAM-MD5

Authenticate using CRAM-MD5

Server responds with 235 OK

15

STARTTLS Command

Initiate TLS encryption

Server responds with 220 Ready to start TLS

16

Invalid HELO Syntax

Send malformed HELO

Server responds with 500 Syntax error

17

Invalid MAIL FROM

Send MAIL FROM with bad format

Server responds with 501 Syntax error

18

Invalid RCPT TO

Send RCPT TO with bad format

Server responds with 501 Syntax error

19

DATA Without RCPT TO

Send DATA before RCPT TO

Server responds with 503 Bad sequence

20

Multiple RCPT TO

Send multiple RCPT TO commands

Server accepts all valid recipients

21

MAIL FROM After RCPT TO

Send MAIL FROM after RCPT TO

Server responds with 503 Bad sequence

22

Unknown Command

Send an undefined command

Server responds with 500 Unrecognized command

23

AUTH Without EHLO

Send AUTH before EHLO

Server responds with 503 Bad sequence

24

STARTTLS Without EHLO

Send STARTTLS before EHLO

Server responds with 503 Bad sequence

25

AUTH With Invalid Credentials

Send wrong credentials

Server responds with 535 Authentication failed

26

AUTH With Valid Credentials

Send correct credentials

Server responds with 235 Authentication successful

27

STARTTLS Repeated

Send STARTTLS twice

Server responds with 503 Already encrypted

28

DATA With No End

Send DATA without terminating with “.”

Server waits for termination

29

DATA With Invalid Format

Send malformed message body

Server responds with 554 Transaction failed

30

VRFY Disabled

Use VRFY when disabled

Server responds with 502 Command not implemented

31

EXPN Disabled

Use EXPN when disabled

Server responds with 502 Command not implemented

32

HELP With Argument

Send HELP with specific command

Server responds with command help

33

NOOP Multiple Times

Send NOOP repeatedly

Server responds with 250 OK each time

34

RSET After DATA

Send RSET after DATA command

Server resets session

35

MAIL FROM With Parameters

Use MAIL FROM with SIZE param

Server accepts if within limits

36

RCPT TO With Parameters

Use RCPT TO with NOTIFY param

Server accepts if supported

37

AUTH With Empty Credentials

Send empty credentials

Server responds with 535 Authentication failed

38

AUTH With Base64 Encoding

Send credentials in Base64

Server decodes and authenticates

39

AUTH With Incorrect Encoding

Send malformed Base64

Server responds with 501 Syntax error

40

STARTTLS With Invalid Certificate

Use invalid TLS cert

Connection fails

41

STARTTLS With Valid Certificate

Use valid TLS cert

Connection secured

42

EHLO With Domain

Send EHLO with domain name

Server responds with 250 and capabilities

43

EHLO With IP Address

Send EHLO with IP

Server responds with 250 OK

44

MAIL FROM With Empty Address

Send MAIL FROM:<>

Server accepts as bounce

45

RCPT TO With Empty Address

Send RCPT TO:<>

Server responds with 501 Syntax error

46

DATA With MIME Format

Send MIME formatted message

Server accepts message

47

DATA With HTML Content

Send HTML email body

Server accepts message

48

QUIT After AUTH

Send QUIT after authentication

Server ends session

49

QUIT Without AUTH

Send QUIT without authentication

Server ends session

50

AUTH With Multiple Methods

Try multiple AUTH methods

Server selects supported method

Encryption Support - Testcases

S.No

Test Case

Description

Expected Result

1

STARTTLS Command

Send STARTTLS command

Server responds with 220 Ready to start TLS

2

STARTTLS Support Check

Check if server supports STARTTLS

Listed in EHLO response

3

TLS Handshake Success

Complete TLS handshake

Secure connection established

4

TLS Handshake Failure

Simulate handshake failure

Connection terminated

5

SSL Port Connection

Connect to SMTPS on port 465

Encrypted connection established

6

STARTTLS Without EHLO

Send STARTTLS before EHLO

Server responds with 503 Bad sequence

7

STARTTLS Repeated

Send STARTTLS twice

Server responds with 503 Already encrypted

8

STARTTLS With Invalid Certificate

Use invalid TLS certificate

Connection fails

9

STARTTLS With Valid Certificate

Use valid TLS certificate

Connection secured

10

Encrypted MAIL FROM

Send MAIL FROM over TLS

Server accepts securely

11

Encrypted RCPT TO

Send RCPT TO over TLS

Server accepts securely

12

Encrypted DATA

Send email body over TLS

Server accepts securely

13

Encrypted AUTH LOGIN

Authenticate over TLS

Credentials transmitted securely

14

Encrypted AUTH PLAIN

Use AUTH PLAIN over TLS

Credentials transmitted securely

15

Encrypted AUTH CRAM-MD5

Use CRAM-MD5 over TLS

Authentication succeeds

16

TLS Version Support

Check supported TLS versions

Server lists supported versions

17

TLSv1.2 Connection

Connect using TLSv1.2

Connection succeeds

18

TLSv1.3 Connection

Connect using TLSv1.3

Connection succeeds

19

SSLv3 Connection Attempt

Attempt SSLv3 connection

Server rejects insecure protocol

20

Cipher Suite Negotiation

Negotiate cipher suite

Strong cipher selected

21

Weak Cipher Rejection

Attempt connection with weak cipher

Server rejects connection

22

Certificate Expiry Check

Use expired certificate

Connection fails

23

Certificate Validity Check

Use valid certificate

Connection succeeds

24

Certificate Revocation Check

Use revoked certificate

Connection fails

25

Certificate Chain Validation

Validate full chain

Server accepts if valid

26

Self-Signed Certificate

Use self-signed cert

Connection may be rejected

27

CA-Signed Certificate

Use CA-signed cert

Connection accepted

28

Encrypted Session Persistence

Maintain encrypted session

Session remains secure

29

Encrypted Session Termination

Terminate encrypted session

Server closes securely

30

Encrypted Session Reuse

Reuse TLS session

Server supports reuse

31

TLS Downgrade Attack Prevention

Attempt downgrade

Server prevents downgrade

32

TLS Renegotiation

Attempt renegotiation

Server handles securely

33

TLS Alert Handling

Trigger TLS alert

Server responds appropriately

34

TLS Logging

Log TLS session details

Logs contain handshake info

35

TLS Metrics Collection

Collect encryption metrics

Metrics reported accurately

36

TLS Error Reporting

Report TLS errors

Server logs and returns error

37

TLS Performance Test

Measure encrypted session speed

Acceptable performance

38

TLS Compatibility Test

Test across clients

All supported clients connect securely

39

TLS Certificate Rotation

Rotate server certificate

New cert accepted

40

TLS Certificate Pinning

Use pinned certificate

Connection succeeds only with match

41

TLS Session Timeout

Let session expire

Server terminates session

42

TLS Session Resume

Resume session after timeout

Server resumes securely

43

TLS Session Cache

Cache session info

Server uses cache correctly

44

TLS Session ID Check

Verify session ID

ID matches expected value

45

TLS Session Ticket Check

Verify session ticket

Ticket used correctly

46

TLS Client Certificate

Use client cert for auth

Server validates certificate

47

TLS Mutual Authentication

Require client and server certs

Mutual auth succeeds

48

TLS Certificate Fingerprint

Verify fingerprint

Matches expected value

49

TLS Certificate Subject Check

Check subject fields

Fields match expected values

50

TLS Certificate SAN Check

Check Subject Alternative Name

SAN includes correct domains

interoperability - Testcases

S.No

Test Case

Description

Expected Result

1

SMTP Client Compatibility

Test with different SMTP clients

All clients connect successfully

2

SMTP Server Compatibility

Test with different SMTP servers

Communication succeeds

3

Cross-Platform Support

Test on Windows, Linux, macOS

SMTP works consistently

4

Email Format Compatibility

Send plain text and HTML emails

All formats delivered correctly

5

MIME Type Handling

Send emails with various MIME types

MIME types processed correctly

6

Attachment Compatibility

Send attachments from different clients

Attachments received intact

7

Character Encoding Support

Send emails with UTF-8, ASCII, etc.

Encoding preserved

8

Language Support

Send emails in multiple languages

Content displayed correctly

9

TLS Version Compatibility

Test TLS 1.2, 1.3

Secure connection established

10

Cipher Suite Compatibility

Use various cipher suites

Negotiation succeeds

11

Authentication Method Compatibility

Test LOGIN, PLAIN, CRAM-MD5

All supported methods work

12

IPv4 and IPv6 Support

Connect using both IP versions

Connection succeeds

13

DNS Resolution

Resolve domain names across platforms

Resolution successful

14

SMTP Relay Compatibility

Relay through different servers

Message forwarded correctly

15

Port Compatibility

Use ports 25, 465, 587

All ports function correctly

16

Email Client Rendering

Check rendering in Outlook, Gmail, etc.

Email displays correctly

17

Header Field Compatibility

Use standard headers

Headers interpreted correctly

18

Custom Header Support

Use custom headers

Headers preserved

19

BCC and CC Compatibility

Send with BCC and CC

Recipients handled correctly

20

Time Zone Handling

Send emails across time zones

Timestamps accurate

21

Date Format Compatibility

Use different date formats

Server parses correctly

22

HTML Email Rendering

Send HTML content

Rendered properly in clients

23

Inline Image Support

Send inline images

Displayed correctly

24

Email Threading

Maintain conversation threads

Threading preserved

25

Delivery Status Notification

Request DSN

Notification received

26

Read Receipt Compatibility

Request read receipt

Receipt received if supported

27

SMTP Extension Support

Use supported extensions

Server responds correctly

28

STARTTLS Compatibility

Use STARTTLS across clients

Secure connection established

29

Email Forwarding

Forward email across domains

Message forwarded correctly

30

Email Filtering

Apply filters on received emails

Filters work correctly

31

Spam Detection Compatibility

Test spam filters

Spam flagged appropriately

32

DKIM Signature Verification

Verify DKIM signature

Signature validated

33

SPF Record Check

Validate SPF records

SPF check passes

34

DMARC Policy Enforcement

Apply DMARC policy

Policy enforced correctly

35

SMTP over VPN

Send email via VPN

Message delivered securely

36

SMTP over Proxy

Send email via proxy

Message delivered correctly

37

SMTP over Mobile Network

Send email via mobile data

Message delivered successfully

38

SMTP over Satellite

Send email via satellite link

Message delivered with delay

39

SMTP over Cloud Services

Use cloud SMTP services

Message delivered correctly

40

SMTP API Integration

Use SMTP via API

API sends email successfully

41

SMTP with Webmail

Send email via webmail

Message delivered correctly

42

SMTP with Desktop Client

Send email via desktop client

Message delivered correctly

43

SMTP with Mobile App

Send email via mobile app

Message delivered correctly

44

SMTP with IoT Device

Send email from IoT device

Message delivered correctly

45

SMTP with CRM System

Send email from CRM

Message delivered correctly

46

SMTP with ERP System

Send email from ERP

Message delivered correctly

47

SMTP with Ticketing System

Send email from ticketing tool

Message delivered correctly

48

SMTP with Monitoring Tool

Send alerts via SMTP

Alerts delivered correctly

49

SMTP with Automation Tool

Send email via automation

Message delivered correctly

50

SMTP with Backup System

Send logs via SMTP

Logs delivered correctly

Support For Authentication - Testcases

S.No

Test Case

Description

Expected Result

1

AUTH LOGIN Command

Send AUTH LOGIN command

Server prompts for credentials

2

AUTH PLAIN Command

Send AUTH PLAIN command

Server accepts credentials

3

AUTH CRAM-MD5 Command

Send AUTH CRAM-MD5 command

Server performs challenge-response

4

AUTH Without EHLO

Send AUTH before EHLO

Server responds with 503 Bad sequence

5

AUTH With Valid Credentials

Provide correct username and password

Server responds with 235 Authentication successful

6

AUTH With Invalid Credentials

Provide incorrect credentials

Server responds with 535 Authentication failed

7

AUTH With Empty Credentials

Send empty username/password

Server responds with 535 Authentication failed

8

AUTH With Base64 Encoding

Send credentials in Base64

Server decodes and authenticates

9

AUTH With Malformed Encoding

Send malformed Base64

Server responds with 501 Syntax error

10

AUTH LOGIN Step-by-Step

Send username and password separately

Server authenticates successfully

11

AUTH PLAIN Inline

Send credentials inline

Server authenticates successfully

12

AUTH CRAM-MD5 Challenge

Respond to server challenge

Server validates response

13

AUTH Method Listing

Check EHLO response for supported methods

Server lists available AUTH methods

14

AUTH Method Not Supported

Use unsupported method

Server responds with 504 Unrecognized authentication type

15

AUTH Over STARTTLS

Authenticate after STARTTLS

Credentials transmitted securely

16

AUTH Without STARTTLS

Authenticate without encryption

Server may reject or warn

17

AUTH With Expired Account

Use expired credentials

Server responds with 535 Authentication failed

18

AUTH With Locked Account

Use locked credentials

Server responds with 535 Authentication failed

19

AUTH With Disabled Method

Use disabled AUTH method

Server responds with 504 Error

20

AUTH With Long Username

Use excessively long username

Server responds with 501 or 535 error

21

AUTH With Long Password

Use excessively long password

Server responds with 501 or 535 error

22

AUTH With Special Characters

Use special characters in credentials

Server handles correctly

23

AUTH With Unicode Characters

Use Unicode in credentials

Server handles correctly

24

AUTH Retry After Failure

Retry after failed attempt

Server allows retry

25

AUTH Retry Limit

Exceed retry limit

Server blocks further attempts

26

AUTH Logging

Check server logs for AUTH attempts

Logs contain accurate entries

27

AUTH Audit Trail

Verify audit trail of authentication

Trail is complete and secure

28

AUTH Session Persistence

Maintain session after authentication

Session remains active

29

AUTH Session Timeout

Let session expire

Server requires re-authentication

30

AUTH Session Termination

Terminate session manually

Server ends session

31

AUTH With Multiple Users

Authenticate different users

Server handles all correctly

32

AUTH With Role-Based Access

Authenticate with roles

Access granted based on role

33

AUTH With IP Restrictions

Authenticate from restricted IP

Server denies access

34

AUTH With Rate Limiting

Exceed login attempts per minute

Server throttles requests

35

AUTH With CAPTCHA

Use CAPTCHA in web-based SMTP

CAPTCHA validated

36

AUTH With MFA

Use multi-factor authentication

Server validates second factor

37

AUTH With Token

Use access token for authentication

Server validates token

38

AUTH With OAuth

Authenticate via OAuth

Server redirects and validates

39

AUTH With LDAP

Authenticate via LDAP backend

Server validates credentials

40

AUTH With Active Directory

Authenticate via AD

Server validates credentials

41

AUTH With Database

Authenticate via DB lookup

Server validates credentials

42

AUTH With External API

Authenticate via external service

Server validates via API

43

AUTH With Failover

Failover to backup auth service

Authentication succeeds

44

AUTH With Logging Disabled

Disable logging for privacy

No logs generated

45

AUTH With Logging Enabled

Enable detailed logging

Logs contain full trace

46

AUTH With Encryption

Encrypt credentials in transit

Data secured

47

AUTH With Replay Attack

Attempt replay of credentials

Server detects and blocks

48

AUTH With Brute Force

Simulate brute force attack

Server blocks IP or user

49

AUTH With Session Hijack

Attempt session hijack

Server detects and terminates

50

AUTH With Audit Compliance

Check compliance with standards

Authentication meets policy requirements

Header And Body Seperation - Testcases

S.No

Test Case

Description

Expected Result

1

Valid Header and Body

Send email with proper header-body separation

Server accepts message

2

Missing Header

Send email with only body

Server rejects or flags message

3

Missing Body

Send email with only headers

Server accepts but message is empty

4

No Separation Line

Omit blank line between header and body

Server rejects or misinterprets message

5

Multiple Blank Lines

Use multiple blank lines between header and body

Server processes correctly

6

Header Field Order

Send headers in standard order

Server accepts message

7

Header Field Disorder

Send headers in random order

Server accepts if fields are valid

8

Invalid Header Format

Use malformed header fields

Server rejects or flags message

9

Duplicate Header Fields

Repeat header fields like Subject

Server handles or flags duplicates

10

Case Sensitivity in Headers

Use mixed case in header names

Server processes correctly

11

Custom Header Fields

Include custom headers

Server preserves them

12

Long Header Lines

Use long header lines

Server wraps or accepts based on RFC

13

Encoded Header Fields

Use encoded values in headers

Server decodes correctly

14

MIME Version Header

Include MIME-Version header

Server accepts MIME format

15

Content-Type Header

Specify content type

Server interprets correctly

16

Content-Transfer-Encoding

Specify encoding method

Server processes accordingly

17

Date Header Format

Use correct date format

Server accepts message

18

Invalid Date Header

Use malformed date

Server flags or rejects message

19

From Header Valid

Use valid sender address

Server accepts message

20

From Header Invalid

Use malformed sender address

Server rejects message

21

To Header Valid

Use valid recipient address

Server accepts message

22

To Header Invalid

Use malformed recipient address

Server rejects message

23

Subject Header Present

Include subject line

Server accepts message

24

Subject Header Missing

Omit subject line

Server accepts but may flag message

25

Body with Plain Text

Send plain text body

Server accepts message

26

Body with HTML Content

Send HTML body

Server accepts and delivers correctly

27

Body with Mixed Content

Send multipart body

Server processes MIME correctly

28

Body with Inline Images

Include inline images

Server accepts if MIME is correct

29

Body with Attachments

Include attachments in body

Server accepts if formatted correctly

30

Body with Special Characters

Include special characters

Server preserves encoding

31

Body with Unicode

Include Unicode characters

Server handles encoding correctly

32

Body with Scripts

Include scripts in body

Server accepts but may flag as suspicious

33

Body with Links

Include hyperlinks

Server accepts message

34

Body with Large Content

Send large body content

Server accepts if within size limits

35

Body with Empty Lines

Include empty lines in body

Server preserves formatting

36

Body with Line Breaks

Use line breaks correctly

Server preserves formatting

37

Header Injection Attempt

Try injecting headers via body

Server detects and blocks

38

Body Injection Attempt

Try injecting body via headers

Server detects and blocks

39

Header and Body Logging

Log headers and body separately

Logs show correct separation

40

Header and Body Parsing

Parse headers and body correctly

Server processes each part accurately

41

Header and Body Validation

Validate structure before sending

Server accepts valid format

42

Header and Body Encoding

Encode headers and body properly

Server decodes and delivers correctly

43

Header and Body Compression

Compress message content

Server decompresses correctly

44

Header and Body Encryption

Encrypt headers and/or body

Server decrypts securely

45

Header and Body Signature

Sign headers and body

Server verifies signature

46

Header and Body Forwarding

Forward message with intact structure

Structure preserved

47

Header and Body Filtering

Apply filters based on headers/body

Filters work correctly

48

Header and Body Archiving

Archive message with structure

Structure preserved in archive

49

Header and Body Rendering

Render message in client

Headers and body displayed correctly

50

Header and Body Compliance

Check RFC compliance

Message meets standards

Reliable Delivery - Testcases

S.No

Test Case

Description

Expected Result

1

Successful Email Delivery

Send email to valid recipient

Server responds with 250 OK

2

Retry on Temporary Failure

Simulate temporary DNS failure

Server queues and retries

3

Retry Interval Configuration

Check retry timing

Server retries after configured interval

4

Max Retry Limit

Exceed retry attempts

Server bounces message

5

Delivery Confirmation

Request delivery status notification

DSN received

6

Message Queueing

Queue message when recipient server is down

Message stored for retry

7

Message Persistence

Server restart during queue

Message remains queued

8

Message Expiry

Message exceeds queue lifetime

Server returns failure

9

Bounce Message Generation

Delivery fails permanently

Bounce message sent to sender

10

Valid Recipient Address

Send to valid address

Message delivered

11

Invalid Recipient Address

Send to invalid address

Server returns 550 error

12

Domain Resolution

Resolve recipient domain

DNS lookup succeeds

13

MX Record Lookup

Lookup MX record for domain

MX record found

14

No MX Record

Domain without MX record

Server returns error

15

Server Timeout Handling

Recipient server times out

Message queued for retry

16

Network Failure Recovery

Simulate network failure

Server retries delivery

17

Duplicate Message Prevention

Prevent duplicate delivery

Server checks message ID

18

Message ID Tracking

Track message ID across retries

ID remains consistent

19

Delivery Logging

Log delivery attempts

Logs show complete history

20

Delivery Audit Trail

Audit delivery path

Trail is complete and accurate

21

Delivery to Multiple Recipients

Send to multiple valid addresses

All messages delivered

22

Partial Delivery Handling

Some recipients invalid

Valid ones receive message

23

Delivery to Alias

Send to email alias

Message forwarded correctly

24

Delivery to Mailing List

Send to list address

All members receive message

25

Delivery to Forwarding Address

Send to forwarding address

Message redirected correctly

26

Delivery with Attachment

Send email with attachment

Attachment received intact

27

Delivery with Large Body

Send large message body

Delivered if within limits

28

Delivery with HTML Content

Send HTML email

Rendered correctly by client

29

Delivery with Special Characters

Include special characters

Delivered without corruption

30

Delivery with Unicode

Include Unicode characters

Delivered correctly

31

Delivery with MIME Format

Use MIME formatting

Server processes correctly

32

Delivery with Priority Header

Set priority in header

Server respects priority

33

Delivery with Read Receipt

Request read receipt

Receipt received if supported

34

Delivery with DSN Options

Use NOTIFY and RET parameters

Server honors settings

35

Delivery with Encryption

Send over STARTTLS

Message delivered securely

36

Delivery with Authentication

Authenticate before sending

Server accepts message

37

Delivery with SPF/DKIM/DMARC

Use proper authentication records

Message passes checks

38

Delivery to External Domain

Send to different domain

Message routed correctly

39

Delivery to Internal Domain

Send within same domain

Message delivered quickly

40

Delivery with Retry Backoff

Use exponential backoff

Retry intervals increase

41

Delivery with Queue Monitoring

Monitor message queue

Message status visible

42

Delivery with Alerting

Alert on delivery failure

Notification sent to admin

43

Delivery with Logging Enabled

Enable detailed logs

Logs show full delivery path

44

Delivery with Logging Disabled

Disable logging

No logs generated

45

Delivery with Failover Server

Use backup SMTP server

Message delivered via failover

46

Delivery with Load Balancer

Route through load balancer

Message delivered efficiently

47

Delivery with Rate Limiting

Exceed rate limit

Server throttles delivery

48

Delivery with Quota Enforcement

Exceed mailbox quota

Server returns 552 error

49

Delivery with Session Timeout

Session expires during send

Server terminates connection

50

Delivery with Session Resume

Resume interrupted session

Message delivery continues

  • Reference links