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
------------------------------------------------------------------------------------------------------------------------------------------------
Adding an SPF record
useful SPF record generator tool
SPF records need to be added as a TXT DNS record.
example:
"v=spf1 mx a ip4:185.216.77.122"
Plesk Mail
------------------------------------------------------------------------------------------------------------------------------------------
Mail Account Credentials
We can run the below command to retrieve credentials for any mail account on a Plesk server:
/usr/local/psa/admin/sbin/mail_auth_view | grep -i accountname
------------------------------------------------------------------------------------------------------------------------------------------
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.