# Mail

Mail configuration and troubleshooting

# SPF, DMARC, and DKIM

SPF (Sender Policy Framework) is an email authentication record, which is essentially used to define which specific servers are permitted to send mail on behalf of a domain.

[https://docs.ukfast.co.uk/email/spf.html](https://docs.ukfast.co.uk/email/spf.html)

\------------------------------------------------------------------------------------------------------------------------------------------------

#### Adding an SPF record

[useful SPF record generator tool](https://mxtoolbox.com/SPFRecordGenerator.aspx)

SPF records need to be added as a TXT DNS record.

example:

"v=spf1 mx a ip4:185.216.77.122"

# Plesk Mail

<span class="TextRun SCXO27744566 BCX0" data-contrast="auto" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO27744566 BCX0"><span class="TextRun SCXO27013445 BCX0" data-contrast="none" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO27013445 BCX0">------------------------------------------------------------------------------------------------------------------------------------------ </span></span><span class="EOP SCXO27013445 BCX0"> </span></span></span>

#### <span class="TextRun SCXO27744566 BCX0" data-contrast="auto" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO27744566 BCX0">Mail Account Credentials</span></span>

We can run the below command to retrieve credentials for any mail account on a Plesk server:<span class="EOP SCXO27744566 BCX0"> </span>

```
/usr/local/psa/admin/sbin/mail_auth_view | grep -i accountname 
```

<span class="TextRun SCXO27744566 BCX0" data-contrast="auto" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO27744566 BCX0"><span class="TextRun SCXO27013445 BCX0" data-contrast="none" lang="EN-GB" xml:lang="EN-GB"><span class="NormalTextRun SCXO27013445 BCX0">------------------------------------------------------------------------------------------------------------------------------------------ </span></span><span class="EOP SCXO27013445 BCX0"></span></span></span>

# MTA & MDA

**Mail Transfer Agent (MTA)**: This is responsible for sending and receiving emails between different mail servers. MTAs handle SMTP (Simple Mail Transfer Protocol) for sending emails and can also manage incoming email delivery.

Examples of MTA:

- Postfix
- Exim
- Sendmail

**Mail Delivery Agent (MDA)**: This component is responsible for storing incoming emails on the mail server and allowing users to retrieve them. The MDA handles protocols like IMAP (Internet Message Access Protocol) and POP3 (Post Office Protocol version 3) for email retrieval.

- **IMAP (Internet Message Access Protocol)**: IMAP allows users to access and manage their email messages stored on the server. It's more advanced than POP3 and supports features like folder management, message flags, and synchronization across multiple devices.
- **POP3 (Post Office Protocol version 3)**: POP3 allows users to download emails from the server to their local device. Unlike IMAP, POP3 typically downloads emails to a single device and doesn't synchronize changes back to the server by default.

Example of MDA:

- Dovecot

### Typical Setup

In a typical email setup:

- **MTA** (e.g., Postfix) receives emails from other mail servers, performs spam checks, and delivers them to the local mailboxes.
- **MDA** (e.g., Dovecot) allows users to connect to their mailboxes using IMAP or POP3 to read, manage, and download emails.

Together, the MTA and MDA components ensure the reliable delivery and storage of emails, as well as provide access to users for reading and managing their messages.

# QUICK GUIDE: Mail Troubleshooting