{"id":201,"date":"2017-03-28T22:45:41","date_gmt":"2017-03-29T02:45:41","guid":{"rendered":"http:\/\/unliterate.net\/?p=201"},"modified":"2017-03-28T23:00:53","modified_gmt":"2017-03-29T03:00:53","slug":"dovecot-imap-part-1","status":"publish","type":"post","link":"https:\/\/www.unliterate.net\/index.php\/2017\/03\/28\/dovecot-imap-part-1\/","title":{"rendered":"Dovecot IMAP (part 1)"},"content":{"rendered":"<p>So, now i&#8217;ve gotta learn some IMAP with <a href=\"https:\/\/www.dovecot.org\/\">dovecot<\/a>, which seems to be the go-to software for coolness.<\/p>\n<p>Why? Easy!<\/p>\n<p>I&#8217;m the proud new owner of heick.email, which currently is not pointed anywhere as far as web services or anything else. What I currently do for email is take <em>*@unliterate.net<\/em>, drop any messages to a SPAM folder, and let my Thunderbird pull the messages and based on the * part I sort it into folders. This way, I can use email addresses like <em>matthew.is.awesome@unliterate.net<\/em>, and I would get the email in my Inbox. It&#8217;d be considered SPAM, but if I wanted to actually draw my attention to it I&#8217;d create a mail filter and sort that into a folder.<\/p>\n<p>One of the cool things about IMAP is the folders. You can, at a whim, create a folder and have client-related mail rules &#8220;filter&#8221; email to a separate folder. Folders can also be &#8220;private&#8221; or &#8220;shared&#8221;, which is a good feature.<\/p>\n<p>So, i&#8217;ve set myself a goal so far:<\/p>\n<ul>\n<li>Choose an IMAP server software (dovecot)<\/li>\n<li>Configure it up with 143 (imap) and 993 (imaps)<\/li>\n<li>Get POP (110) access<\/li>\n<li>Setup the main SPAM inbox user<\/li>\n<li>Setup scripts to be able to allocate an inbox to a user that is not part of SPAM (for some possible gifting or resale)<\/li>\n<li>Setup \/my\/ user<\/li>\n<li>&#8230;<\/li>\n<li>profit<\/li>\n<\/ul>\n<p>I am going to have to learn how to talk to IMAP via Terminal as well so I can fine-tune my configurations and see what I&#8217;m doing.<\/p>\n<p>To start, I&#8217;m using Oracle VM VirtualBox with 2 VM&#8217;s<\/p>\n<ul>\n<li>Windows XP for Outlook Express. Not caring about updates or anything<\/li>\n<li>Centos 6.8 minimal, for base installation and configuration<\/li>\n<\/ul>\n<p>usual &#8220;test&#8221; settings such as everything on the same network, root password is <em>password<\/em>, and no firewalls and full updates where necessary.<\/p>\n<p>I&#8217;ve also created a user called <em>userpoop<\/em> with password <em>poopuser<\/em>. No domain definition\u00a0<em>yet<\/em>, as this is the preliminaries.<\/p>\n<pre>$ adduser userpoop\r\n$ passwd userpoop<\/pre>\n<p><span style=\"text-decoration: underline;\"><strong>IMAP 101<\/strong><\/span><\/p>\n<p>I&#8217;ve had to learn some basic commands to talk to IMAP, such as:<\/p>\n<pre>A login userpoop\u00a0poopuser\r\nB select INBOX\r\nC logout<\/pre>\n<p>^ Some of the basics on getting in and out of your folder.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Installing on Centos6.8<\/strong><\/span><\/p>\n<p>yum does what I need it to do:<\/p>\n<pre>yum install dovecot<\/pre>\n<p>this gives me dovecot-2.0.9-22 and portreserve-0.0.4-11.<\/p>\n<pre>$ rpm -ql portreserve\r\n\/etc\/portreserve\r\n\/etc\/rc.d\/init.d\/portreserve\r\n\/sbin\/portrelease\r\n\/sbin\/portreserve\r\n\/usr\/share\/doc\/portreserve-0.0.4\r\n\/usr\/share\/doc\/portreserve-0.0.4\/COPYING\r\n\/usr\/share\/doc\/portreserve-0.0.4\/ChangeLog\r\n\/usr\/share\/doc\/portreserve-0.0.4\/NEWS\r\n\/usr\/share\/doc\/portreserve-0.0.4\/README\r\n\/usr\/share\/man\/man1\/portrelease.1.gz\r\n\/usr\/share\/man\/man1\/portreserve.1.gz\r\n\/var\/run\/portreserve<\/pre>\n<p>&#8230;curious.<\/p>\n<p>Everything with dovecot that I need is in \/etc\/dovecot\/*. Keeping the default configuration, and knowing that the configuration loads via ASCII order i&#8217;ll just give myself a configuration file to work with:<\/p>\n<pre>touch \/etc\/dovecot\/conf.d\/99-self.conf\r\n\r\n# First requirement of this is to ONLY have imap, not pop3\r\n# So, we need to adjust the server that we're listiening on\r\n\r\n# This enables imap(143) and imaps(993)\r\nprotocols = imap\r\n\r\n# Setup where we store mail at\r\nmail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u\r\n\r\n# HACKERY TO GET IT WORKING\r\n# related to authentication\r\ndisable_plaintext_auth = no\r\nauth_mechanisms = plain\r\n# Using a passwordfile\r\npassdb {\r\n driver = passwd-file\r\n args = scheme=CRYPT username_format=%u \/etc\/dovecot\/users\r\n}\r\nuserdb {\r\n driver = passwd-file\r\n args = username_format=%u \/etc\/dovecot\/users\r\n}\r\n\r\n<\/pre>\n<p>and I need an \/etc\/dovecot\/users to get basic PLAIN authentication started, so I can get more familiar with this:<\/p>\n<pre>\/etc\/dovecot\/users\r\nuserpoop:{PLAIN}poopuser:500:500::\/home\/userpoop<\/pre>\n<p>and now&#8230;we test via telnet<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, now i&#8217;ve gotta learn some IMAP with dovecot, which seems to be the go-to software for coolness. Why? Easy! I&#8217;m the proud new owner of heick.email, which currently is not pointed anywhere as far as web services or anything else. What I currently do for email is take *@unliterate.net, drop any messages to a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-random"],"_links":{"self":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":4,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}