{"id":4435,"date":"2014-09-24T14:49:38","date_gmt":"2014-09-24T11:49:38","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=4435"},"modified":"2014-09-24T14:52:34","modified_gmt":"2014-09-24T11:52:34","slug":"exim-%d1%80%d0%b5%d0%b2%d1%80%d0%b0%d0%b9%d1%82-%d0%b7%d0%b0%d0%b3%d0%be%d0%bb%d0%be%d0%b2%d0%ba%d0%b0-from","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=4435","title":{"rendered":"[exim] \u0420\u0435\u0432\u0440\u0430\u0439\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 From"},"content":{"rendered":"<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0434\u0435\u043b\u0430\u0442\u044c <strong>rewrite<\/strong> \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441 \u043a\u0430\u043a\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0438\u0434\u0451\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438:<br \/>\n&#8211; \u0435\u0441\u043b\u0438 <strong>IP<\/strong> \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <strong>localhost<\/strong>), \u0442\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u0435 <strong>From<\/strong> \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<br \/>\n&#8211; \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043d\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>local_sender_host<\/strong> \u0438 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043d\u0435\u0451 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 IP. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e <strong>localhost<\/strong> (<strong>@[]<\/strong> &#8211; \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u043b\u043e\u0432\u0430 &#8216;<strong>localhost<\/strong>&#8216;, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0440\u043e\u0443\u0442\u0435\u0440\u0430\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u043e &#8216;<strong>localhost<\/strong>&#8216;)<\/p>\n<p><!--more--><\/p>\n<p><code>hostlist local_sender_host = 127.0.0.1:@[]<\/code><\/p>\n<p>\u0412 \u0441\u0430\u043c\u044b\u0439 \u0432\u0432\u0435\u0440\u0445 (\u043f\u0435\u0440\u0435\u0434 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c <strong>dnslookup<\/strong>) \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 (\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 <strong>local_sender_host<\/strong>):<\/p>\n<p><code>dnslookup_local:<br \/>\ndriver = dnslookup<br \/>\ndomains = ! +local_domains<br \/>\ntransport = remote_smtp<br \/>\nignore_target_hosts = 0.0.0.0 : 127.0.0.0\/8<br \/>\nno_more<br \/>\nheaders_add = From: ${extract{name}{${lookup{$sender_address_local_part}lsearch{\/etc\/exim4\/sender.txt}}}} &lt;${extract{email}{${lookup{$sender_address_local_part}lsearch{\/etc\/exim4\/sender.txt}}}}&gt;<br \/>\nheaders_remove = From<br \/>\ncondition = ${if match_ip{$sender_host_address}{+local_sender_host}{yes}}<\/code><\/p>\n<p>\u0433\u0434\u0435 \u0444\u0430\u0439\u043b <strong>\/etc\/exim4\/sender.txt<\/strong> \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434:<\/p>\n<p><code>nginx: name=\"Web user\" email=sales@domain.com<\/code><\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435: <strong>nginx<\/strong> &#8211; \u0438\u043c\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044e\u0437\u0435\u0440\u0430, \u0430 <strong>name\/email<\/strong> &#8211; \u044d\u0442\u043e \u0442\u043e, \u043d\u0430 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a (\u0442\u043e, \u0447\u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430\u0442 \u043f\u0438\u0441\u044c\u043c\u0430)<\/p>\n<p><span style=\"color: #ff6600;\"><em><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong><\/em><\/span><\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430, \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0432\u044b\u0432\u043e\u0434 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u044b <strong>\/tmp\/testX<\/strong>):<\/p>\n<p><code># exim -bv -v -d+all -bh 127.0.0.1 user@yandex.ru &gt;\/tmp\/test1 2&gt;&amp;1<br \/>\n# exim -bv -v -d+all -bh 1.1.1.1\u00a0user@yandex.ru &gt;\/tmp\/test2 2&gt;&amp;1<\/code><\/p>\n<p>\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u043e\u0443\u0442\u0435\u0440\u0430 <strong>dnslookup_local<\/strong> \u0438 <strong>dnslookup<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0434\u0435\u043b\u0430\u0442\u044c rewrite \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441 \u043a\u0430\u043a\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0438\u0434\u0451\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: &#8211; \u0435\u0441\u043b\u0438 IP \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e localhost), \u0442\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u0435 From \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 &#8211; \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043d\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e local_sender_host \u0438 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043d\u0435\u0451 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 IP. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-4435","post","type-post","status-publish","format-standard","hentry","category-mail"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4435"}],"version-history":[{"count":3,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4435\/revisions"}],"predecessor-version":[{"id":4438,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4435\/revisions\/4438"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}