{"id":4518,"date":"2018-07-25T19:02:54","date_gmt":"2018-07-25T19:02:54","guid":{"rendered":"https:\/\/geekdecoder.com\/?p=4518"},"modified":"2018-07-25T19:02:54","modified_gmt":"2018-07-25T19:02:54","slug":"set-up-sendgrid-on-plesk","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2018\/07\/25\/set-up-sendgrid-on-plesk\/","title":{"rendered":"Set up Sendgrid on Plesk"},"content":{"rendered":"<p>This is used to set up Sendgrid in Plesk for Azure email functionality.<\/p>\n<ol>\n<li>Set up a sendgrid account and set up the first email:<br \/>\n<a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/07\/sendgrid.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4519\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/07\/sendgrid.png\" alt=\"\" width=\"963\" height=\"225\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2018\/07\/sendgrid.png 963w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2018\/07\/sendgrid-300x70.png 300w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2018\/07\/sendgrid-768x179.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/a><\/li>\n<li>\u00a0Ssh to the Azure server and make the following modifications:<\/li>\n<\/ol>\n<p>Find your Postfix config file, typically \/etc\/postfix\/main.cf, and add the following:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">smtp_sasl_auth_enable = yes\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd\nsmtp_sasl_security_options = noanonymous\nsmtp_sasl_tls_security_options = noanonymous\nsmtp_tls_security_level = encrypt\nheader_size_limit = 4096000\nrelayhost = &#x5B;smtp.sendgrid.net]:587\n\n<\/pre>\n<p>Now you need to specify your credentials (optionally, use apikey as username and an API Key as password) in the separate file \/etc\/postfix\/sasl_passwd (you\u2019ll likely need to create it):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;smtp.sendgrid.net]:587 yourSendGridUsername:yourSendGridPassword\n\n<\/pre>\n<p>Next, make sure the file has restricted read and write access only for root, and use the postmap command to update Postfix\u2019s hashtables to use this new file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo chmod 600 \/etc\/postfix\/sasl_passwd\n$ sudo postmap \/etc\/postfix\/sasl_passwd\n\n<\/pre>\n<p>Finally, restart Postfix:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo systemctl restart postfix\n\n<\/pre>\n<p>Send your email and then verify in sendgrid.<\/p>\n<p>If you are getting no mechanism available error messages it generally indicates that you are missing some SASL authentication libraries.<\/p>\n<p>Install the missing module dependency using apt-get (i.e., Debian, Ubuntu):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ apt-get install libsasl2-modules\n\n<\/pre>\n<p>Or using a yum (i.e., RedHat, Fedora, CentOS):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ yum install cyrus-sasl-plain\n\n<\/pre>\n<p>Troubleshooting<br \/>\nIf port 587 is not working for you please try 2525 in your postfix config. You may also need to edit \/etc\/postfix\/master.cf to remove # from<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#tlsmgr unix - - n 1000? 1 tlsmgr\n\n<\/pre>\n<p>Other integrations with MTA&#8217;a &#8211; https:\/\/sendgrid.com\/docs\/Integrate\/Mail_Servers\/postfix.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is used to set up Sendgrid in Plesk for Azure email functionality. Set up a sendgrid account and set up the first email: \u00a0Ssh to the Azure server and make the following modifications: Find your Postfix config file, typically \/etc\/postfix\/main.cf, and add the following: smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options &#8230; <a title=\"Set up Sendgrid on Plesk\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2018\/07\/25\/set-up-sendgrid-on-plesk\/\" aria-label=\"Read more about Set up Sendgrid on Plesk\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86],"tags":[],"class_list":["post-4518","post","type-post","status-publish","format-standard","hentry","category-plesk"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=4518"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4518\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=4518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=4518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=4518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}