This commit is contained in:
2024-04-03 22:04:13 +02:00
parent 7e68609006
commit 0b373d31db
142 changed files with 7334 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# EHLO Response Codes
**EHLO Response Codes** are used by an **SMTP server** in response to an **EHLO command** issued by an **SMTP client**.
> Please note that the presence and specific **EHLO response codes** will depend on the **SMTP server software**, its version, and its configuration. The above table includes some commonly encountered **EHLO response codes**, but it may not cover every possible code or extension.
| EHLO Response Code | Description |
| --- | --- |
| 250 | Requested mail action okay, completed |
| 250-PIPELINING | Server supports command pipelining |
| 250-SIZE `<value>` | Server specifies maximum message size |
| 250-ETRN | Server supports the ETRN extension |
| 250-ENHANCEDSTATUSCODES | Server uses enhanced status codes |
| 250-8BITMIME | Server supports the 8BITMIME extension |
| 250-DSN | Server supports delivery status notifications (DSN) |
| 250-STARTTLS | Server supports TLS encryption |
| 250-AUTH `<authentication_types>` | Server specifies supported authentication types |
| 250-DELIVERBY | Server supports the DELIVERBY extension |
| 250-RSET | Server supports the RSET command |
| 250-HELP | Server provides help information |
| 250-BINARYMIME | Server supports binary MIME (Multipurpose Internet Mail Extensions) |
| 250-CHUNKING | Server supports chunking for message transmission |
| 250-EXPN | Server supports the EXPN command |
| 250-VRFY | Server supports the VRFY command |
| 250-X-EXPS `<extension>` | Server supports an additional extension |
| 250 X-LINK2STATE | Server provides link-related state information |

View File

@ -0,0 +1,3 @@
# IMAP (Internet Message Access Protocol)
**IMAP** is a protocol for retrieving mail from a **mail server**.

View File

@ -0,0 +1,3 @@
# POP3 (Post Office Protocol version 3)
**POP3** is a protocol for retrieving mail from a **mail server**.

View File

@ -0,0 +1,29 @@
# SMTP Response Codes
**SMTP Response Codes**, also known as **SMTP Status Codes**, are used to indicate the success or failure of an **SMTP command**. They are typically sent by an **SMTP server** in response to an **SMTP command** issued by an **SMTP client**.
| Status Code | Description |
| --- | --- |
| 211 | System status or system help response |
| 214 | Help message |
| 220 | Service ready |
| 221 | Service closing transmission channel |
| 235 | Authentication successful |
| 250 | Requested mail action completed |
| 251 | User not local; will forward |
| 252 | Cannot verify the user; will attempt delivery |
| 354 | Start mail input; end with `<CRLF>.<CRLF>` |
| 421 | Service not available, closing transmission channel |
| 450 | Requested action not taken - mailbox unavailable |
| 451 | Requested action aborted: local error in processing |
| 452 | Requested action not taken - insufficient system storage |
| 500 | Syntax error, command unrecognized |
| 501 | Syntax error in parameters or arguments |
| 502 | Command not implemented |
| 503 | Bad sequence of commands |
| 504 | Command parameter not implemented |
| 550 | Requested action not taken - mailbox unavailable |
| 551 | User not local; please try `<forward-path>` |
| 552 | Requested mail action aborted - exceeded storage allocation |
| 553 | Requested action not taken - mailbox name not allowed |
| 554 | Transaction failed |

View File

@ -0,0 +1,71 @@
# SMTP Troubleshooting Cheat Sheet
[SMTP (Simple Mail Transfer Protocol)](mail-smtp.md) is a networking protocol for mail transfer. It's used to send emails from a mail client to a mail server and between mail servers.
## Test SMTP Server connectivity
```bash
telnet smtp.example.com 25
```
## Test SMTP Server connectivity with STARTTLS
```bash
openssl s_client -starttls smtp -ign_eof -crlf -connect smtp.example.com:587
```
## HELO
The HELO (or EHLO) command is a command used by the SMTP client when it initiates a connection with an SMTP server, to announce itself and establish communication.
```bash
EHLO example.com
```
In response to the HELO command, the SMTP server typically sends a reply code indicating the success or failure of the command. The server may also include additional information or instructions. Here's an example of an EHLO response:
```bash
250-FR3P281CA0133.outlook.office365.com Hello [***.***.***.***]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
```
*For more information about EHLO response codes see [EHLO Response Codes](ehlo-codes.md), and for SMTP response codes see [SMTP Response Codes](smtp-codes.md).*
## Authentication
SMTP servers typically require authentication before allowing a user to send mail. Some authentication methods, such as `LOGIN` and `PLAIN`, are supported by default, while others may need to be enabled by the server administrator.
```bash
AUTH LOGIN
your-base64encoded-username
your-base64encoded-password
```
To encode a string in base64, you can use the `base64` command:
```bash
echo -n "username" | base64
```
## Send Email
To test sending an email using the `MAIL FROM`, `RCPT TO`, and `DATA` commands:
```bash
MAIL FROM: <sender@example.com>
RCPT TO: <recipient@example.com>
DATA
Subject: This is the subject line
This is the message body.
You can write multiple lines.
.
```

View File

@ -0,0 +1,23 @@
# SMTP (Simple Mail Transfer Protocol)
**SMTP (Simple Mail Transfer Protocol)** is a networking protocol for [mail](mail.md) transfer. It's used to send emails from a mail client to a mail server and between mail servers.
Server-to-Server communication is typically done over port `25`. Client-to-Server communication is typically done over port `587`. Alternatively, port `465` can be used for client-to-server communication with [TLS](../tls.md).
## Configuration
### SMTP Server
The SMTP server is a mail server that receives emails from a mail client and forwards them to their intended recipients. It's also responsible for receiving emails from other mail servers and delivering them to their intended recipients.
### SMTP Client
The SMTP client is a mail client that sends emails to a mail server for delivery. It's also responsible for receiving emails from other mail servers and delivering them to their intended recipients.
## Troubleshooting
[SMTP Troubleshooting Cheat Sheet](smtp-troubleshooting.md)
## References
- [SMTP (Simple Mail Transfer Protocol)](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol)

11
networking/mail/mail.md Normal file
View File

@ -0,0 +1,11 @@
# Mail
**Mail** or **Email** is a digital method of exchanging messages between people using devices like computers, tablets, and mobile phones. Today's email systems are based on a store-and-forward model, allowing users to send and receive messages without needing to be online simultaneously.
## Mail Protocols
Mail Servers typically use the [SMTP](mail-smtp.md) protocol to send and receive mail. The [IMAP](mail-imap.md) and [POP3](mail-pop3.md) protocols are used to retrieve mail from a mail server.
## Mail Server Records
Mail Servers are identified by [MX Records](../dns/dns-record-mailserver.md) in the [DNS](../dns/dns.md) system.