{"id":1517,"date":"2021-12-08T21:59:57","date_gmt":"2021-12-08T20:59:57","guid":{"rendered":"https:\/\/www.web-workers.ch\/?p=1517"},"modified":"2021-12-08T22:00:02","modified_gmt":"2021-12-08T21:00:02","slug":"how-to-configure-conditional-smart-relay-with-sendmail-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/www.web-workers.ch\/index.php\/2021\/12\/08\/how-to-configure-conditional-smart-relay-with-sendmail-on-rocky-linux-8\/","title":{"rendered":"How to configure conditional smart relay with sendmail on Rocky Linux 8"},"content":{"rendered":"<p>Rocky Linux 8 with sendmail hosting multiple domains works fine. Only one domain should be configured to use a smarthost with a third party anti-spam service. We want to prevent that every e-mail will be relayed to one external smart host, all other e-mails should go out directly.<\/p>\n<ol>\n<li>Create a smarttable file.\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># touch \/etc\/mail\/smarttable<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Download <a href=\"http:\/\/jmaimon.com\/sendmail\/anfi.homeunix.net\/sendmail\/smarttable.m4\" target=\"_blank\" rel=\"noopener\">smarttable.m4<\/a> and copy the file to \/usr\/share\/sendmail-cf\/feature\/\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># cd \/usr\/share\/sendmail-cf\/feature\/\n# wget http:\/\/jmaimon.com\/sendmail\/anfi.homeunix.net\/sendmail\/smarttable.m4<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Add following entry to your sendmail.cf file.\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-plain\" data-lang=\"Plain Text\"><code>FEATURE(`smarttable')dnl<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Rebuild the sendmail config\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># \/etc\/mail\/make\n# service sendmail restart<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Create your smarttable\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># cat \/etc\/mail\/smarttable\n@domain-a.com relay-cluster-eu01.hornetsecurity.com\n@domain-b.com relay-cluster-us01.hornetsecurity.com<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Rebuild smartable by using makemap\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code># makemap hash \/etc\/mail\/smarttable &lt; \/etc\/mail\/smarttable<\/code><\/pre>\n<\/div>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Rocky Linux 8 with sendmail hosting multiple domains works fine. Only one domain should be configured to use a smarthost with a third party anti-spam service. We want to prevent [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1519,"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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[161,160,100,162],"class_list":["post-1517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-relay","tag-rock-linux","tag-sendmail","tag-smarthost"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.web-workers.ch\/wp-content\/uploads\/2021\/12\/sendmail.png?fit=800%2C287&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8sxjX-ot","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts\/1517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/comments?post=1517"}],"version-history":[{"count":3,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts\/1517\/revisions"}],"predecessor-version":[{"id":1521,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/posts\/1517\/revisions\/1521"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/media\/1519"}],"wp:attachment":[{"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/media?parent=1517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/categories?post=1517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.web-workers.ch\/index.php\/wp-json\/wp\/v2\/tags?post=1517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}