Here are a bit more refinements.

Currently, empty smarthost string to disable old style smarthost causes
dpkg-reconfigure dialogue to generate automatic default string.  A bit
annoyance ...

Osamu
>From b3fcf04656319c1210b32ee046c4d94c6abacfff Mon Sep 17 00:00:00 2001
From: Osamu Aoki <[email protected]>
Date: Sun, 30 Jul 2017 13:32:37 +0900
Subject: [PATCH 1/3] submission removes Received header

If using submission port with the account based authentication, let's not
expose unnecessary internal info of the local exim running on the desktop
machine.  Let's keep the mail header sent to the submission host to be just
like what happens with Thunderbird MUA connecting to the submission port.
---
 debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission b/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission
index 5b485c8..f019e17 100644
--- a/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission
+++ b/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission
@@ -8,6 +8,7 @@ remote_smtp_submission:
   port = 587
   hosts_require_auth = *
   hosts_require_tls = *
+  headers_remove = Received
 .ifdef REMOTE_SMTP_HEADERS_REWRITE
   headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
 .endif
-- 
2.11.0

>From 28270442a220a7c036b9b86c451d3f4c2e4f0462 Mon Sep 17 00:00:00 2001
From: Osamu Aoki <[email protected]>
Date: Sun, 30 Jul 2017 13:54:03 +0900
Subject: [PATCH 2/3] Disable old style smarthost if empty

---
 debian/debconf/conf.d/router/200_exim4-config_primary | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/debconf/conf.d/router/200_exim4-config_primary b/debian/debconf/conf.d/router/200_exim4-config_primary
index 88e5d5d..58e8407 100644
--- a/debian/debconf/conf.d/router/200_exim4-config_primary
+++ b/debian/debconf/conf.d/router/200_exim4-config_primary
@@ -94,6 +94,7 @@ submission:
 smarthost:
   debug_print = "R: smarthost for $local_part@$domain"
   driver = manualroute
+  condition =  ${if !eq{DCsmarthost}{}}
   domains = ! +local_domains
   transport = remote_smtp_smarthost
   route_list = * DCsmarthost byname
-- 
2.11.0

>From bb18897cffe688f61c731bea305065219734ef97 Mon Sep 17 00:00:00 2001
From: Osamu Aoki <[email protected]>
Date: Sun, 30 Jul 2017 13:55:26 +0900
Subject: [PATCH 3/3] Adjustable submission port

---
 .../transport/30_exim4-config_remote_smtp_submission       |  5 ++++-
 debian/passwd.client                                       | 14 +++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission b/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission
index f019e17..c5e8f9c 100644
--- a/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission
+++ b/debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_submission
@@ -2,10 +2,13 @@
 ### transport/30_exim4-config_remote_smtp_submission
 #################################
 
+# default submission port is 587
+SUBMISSIONPORT = ${listextract{4}{${lookup{${address:$h_from:}}lsearch{CONFDIR/passwd.client}{$value}fail}}{$value}{587}}
+
 remote_smtp_submission:
   debug_print = "T: remote_smtp_submission for $local_part@$domain"
   driver = smtp
-  port = 587
+  port = SUBMISSIONPORT
   hosts_require_auth = *
   hosts_require_tls = *
   headers_remove = Received
diff --git a/debian/passwd.client b/debian/passwd.client
index 1157975..2208d53 100644
--- a/debian/passwd.client
+++ b/debian/passwd.client
@@ -4,14 +4,22 @@
 # see exim4_passwd_client(5) for more documentation
 #
 # Example:
-# Use message submission port 578 for each "From:" email account
-#      (4 data list, Good for services like gmail)
+########################################################################################
+# Use message submission port (default 587) for each "From:" email account
+#      (4 or 5 data list, Good for services like gmail)
 ### [email protected]:login:password:submission.host.example
+# or to use an alternative submission port
+### [email protected]:login:password:submission.host.example:submission-port
+#
 ### [email protected]:[email protected]:<application_password>:smtp.gmail.com
+# or to use port 25
+### [email protected]:[email protected]:<application_password>:smtp.gmail.com:25
 #
-# Use a smarthost for all "From:" email accounts (wildcard accepted)
+########################################################################################
+# Use one smarthost for all "From:" email accounts (wildcard accepted)(old style)
 #      (3 data list, Good for most connection ISP provided SMTP servers.)
 #      (Need to specify submission port as ::587 if not port 25)
+#      If null string is set as smarthost, this is not active.
 ### target.mail.server.example:login:password
 ###*.so-net.ne.jp:[email protected]::587:secret
 
-- 
2.11.0

Reply via email to