POP3
POP3
POP3
Thunderbird Commands
After Thunder Bird loaded a mail to [email protected]'s inbox, the server's log
looks like this:
.
[19:05:17.410] [worker-1] [DEBUG] r.e.t.POP3Handler:111 - <<: QUIT
[19:05:17.412] [worker-1] [DEBUG] r.e.t.POP3Handler:317 - >>: +OK
[19:05:17.413] [worker-1] [INFO ] r.e.t.POP3Handler:76 - Client disconnected:
/127.0.0.1:37476
3. Server Responses
The server responded to the `UIDL` command with a list of unique identifiers and
corresponding mail indexes:
```
+OK
1 20231115132058121.msg
2 20231115140959481.msg
3 20231124190243550.msg
4 20231124190501328.msg
.
```
The `RETR 4` command resulted in the server sending the content of the fourth
mail:
```
+OK 365
Message-ID: 1700827501.283877-iluv@here
Date: Fri Nov 24 19:05:01 2023
MIME-Version: 1.0
User-Agent: Schwimmende Mohre Mail Client
Content-Language: en-US
To: [email protected]
Cc: [email protected]
From: iluv@here
Subject: Sample Subject
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
.
```
- Use the `UIDL` command to obtain the list of mails and their unique identifiers.
- Issue `DELE` commands for the mails to be deleted.
- Use `RETR` command to retrieve the content of a specific mail.
5. Implementation Details
The `DELE` command is implemented to handle the deletion of emails from the
user's inbox. When the server receives a `DELE` command along with the index
of the email to be deleted, it marks the corresponding email as deleted. The
acknowledgment of the deletion is then sent to the client.
The `RETR` command implementation allows the client to retrieve the content of
a specific email. When the server receives a `RETR` command along with the
index of the email, it sends back the content of the requested email to the client.
To replicate Thunderbird's actions, the client can issue the following commands:
1. `UIDL`: Retrieve the list of unique identifiers for emails in the user's inbox.
2. `DELE <index>`: Mark specific emails for deletion based on their index.
3. `RETR <index>`: Retrieve the content of a particular email for viewing or
further processing.
The server responds accordingly, providing acknowledgment for deletions and
supplying the requested email content for retrieval.
The `FileManager` class is designed to manage the directory structure for saving
mail messages.
2. Implementation Details