<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=6102&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] exim4 to send mail with ISP-based smarthost]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=6102</link>
		<description><![CDATA[The most recent posts in [SOLVED] exim4 to send mail with ISP-based smarthost.]]></description>
		<lastBuildDate>Fri, 27 Oct 2023 10:04:32 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[[SOLVED] exim4 to send mail with ISP-based smarthost]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=45121#p45121</link>
			<description><![CDATA[<p>Maybe just as a reminder to myself and also due to some painful experiences I wanted to note some useful information for those who want their machine to be able to send mail from reportbug and popularity-contest.</p><p>My machine is on a dynamic IP address permanently connected via VDSL with the ISP providing a smarthost at mail.isp.domain (but reverse lookup of the IP address of mail.isp.domain results in a *.compute.amazonaws.com machine name).</p><p>I had a lot of grief until I set /etc/mailname to contain:</p><p>localhost</p><p>When the ISP moved mail.isp.domain from a machine whose IP address gave a reverse lookup of mail.isp.domain to a machine that gave a reverse lookup of some-name.amazonaws.com, it broke one of the exim4 assumptions:</p><p>the manual page for /etc/exim4/passwd.client, which is exim4_passwd_client (5) states:</p><p>/etc/exim4/passwd.client<br />&#160; &#160; &#160; &#160;contains account and password data for SMTP authentication when exim is<br />&#160; &#160; &#160; &#160;authenticating as a client to some remote server.</p><p>&#160; &#160; &#160; &#160;The file should contain lines of the form</p><p>&#160; &#160; &#160; &#160;target.mail.server.example:login-user-name:password</p><p>&#160; &#160; &#160; &#160;which&#160; will cause exim to use login-user-name and password when sending<br />&#160; &#160; &#160; &#160;messages&#160; to&#160; &#160;a&#160; &#160;server&#160; &#160;with&#160; &#160;the&#160; &#160;canonical&#160; &#160;host&#160; &#160;name&#160; &#160;tar‐<br />&#160; &#160; &#160; &#160;get.mail.server.example.&#160; &#160;Please note that this does not configure the<br />&#160; &#160; &#160; &#160;mail server to send to (this is determined in Debconf), but&#160; only&#160; cre‐<br />&#160; &#160; &#160; &#160;ates&#160; the&#160; correlation between host name and authentication credentials<br />&#160; &#160; &#160; &#160;to avoid exposing passwords to the wrong host.</p><p>&#160; &#160; &#160; &#160;Please note that target.mail.server.example is currently the value that<br />&#160; &#160; &#160; &#160;exim can read from reverse DNS: It first follows the host name&#160; of&#160; the<br />&#160; &#160; &#160; &#160;target&#160; system&#160; until it finds an IP address, and then looks up the re‐<br />&#160; &#160; &#160; &#160;verse DNS for that IP address to use the outcome of this query (or&#160; the<br />&#160; &#160; &#160; &#160;IP&#160; &#160;address&#160; &#160;itself&#160; &#160;should&#160; &#160;the&#160; &#160;query&#160; &#160;fail)&#160; &#160;as&#160; &#160;index&#160; into<br />&#160; &#160; &#160; &#160;/etc/exim4/passwd.client.</p><p>&#160; &#160; &#160; &#160;This goes inevitably wrong if the host name of the&#160; mail&#160; server&#160; is&#160; a<br />&#160; &#160; &#160; &#160;CNAME&#160; (a&#160; DNS&#160; alias),&#160; or the reverse lookup does not fit the forward<br />&#160; &#160; &#160; &#160;one.</p><p>&#160; &#160; &#160; &#160;Currently, you need to manually lookup all reverse DNS names for all IP<br />&#160; &#160; &#160; &#160;addresses that your SMTP server host name points to, for example by us‐<br />&#160; &#160; &#160; &#160;ing the host command.&#160; If the SMTP smarthost alias expands to&#160; multiple<br />&#160; &#160; &#160; &#160;IPs,&#160; you need to have multiple lines for all the hosts.&#160; When your ISP<br />&#160; &#160; &#160; &#160;changes the alias, you will need to manually fix that.</p><p>&#160; &#160; &#160; &#160;You may minimize this trouble by using a wild card entry or regular ex‐<br />&#160; &#160; &#160; &#160;pressions, thus reducing the risk of&#160; divulging&#160; the&#160; password&#160; to&#160; the<br />&#160; &#160; &#160; &#160;wrong&#160; SMTP server while reducing the number of necessary lines.&#160; For a<br />&#160; &#160; &#160; &#160;deeper discussion, see the Debian BTS #244724.</p><p>&#160; &#160; &#160; &#160;password is your SMTP password in clear text. If you do not know&#160; about<br />&#160; &#160; &#160; &#160;your&#160; SMTP&#160; password,&#160; you&#160; can try using your POP3 password as a first<br />&#160; &#160; &#160; &#160;guess.</p><p>&#160; &#160; &#160; &#160;This file must be readable for the Debian-exim user and should&#160; not&#160; be<br />&#160; &#160; &#160; &#160;readable for others. Recommended file mode is root:Debian-exim 640.</p><p>&#160; &#160; &#160; &#160;# example for CONFDIR/passwd.client<br />&#160; &#160; &#160; &#160;# this will only match if the server&#039;s generic name matches exactly<br />&#160; &#160; &#160; &#160;mail.server.example:user:password<br />&#160; &#160; &#160; &#160;# this will deliver the password to any server<br />&#160; &#160; &#160; &#160;*:username:password<br />&#160; &#160; &#160; &#160;# this will deliver the password to servers whose generic name ends in<br />&#160; &#160; &#160; &#160;# mail.server.example<br />&#160; &#160; &#160; &#160;*.mail.server.example:user:password<br />&#160; &#160; &#160; &#160;# this will deliver the password to servers whose generic name matches<br />&#160; &#160; &#160; &#160;# the regular expression<br />&#160; &#160; &#160; &#160;^smtp[0-9]*\.mail\.server\.example:user:password</p><p>In my case, I originally had:</p><p>mail.isp.domain:username@isp.domain:password</p><p>and added:</p><p>*.newhost.newdomain:username@isp.domain:password<br />*.compute.amazonaws.com:username@isp.comain:password</p><p>Hope this helps someone...</p>]]></description>
			<author><![CDATA[dummy@example.com (mirrortokyo)]]></author>
			<pubDate>Fri, 27 Oct 2023 10:04:32 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=45121#p45121</guid>
		</item>
	</channel>
</rss>
