{"id":274,"date":"2021-04-18T15:19:06","date_gmt":"2021-04-18T13:19:06","guid":{"rendered":"https:\/\/zimplicity.hopto.org\/?p=274"},"modified":"2021-04-18T15:20:18","modified_gmt":"2021-04-18T13:20:18","slug":"mail-system-resolved-under-homebrew","status":"publish","type":"post","link":"https:\/\/zimplicity.hopto.org\/?p=274","title":{"rendered":"Mail system resolved under Homebrew"},"content":{"rendered":"\n<p>Did some work on mail related interfaces and now have competent holding bin for system related mail relative to crontab, wordpress, and phpservermon.  <a href=\"https:\/\/formulae.brew.sh\/formula\/mailhog\">Mailhog<\/a> and update of various elements was the answer to have easy solution for mail capturing without dealing with external SMTP servers and configuration.<\/p>\n\n\n\n<p>Mailhog sits as a launch-able site to review mail generated by these systems.  Keeps it in a nice holding location for easy review.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ brew install mailhog<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/zimplicity.hopto.org\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-18-at-3.06.59-PM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"643\" src=\"https:\/\/zimplicity.hopto.org\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-18-at-3.06.59-PM.png\" alt=\"\" class=\"wp-image-275\" srcset=\"https:\/\/zimplicity.hopto.org\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-18-at-3.06.59-PM.png 1003w, https:\/\/zimplicity.hopto.org\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-18-at-3.06.59-PM-300x192.png 300w, https:\/\/zimplicity.hopto.org\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-18-at-3.06.59-PM-768x492.png 768w\" sizes=\"auto, (max-width: 1003px) 100vw, 1003px\" \/><\/a><\/figure>\n\n\n\n<p>Installation via brew was easy, although configuration of Postfix was critical:<\/p>\n\n\n\n<p>\/etc\/postfix\/main.cf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Gmail SMTP\n#relayhost=smtp.gmail.com:587\n#Enable SASL authentication in the Postfix SMTP client.\n#smtp_sasl_auth_enable=yes\n#smtp_sasl_password_maps=hash:\/etc\/postfix\/sasl_passwd\n#smtp_sasl_security_options=noanonymous\n#smtp_sasl_mechanism_filter=plain\n\n#Enable Transport Layer Security (TLS), i.e. SSL.\n#smtp_use_tls=yes\n#smtp_tls_security_level=encrypt\n#tls_random_source=dev:\/dev\/urandom\n#smtputf8_enable = no\n compatibility_level = 2\n \n#MailHog\n myhostname = localhost\n relayhost = [127.0.0.1]:1025<\/pre>\n\n\n\n<p>Key is to comment out everything gmail related (never worked anyway for some reason) and add the mailhog configuration as suggested through install documentation.  Keep compatibility_level=2 for proper logging and operation.  Worked well and stable.  Mailhog has to be started in Brew:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ brew services start mailhog<\/pre>\n\n\n\n<p>By the way, figured out that my use of apachectl was screwing up brew services, so no longer using &#8220;sudo apachectl -k restart&#8221; &#8211; that pushes web services to the SU level and causes a conflict with Brew.  By using sudo apachectl to stop and &#8220;brew services start http&#8221; everything was fixed.  Additionally, added the following to crontab: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#restart commands\n @reboot brew services restart httpd<\/pre>\n\n\n\n<p>Now, when there is a crash (still happening occasionally), restart and login causes httpd to automatically restart.  Much more functional.  If I can set it to do this without logging in, I&#8217;ll get it running automatically at runtime and without login.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did some work on mail related interfaces and now have competent holding bin for system related mail relative to crontab, wordpress, and phpservermon. Mailhog and update of various elements was the answer to have easy solution for mail capturing without dealing with external SMTP servers and configuration. Mailhog sits as a launch-able site to review &hellip; <a href=\"https:\/\/zimplicity.hopto.org\/?p=274\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mail system resolved under Homebrew<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-274","post","type-post","status-publish","format-standard","hentry","category-techproj"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p81R5K-4q","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=274"}],"version-history":[{"count":0,"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=\/wp\/v2\/posts\/274\/revisions"}],"wp:attachment":[{"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zimplicity.hopto.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}