{"id":10643,"date":"2021-12-06T09:13:52","date_gmt":"2021-12-06T09:13:52","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=10643"},"modified":"2021-12-06T09:14:29","modified_gmt":"2021-12-06T09:14:29","slug":"sendmail-bind-to-ip-address","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/linux\/sendmail-bind-to-ip-address\/31045.html","title":{"rendered":"Sendmail Bind To Ip Address"},"content":{"rendered":"<p>I saw a comment on <a href=\"https:\/\/web.archive.org\/web\/20201124031216\/https:\/\/computing.net\/answers\/linux\/bind-sendmail-to-ip-address\/6063.html.\" target=\"_blank\" rel=\"noopener\">https:\/\/computing.net\/answers\/li&#8230;<\/a> To bind sendmail to a specific ip address you need to edit the \/etc\/mail\/sendmail.mc file. (editing sendmail.cf file is bad, unless you really know what you are doing).<\/p>\n<p>In the sendmail.mc file, you are looking for the line containing:<br \/>\nDAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#8217;)<br \/>\nJust change &#8220;127.0.0.1&#8221; to the IP Address you are looking to bind the sendmail daemon to. If you want to bind to all IP Addresses on the local system, change it to &#8220;0.0.0.0&#8221; as such:<br \/>\nDAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA&#8217;)<\/p>\n<p>To test to see if it is binding properly, check out &#8216;netstat&#8217; and the tcp ports. We are looking for port 25 (smtp).<\/p>\n<p>netstat -ntlp<\/p>\n<p>This will bring up all open listening(-l) tcp(-t) ports, and PID (-p) (process id) along with the name of the process. You should see a line as such:<\/p>\n<p>tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 5239\/sendmail: acce<\/p>\n<p>This shows that we are listening on all IP (v4) addresses, on port 25 (column 3), and will accept connections from all (column 4). The last column is the PID, and the program the PID is associated with. (PID and program will only show if you are running command netstat as root\/sudo).<\/p>\n<p>Hope this helps all.<\/p>\n<p>-Captain Mikey<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":2},"question-category":[58],"question_tags":[],"class_list":["post-10643","question","type-question","status-publish","hentry","question-category-linux"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/10643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=10643"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=10643"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=10643"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=10643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}