Setting up your own mail server

There are three basic steps to install and configure your own mail server.





  • IP and DNS setup





  • Selecting and running the mail server application





  • Adding your mail server to whitelisting





IP and DNS setup

Securing external static IP, public domain and PTR record

These are the basic requirements for running your own mail server.





  • IP-

    IP- . -.





  • IP

    DNS- IP-. DNS .





  • IP

    , DNS- ( PTR) IP-. - - . IP- (, ), ‘nslookup’ Windows ‘host’ UNIX.





MX DNS

(MX) , .





, - mycompany.com, - mail.mycompany.com, DNS mycompany.com :





Type





Host





Value





Priority





TTL





MX





@





mail.mycompany.com





10





1 min





:





  • Priority () , .





  • TTL ( ) , DNS .





DKIM DNS

, (DKIM) — , . , , .





. -, Power DMARC Toolbox - DKIM Record Generator, OpenSSL ( Windows):







  • openssl.exe genrsa -out private.key 2048







  • openssl.exe rsa -in private.key -pubout -outform der 2>nul | openssl base64 -A > public.key.txt





DNS :





Type





Host





Value





TTL





TXT





selector._domainkey





v=DKIM1; k=rsa; p=public_key





1 min





:





  • selector - (, mysrv), ( ).





  • public_key - , base64 ( public.key.txt).





  • TTL ( ) , .





SPF DNS

(SPF) — , IP- IP- .





DNS :





Type





Host





Value





TTL





TXT





@





v=spf1 a mx include:relayer_name -all





1 min





:





  • relayer_name - - ( ). - "include:".





  • TTL ( ) , .





- SPF.





DNS

, .





  • DMARC

    , (DMARC) , .





  • BIMI

    (BIMI) — , , . , BIMI .





  • TLS-RPT

    TLS- (TLS-RPT) , .





  • MTA-STS

    (MTA-STS) - , SMTP, , .





MTA-STS Power DMARC Toolbox. MTA-STS Google, habr, , , Hardenize.





, . . , hMailServer Windows, . UNIX , Exim Internet Mailer iRedMail.





, . , , .





, .







  • .







  • , SSL . SSL .







  • , DKIM. . , «», «SHA256», SMTP (, google).







  • , - , spamhaus.org, .





, .





SMTP

SMTP / . .





  • 25

    . STARTTLS.





  • 587

    . STARTTLS.





  • 465

    . SSL/TLS.





POP3, IMAP

POP3 IMAP , Outlook . .





993 IMAP, 995 - POP3. SSL/TLS ( STARTTLS).





143 IMAP 110 POP3, .





, , , - . , (. hMailServer).





.





Gmail.com

Gmail.com ( ), Gmail. « ».





«: », DKIM . « : », SPF .





, , .





, Outlook .





-

-, . .





  • AppMailDev

    , DKIM SPF, . .





  • DKIMValidator

    , . .





  • HAD Email Auth Tester

    , tester@email-test.had.dnsops.gov. .





  • PowerDMARC

    , , .





, , , .





, , - . , IP ( ) - . IP- -.





, IP (, , ) - . -, . , MXToolBox . , multirbl.valli.org .





, IP- . , , UCEPROTECT®-Network.





, habr IP .





, Outlook, . - . URL- . , URL , , .





- - - SMTP. ( ) .





  • MailerSend

    - 20 . : CC BCC .





  • SendInBlue

    , 9 200 . : .





. , , DNS (DKIM, SPF DMARK) ( SMTP, ).





, . , . - , .








All Articles