Bug#251949: exim4-config: patch to allow a port to be specified with smarthost

Jö Fahlke Jö Fahlke , 251949@bugs.debian.org
Sat, 31 Jul 2004 14:39:33 +0200


--pvezYHf7grwyp3Bc
Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk"
Content-Disposition: inline


--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: exim4-config
Version: 4.34-4
Followup-For: Bug #251949

Hi!

I have to use a ssh tunnel for my outgoing smtp connections.

Here is a patch to make update-exim4.conf accept a smarthost of the
form "<host>:<port>", even allowing "localhost:<port>" (if <port> is
not "smtp").

J=F6.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-k7
Locale: LANG=3Dde_DE.UTF-8, LC_CTYPE=3Dde_DE.UTF-8

--=20
Der Horizont vieler Menschen ist ein Kreis mit Radius Null - und das
nennen sie ihren Standpunkt.
-- A. Einstein

--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename="smartport.diff"
Content-Transfer-Encoding: quoted-printable

diff -ur exim4-4.34.debian/debian/debconf/conf.d/main/01_exim4-config_listm=
acrosdefs exim4-4.34.smartport/debian/debconf/conf.d/main/01_exim4-config_l=
istmacrosdefs
--- exim4-4.34.debian/debian/debconf/conf.d/main/01_exim4-config_listmacros=
defs	2004-07-31 14:19:24.000000000 +0200
+++ exim4-4.34.smartport/debian/debconf/conf.d/main/01_exim4-config_listmac=
rosdefs	2004-07-31 14:18:52.000000000 +0200
@@ -52,6 +52,8 @@
 #for satellite and smarthost-systems
 .ifndef DCsmarthost
 DCsmarthost =3D DEBCONFsmarthostDEBCONF
+DEBCONFsmartportDEBCONF
+DEBCONFallow_local_smarthostDEBCONF
 .endif
=20
 # listen on all all interfaces?
diff -ur exim4-4.34.debian/debian/debconf/conf.d/router/200_exim4-config_pr=
imary exim4-4.34.smartport/debian/debconf/conf.d/router/200_exim4-config_pr=
imary
--- exim4-4.34.debian/debian/debconf/conf.d/router/200_exim4-config_primary=
	2004-07-31 14:19:24.000000000 +0200
+++ exim4-4.34.smartport/debian/debconf/conf.d/router/200_exim4-config_prim=
ary	2004-07-31 14:18:52.000000000 +0200
@@ -80,6 +80,9 @@
   route_list =3D * DCsmarthost byname
   host_find_failed =3D defer
   same_domain_copy_routing =3D yes
+.ifdef DCallow_local_smarthost
+  self =3D send
+.endif
   no_more
=20
 .endif
diff -ur exim4-4.34.debian/debian/debconf/conf.d/transport/30_exim4-config_=
remote_smtp_smarthost exim4-4.34.smartport/debian/debconf/conf.d/transport/=
30_exim4-config_remote_smtp_smarthost
--- exim4-4.34.debian/debian/debconf/conf.d/transport/30_exim4-config_remot=
e_smtp_smarthost	2004-07-31 14:19:24.000000000 +0200
+++ exim4-4.34.smartport/debian/debconf/conf.d/transport/30_exim4-config_re=
mote_smtp_smarthost	2004-07-31 14:18:52.000000000 +0200
@@ -12,5 +12,11 @@
   driver =3D smtp
   hosts_try_auth =3D ${if exists {CONFDIR/passwd.client}{DCsmarthost}{}}
   tls_tempfail_tryclear =3D false
+.ifdef DCsmartport
+  port =3D DCsmartport
+.endif
+.ifdef DCallow_local_smarthost
+  allow_localhost
+.endif
   DEBCONFheaders_rewriteDEBCONF
   DEBCONFreturn_pathDEBCONF
diff -ur exim4-4.34.debian/debian/debconf/update-exim4.conf exim4-4.34.smar=
tport/debian/debconf/update-exim4.conf
--- exim4-4.34.debian/debian/debconf/update-exim4.conf	2004-07-31 14:19:24.=
000000000 +0200
+++ exim4-4.34.smartport/debian/debconf/update-exim4.conf	2004-07-31 14:18:=
52.000000000 +0200
@@ -251,6 +251,24 @@
 		DEBCONFheaders_rewriteDEBCONF=3D'headers_rewrite =3D *@+local_domains $1=
@DCreadhost frs'
 		DEBCONFreturn_pathDEBCONF=3D'return_path =3D ${if match_domain{$sender_a=
ddress_domain}{+local_domains}{${sender_address_local_part}@DCreadhost}fail=
}'
 	fi
+	case "$dc_smarthost" in
+		*:*)
+		dc_smartport=3D"${dc_smarthost##*:}"
+		dc_smarthost=3D"${dc_smarthost%:*}"
+		;;
+		*)
+		dc_smartport=3D""
+		;;
+	esac
+	if [ -n "${dc_smartport}" ] ; then
+		DEBCONFsmartportDEBCONF=3D"DCsmartport =3D $dc_smartport"
+	fi
+	case "$dc_smartport" in
+		""|25|smtp)
+		;;
+		*)
+		DEBCONFallow_local_smarthostDEBCONF=3D'DCallow_local_smarthost =3D '
+	esac
 	;;
 	local)
 	;;
@@ -324,6 +342,8 @@
 		-e "s=C4DEBCONFvisiblenameDEBCONF=C4${mailname}=C4g" \
 		-e "s=C4DEBCONFreadhostDEBCONF=C4${dc_readhost}=C4g" \
 		-e "s=C4DEBCONFsmarthostDEBCONF=C4${dc_smarthost}=C4g" \
+		-e "s=C4DEBCONFsmartportDEBCONF=C4${DEBCONFsmartportDEBCONF}=C4g" \
+		-e "s=C4DEBCONFallow_local_smarthostDEBCONF=C4${DEBCONFallow_local_smart=
hostDEBCONF}=C4g" \
 		-e "s=C4DEBCONFconfigtypeDEBCONF=C4${dc_eximconfig_configtype}=C4g" \
 		-e "s=C4DEBCONFlistenonpublicDEBCONF=C4${listenonpublic}=C4g" \
 		-e "s=C4DEBCONFpackageversionDEBCONF=C4${UPEX4C_version}=C4g" \
@@ -346,6 +366,8 @@
 		-e "s=C4DEBCONFvisiblenameDEBCONF=C4${mailname}=C4g" \
 		-e "s=C4DEBCONFreadhostDEBCONF=C4${dc_readhost}=C4g" \
 		-e "s=C4DEBCONFsmarthostDEBCONF=C4${dc_smarthost}=C4g" \
+		-e "s=C4DEBCONFsmartportDEBCONF=C4${DEBCONFsmartportDEBCONF}=C4g" \
+		-e "s=C4DEBCONFallow_local_smarthostDEBCONF=C4${DEBCONFallow_local_smart=
hostDEBCONF}=C4g" \
 		-e "s=C4DEBCONFconfigtypeDEBCONF=C4${dc_eximconfig_configtype}=C4g" \
 		-e "s=C4DEBCONFlistenonpublicDEBCONF=C4${listenonpublic}=C4g" \
 		-e "s=C4DEBCONFpackageversionDEBCONF=C4${UPEX4C_version}=C4g" \

--UugvWAfsgieZRqgk--

--pvezYHf7grwyp3Bc
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBC5MF9pw8d07v1OsRAkBfAJ9RYl9OkTUkGJFLVFnSQ3C/8RGf2ACgj6Ut
3+FIz4HfafPjIk2KZP8Rf1E=
=6TDg
-----END PGP SIGNATURE-----

--pvezYHf7grwyp3Bc--