0779.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Running Docker Mail Server - A Full Stack Email Solution - In Docker</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Docker Made Easy,Home Lab,Home Lab Ideas,Install Guide,Docker,E-Mail,E-Mail Server,Free And Easy SMTP Server,Free E-Mail Server,Ubuntu,System Administrator,SMTP,Linux,Mail Server,Local E-Mail,Email,System Administration,Docker Based E-Mail Server,How To Install Docker Mailserver,Docker Mailserver,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Running Docker Mail Server - A Full Stack Email Solution - In Docker">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="08/10/2022 06:22:54 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Running Docker Mail Server - A Full Stack Email Solution - In Docker</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Docker Mailserver?</h2>
  26. <blockquote>[Docker Mailserver is a] production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.). Only configuration files, no SQL database. Keep it simple and versioned. Easy to deploy and upgrade.<i> - <a href="https://github.com/docker-mailserver/docker-mailserver" target="_blank">https://github.com/docker-mailserver/docker-mailserver</a></i></blockquote>
  27. <h2>Installing Docker</h2>
  28. <ol>
  29. <li>Log into the Linux host and run the following commands in a terminal window
  30. <div class="codeBlock"># update software repositories<br />
  31. sudo apt update<br />
  32. # install prerequisites<br />
  33. sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
  34. # add docker gpg key<br />
  35. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  36. # add docker software repository<br />
  37. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  38. # install docker<br />
  39. sudo apt install docker-ce docker-compose containerd.io -y<br />
  40. # enable and start docker service<br />
  41. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  42. # add the current user to the docker group<br />
  43. sudo usermod -aG docker $USER<br />
  44. # reauthenticate for the new group membership to take effect<br />
  45. su - $USER</div>
  46. </li>
  47. </ol>
  48. <h2>Running Docker Mailserver Container</h2>
  49. <ol>
  50. <li>Continue with the following commands in a terminal window
  51. <div class="codeBlock"># create main working directories<br />
  52. mkdir ~/docker/mailserver/{data,state,logs,config} -p<br />
  53. # set owner of working directories<br />
  54. sudo chown &quot;$USER&quot;:&quot;$USER&quot; ~/docker -R<br />
  55. # run the mailserver container<br />
  56. docker run -d --name=mailserver --hostname=&quot;$HOSTNAME&quot; --domainname=&quot;docker.local&quot; -p 25:25 -p 143:143 -p 587:587 -p 993:993 -e ENABLE_SPAMASSASSIN=1 -e SPAMASSASSIN_SPAM_TO_INBOX=1 -e ENABLE_CLAMAV=1 -e ENABLE_POSTGREY=1 -e ENABLE_FAIL2BAN=0 -e ENABLE_SASLAUTHD=0 -e ONE_DIR=1 -e TZ=America/New_York -v ~/docker/mailserver/data/:/var/mail/ -v ~/docker/mailserver/state/:/var/mail-state/ -v ~/docker/mailserver/logs/:/var/log/mail/ -v ~/docker/mailserver/config/:/tmp/docker-mailserver/ --restart=unless-stopped mailserver/docker-mailserver<br />
  57. # create a user/inbox<br />
  58. docker run --rm -e MAIL_USER=i12bretro@docker.local -e MAIL_PASS=supersecret -it mailserver/docker-mailserver /bin/sh -c &#39;echo &quot;$MAIL_USER|$(doveadm pw -s SHA512-CRYPT -u $MAIL_USER -p $MAIL_PASS)&quot;&#39; &gt;&gt; ~/docker/mailserver/config/postfix-accounts.cf</div>
  59. </li>
  60. </ol>
  61. <h2>Setting Up An E-Mail Client</h2>
  62. <ol>
  63. <li>Download Mozilla Thunderbird Portable <a href="https://portableapps.com/apps/internet/thunderbird_portable" target="_blank">Download</a></li>
  64. <li>Run the downloaded paf.exe file and extract it to any location</li>
  65. <li>Check the Run box and click Finish</li>
  66. <li>Fill out Your name, Email address and Password for the account created earlier</li>
  67. <li>Click Manual config</li>
  68. <li>For Incoming, enter the DNS name or IP address of the docker host</li>
  69. <li>For Outgoing, enter the DNS name or IP address of the docker host</li>
  70. <li>Click the Re-test button, Thunderbird should set some additional values</li>
  71. <li>Click Done</li>
  72. <li>Select I understand the risks &gt; Done</li>
  73. <li>From within Thunderbird, compose a new email address and send it to the inbox created earlier to test internal emails are working</li>
  74. </ol>
  75. <p>Documentation: <a href="https://docker-mailserver.github.io/docker-mailserver/edge/" target="_blank">https://docker-mailserver.github.io/docker-mailserver/edge/</a></p> </div>
  76. </div>
  77. </body>
  78. </html>