{"id":2380,"date":"2024-02-02T09:55:56","date_gmt":"2024-02-02T08:55:56","guid":{"rendered":"http:\/\/blog.campodoro.org\/?p=2380"},"modified":"2024-02-02T10:31:02","modified_gmt":"2024-02-02T09:31:02","slug":"export-hestia-mail-domains-into-proxmox-mail-gateway-8","status":"publish","type":"post","link":"http:\/\/blog.campodoro.org\/?p=2380","title":{"rendered":"Export Hestia mail domains into the Relay Domains in Proxmox Mail Gateway 8"},"content":{"rendered":"<p>See my <a href=\"http:\/\/blog.campodoro.org\/?p=2367\" target=\"_blank\" rel=\"noopener\">blogpost<\/a> about using PMG with Hestia. This is a quick and dirty script to get all Hestia mail domain names for all Hestia users into the <strong>Mail Proxy Relay Domains list<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2388\" src=\"http:\/\/blog.campodoro.org\/wp-content\/uploads\/2024\/02\/pmg.png\" alt=\"\" width=\"609\" height=\"188\" srcset=\"http:\/\/blog.campodoro.org\/wp-content\/uploads\/2024\/02\/pmg.png 609w, http:\/\/blog.campodoro.org\/wp-content\/uploads\/2024\/02\/pmg-300x93.png 300w, http:\/\/blog.campodoro.org\/wp-content\/uploads\/2024\/02\/pmg-500x154.png 500w\" sizes=\"(max-width: 609px) 100vw, 609px\" \/><\/p>\n<p>First, on Hestia, export all configured mail domains for all user:<\/p>\n<pre class=\"p1\">for user in $(v-list-users | awk '{print $1}')\r\ndo \r\n v-list-mail-domains $user | awk '{print $1}' | grep -v -e 'USER' -e 'DOMAIN' -e '------' -e 'Error:' &gt;&gt; relay_domains.txt\r\ndone<\/pre>\n<p>Get the <strong>relay_domains.txt<\/strong> file to your Proxmox master or node server and run the import:<\/p>\n<pre class=\"p1\">while IFS= read -r domain \r\ndo\r\n pmgsh create \/config\/domains --domain $domain\r\n echo \"Added relay domain: $domain\" \r\ndone &lt; relay_domains.txt<\/pre>\n<p>Done.<\/p>\n<p>Now you can continue with setting up the mail domains settings as described <a href=\"http:\/\/blog.campodoro.org\/?p=2367\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<div class=\"tweetthis\" style=\"text-align:left;\"><p> <a class=\"tt\" href=\"http:\/\/twitter.com\/share?url=http:\/\/blog.campodoro.org\/?p=2380&text=Export+Hestia+mail+domains+into+the+Relay+Domains+in+Proxmox+Mail+Gateway+8+%23campodoro+%23tips+%23apple&via=goudkamp&related=richardxthripp%2Ctweetthisplugin\" title=\"Twitter\"><img decoding=\"async\" class=\"nothumb\" src=\"http:\/\/blog.campodoro.org\/wp-content\/plugins\/tweet-this\/icons\/en\/twitter\/tt-twitter.png\" alt=\"Post to Twitter\" \/><\/a> <a class=\"tt\" href=\"http:\/\/twitter.com\/share?url=http:\/\/blog.campodoro.org\/?p=2380&text=Export+Hestia+mail+domains+into+the+Relay+Domains+in+Proxmox+Mail+Gateway+8+%23campodoro+%23tips+%23apple&via=goudkamp&related=richardxthripp%2Ctweetthisplugin\" title=\"Twitter\">Tweet<\/a> <a class=\"tt\" href=\"http:\/\/delicious.com\/post?url=http:\/\/blog.campodoro.org\/?p=2380&amp;title=Export+Hestia+mail+domains+into+the+Relay+Domains+in+Proxmox+Mail+Gateway+8\" title=\"Post to Delicious\"><img decoding=\"async\" class=\"nothumb\" src=\"http:\/\/blog.campodoro.org\/wp-content\/plugins\/tweet-this\/icons\/en\/delicious\/tt-delicious.png\" alt=\"Post to Delicious\" \/><\/a> <a class=\"tt\" href=\"http:\/\/delicious.com\/post?url=http:\/\/blog.campodoro.org\/?p=2380&amp;title=Export+Hestia+mail+domains+into+the+Relay+Domains+in+Proxmox+Mail+Gateway+8\" title=\"Post to Delicious\">Post to Delicious<\/a> <a class=\"tt\" href=\"http:\/\/www.facebook.com\/share.php?u=http:\/\/blog.campodoro.org\/?p=2380&amp;t=Export+Hestia+mail+domains+into+the+Relay+Domains+in+Proxmox+Mail+Gateway+8\" title=\"Post to Facebook\"><img decoding=\"async\" class=\"nothumb\" src=\"http:\/\/blog.campodoro.org\/wp-content\/plugins\/tweet-this\/icons\/en\/facebook\/tt-facebook.png\" alt=\"Post to Facebook\" \/><\/a> <a class=\"tt\" href=\"http:\/\/www.facebook.com\/share.php?u=http:\/\/blog.campodoro.org\/?p=2380&amp;t=Export+Hestia+mail+domains+into+the+Relay+Domains+in+Proxmox+Mail+Gateway+8\" title=\"Post to Facebook\">Post to Facebook<\/a><\/p><\/div>","protected":false},"excerpt":{"rendered":"<p>See my blogpost about using PMG with Hestia. This is a quick and dirty script to get all Hestia mail domain names for all Hestia users into the Mail Proxy Relay Domains list. First, on Hestia, export all configured mail &hellip; <a href=\"http:\/\/blog.campodoro.org\/?p=2380\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[253,231,10,259],"tags":[256,255,258,257],"class_list":["post-2380","post","type-post","status-publish","format-standard","hentry","category-hestia","category-hosting","category-linux","category-proxmox","tag-batch","tag-hestia","tag-pmg","tag-proxmox"],"_links":{"self":[{"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts\/2380"}],"collection":[{"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2380"}],"version-history":[{"count":8,"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts\/2380\/revisions"}],"predecessor-version":[{"id":2394,"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts\/2380\/revisions\/2394"}],"wp:attachment":[{"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2380"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}