From 79c47dbf0a6fbe108fbf604ce695582910eef8fc Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 11:21:25 -0400 Subject: [PATCH 01/16] list-remote-forwards.cabal: update for newer cabal and ghc-9.x. --- list-remote-forwards.cabal | 96 +++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 42 deletions(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index 08f3c98..eae777b 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -1,9 +1,9 @@ +cabal-version: 3.0 name: list-remote-forwards version: 0.0.1 -cabal-version: >= 1.8 author: Michael Orlitzky maintainer: Michael Orlitzky -license: AGPL-3 +license: AGPL-3.0-only license-file: doc/LICENSE bug-reports: mailto:michael@orlitzky.com category: Mail, Utils @@ -16,125 +16,125 @@ synopsis: List all remote forwards for mail accounts stored in a SQL database. description: /Usage/: - . + @ list-remote-forwards [OPTIONS] @ - . + List all remote forwards for mail accounts stored in a SQL database. - . + A list of local domains is supplied to the program (more or less) through the @--domain-query@ option. Any addresses which forward to another address not contained in this list of local domains is considered a remote forward. Remote forwards can cause problems for a number of reasons, the most common of which are, - . + * If the sender has an SPF record authorizing his mail server to send mail on his behalf, then when his message is forwarded by the recipient's mail server, it will fail any subsequent SPF checks. This will likely cause the message to be rejected, and the original recipient's server will generate backscatter. - . + * If any spam makes it through the filter on the recipient's mail server, that spam will then be forwarded to a remote destination. The remote destination will blame the forwarding server for the spam, and that can impact its reputation and potentially lead to a blacklisting even though the spam did not originate on the recipient's server. - . + Whether or not these are an issue depends on the circumstances, but in any case it is useful to know who is forwarding mail off-site. - . + /Input:/ - . + None. - . + /Output:/ - . + A list of addresses that are forwarded to remote domains. - . + /Options/: - . + @ \--database @ - . + The name of the database (or file, if SQLite) to which we should connect. - . + Default: The name of the current user (Postgres only). - . + @ \--domain-query @ SQL query used to produce a list of local domains. This should return the set of all domains (i.e one column) that are local to the server. See the default value for an example. - . + Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY domain;\" - . + @ \--exclude-mx, -e @ - . + The name of a mail exchanger, the forwards of whose domains we should ignore. For example, if one mail exchanger, mx1.example.com, has strict spam filtering, it may be acceptable to have remote forwarding for domains that have mx1.example.com as their sole mail exchanger (MX record). In that case, you might want to exclude those domains from the report by naming mx1.example.com here. - . + A forward will be excluded from the report only if /all/ of its MX records are contained in the given exclude list. - . + This option can be repeated to add mail exchangers to the exclude list. - . + Default: [] (empty) - . + @ \--forward-query, -f @ - . + SQL query used to produce a list of all forwards on the mail system. This query should return the set of all (address, goto) triples, where \"goto\" is the destination address; i.e. to where the \"address\" forwards. The \"goto\" field may contain more than one email address, separated by commas. - . + Default: \"SELECT address,goto FROM alias ORDER BY address;\" - . + @ \--host, -h @ - . + Hostname where the database is located (Postgres-only). - . + Default: None, a UNIX domain socket connection is attempted (Postgres only) - . + @ \--password @ - . + Password used to connect to the database (Postgres-only). - . + Default: None (assumes passwordless authentication) - . + @ \--port @ Port number used to connect to the database (Postgres-only). - . + Default: None, a UNIX domain socket connection is attempted (Postgres only) - . + @ \--username, -u @ - . + Username used to connect to the database (Postgres-only). - . + Default: The current user - . + /Examples/: - . + @ $ list-remote-forwards --database=test\/fixtures\/postfixadmin.sqlite3 user1@example.com -> user1@example.net @@ -146,7 +146,7 @@ description: executable list-remote-forwards build-depends: - base >= 4.6 && < 5, + base >= 4.15 && < 5, bytestring >= 0.10, cmdargs >= 0.10, configurator >= 0.2, @@ -160,6 +160,10 @@ executable list-remote-forwards MissingH >= 1.2, tasty >= 0.8, tasty-hunit >= 0.8 + + default-language: + Haskell2010 + main-is: Main.hs @@ -177,9 +181,13 @@ executable list-remote-forwards Report String + autogen-modules: + Paths_list_remote_forwards + test-suite testsuite type: exitcode-stdio-1.0 hs-source-dirs: src test + default-language: Haskell2010 main-is: TestSuite.hs other-modules: @@ -191,8 +199,11 @@ test-suite testsuite Paths_list_remote_forwards Report + autogen-modules: + Paths_list_remote_forwards + build-depends: - base >= 4.6 && < 5, + base >= 4.15 && < 5, bytestring >= 0.10, cmdargs >= 0.10, configurator >= 0.2, @@ -209,9 +220,10 @@ test-suite testsuite test-suite doctests type: exitcode-stdio-1.0 hs-source-dirs: test + default-language: Haskell2010 main-is: Doctests.hs build-depends: - base == 4.*, + base >= 4.15 && < 5, -- Additional test dependencies. doctest >= 0.9, filemanip >= 0.3.6 -- 2.43.2 From 1cd1070a7269645f62175c1d9bad905676888642 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 11:23:10 -0400 Subject: [PATCH 02/16] test/Doctests.hs: remove code for older cabals. --- test/Doctests.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/Doctests.hs b/test/Doctests.hs index eb8b671..0041367 100644 --- a/test/Doctests.hs +++ b/test/Doctests.hs @@ -10,7 +10,4 @@ find_sources = find always (extension ==? ".hs") "src/" main :: IO () main = do sources <- find_sources - doctest $ ["-isrc", - "-idist/build/autogen", -- old cabal - "-idist/build/list-remote-forwards/autogen" -- new cabal - ] ++ sources + doctest $ ["-isrc", "-idist/build/list-remote-forwards/autogen" ] ++ sources -- 2.43.2 From 73a63f039563d0a417e1ffd3e7e1b88db26b475e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 11:23:30 -0400 Subject: [PATCH 03/16] list-remote-forwards.cabal: update to v0.0.2. --- list-remote-forwards.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index eae777b..f78f6b2 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: list-remote-forwards -version: 0.0.1 +version: 0.0.2 author: Michael Orlitzky maintainer: Michael Orlitzky license: AGPL-3.0-only -- 2.43.2 From 3162fcab26da67c5b0169e552e7de74aef92101c Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 11:54:50 -0400 Subject: [PATCH 04/16] list-remote-forwards.cabal: improve haddock docs layout. --- list-remote-forwards.cabal | 100 +++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 55 deletions(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index f78f6b2..bbf73d2 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -54,84 +54,74 @@ description: /Options/: - @ - \--database - @ + * \--database - The name of the database (or file, if SQLite) to which we should - connect. + The name of the database (or file, if SQLite) to which we should + connect. - Default: The name of the current user (Postgres only). + Default: The name of the current user (Postgres only). - @ - \--domain-query - @ - SQL query used to produce a list of local domains. This should return - the set of all domains (i.e one column) that are local to the - server. See the default value for an example. + * \--domain-query - Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY domain;\" + SQL query used to produce a list of local domains. This should + return the set of all domains (i.e one column) that are local to the + server. See the default value for an example. - @ - \--exclude-mx, -e - @ + Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY + domain;\" - The name of a mail exchanger, the forwards of whose domains we should - ignore. For example, if one mail exchanger, mx1.example.com, has - strict spam filtering, it may be acceptable to have remote forwarding - for domains that have mx1.example.com as their sole mail exchanger (MX - record). In that case, you might want to exclude those domains from - the report by naming mx1.example.com here. + * \--exclude-mx, -e - A forward will be excluded from the report only if /all/ of its MX - records are contained in the given exclude list. + The name of a mail exchanger, the forwards of whose domains we + should ignore. For example, if one mail exchanger, + mx1.example.com, has strict spam filtering, it may be acceptable + to have remote forwarding for domains that have mx1.example.com + as their sole mail exchanger (MX record). In that case, you + might want to exclude those domains from the report by naming + mx1.example.com here. - This option can be repeated to add mail exchangers to the exclude list. + A forward will be excluded from the report only if /all/ of its MX + records are contained in the given exclude list. - Default: [] (empty) + This option can be repeated to add mail exchangers to the exclude list. - @ - \--forward-query, -f - @ + Default: [] (empty) - SQL query used to produce a list of all forwards on the mail - system. This query should return the set of all (address, goto) - triples, where \"goto\" is the destination address; i.e. to where - the \"address\" forwards. The \"goto\" field may contain more - than one email address, separated by commas. + * \--forward-query, -f - Default: \"SELECT address,goto FROM alias ORDER BY address;\" + SQL query used to produce a list of all forwards on the mail + system. This query should return the set of all (address, goto) + triples, where \"goto\" is the destination address; i.e. to + where the \"address\" forwards. The \"goto\" field may contain + more than one email address, separated by commas. - @ - \--host, -h - @ + Default: \"SELECT address,goto FROM alias ORDER BY address;\" - Hostname where the database is located (Postgres-only). + * \--host, -h - Default: None, a UNIX domain socket connection is attempted (Postgres only) + Hostname where the database is located (Postgres-only). - @ - \--password - @ + Default: None, a UNIX domain socket connection is attempted + (Postgres only) - Password used to connect to the database (Postgres-only). + * \--password - Default: None (assumes passwordless authentication) + Password used to connect to the database (Postgres-only). - @ - \--port - @ - Port number used to connect to the database (Postgres-only). + Default: None (assumes passwordless authentication) - Default: None, a UNIX domain socket connection is attempted (Postgres only) + * \--port - @ - \--username, -u - @ + Port number used to connect to the database (Postgres-only). + + Default: None, a UNIX domain socket connection is attempted + (Postgres only) + + * \--username, -u - Username used to connect to the database (Postgres-only). + Username used to connect to the database (Postgres-only). - Default: The current user + Default: The current user /Examples/: -- 2.43.2 From 41e747eb6c845d176f6603d481ed49fe918dbfab Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 12:55:09 -0400 Subject: [PATCH 05/16] makefile: fix "make doc" by adding a .PHONY. --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 2212e31..98b36c3 100644 --- a/makefile +++ b/makefile @@ -16,7 +16,7 @@ HCFLAGS += -Weverything \ -rtsopts \ -threaded -.PHONY : dist hlint +.PHONY : doc dist hlint $(BIN): $(PN).cabal $(SRCS) runghc Setup.hs configure --user -- 2.43.2 From e7661386b8bae63bbe9da2ae5d0938f21caf7427 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 12:55:29 -0400 Subject: [PATCH 06/16] list-remote-forwards.cabal: update to v0.0.3. --- list-remote-forwards.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index bbf73d2..4ef1a9b 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: list-remote-forwards -version: 0.0.2 +version: 0.0.3 author: Michael Orlitzky maintainer: Michael Orlitzky license: AGPL-3.0-only -- 2.43.2 From e464e0e4b1da6e3b5911930efdfbe4fc58000ce3 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:18:57 -0400 Subject: [PATCH 07/16] makefile: disable -Wmissing-kind-signatures This requires GHC extensions to fix. --- makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile b/makefile index 98b36c3..b5cb21b 100644 --- a/makefile +++ b/makefile @@ -13,6 +13,7 @@ HCFLAGS += -Weverything \ -Wno-prepositive-qualified-module \ -Wno-missing-safe-haskell-mode \ -Wno-missing-deriving-strategies \ + -Wno-missing-kind-signatures \ -rtsopts \ -threaded -- 2.43.2 From 69b2efc97c7803e1d97a381dd2996ae70f4d9c70 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:26:30 -0400 Subject: [PATCH 08/16] list-remote-forwards.cabal: fix maintainer whitespace --- list-remote-forwards.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index 4ef1a9b..f19f286 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -2,7 +2,7 @@ cabal-version: 3.0 name: list-remote-forwards version: 0.0.3 author: Michael Orlitzky -maintainer: Michael Orlitzky +maintainer: Michael Orlitzky license: AGPL-3.0-only license-file: doc/LICENSE bug-reports: mailto:michael@orlitzky.com -- 2.43.2 From 161e4d52351fb94956d81d92849c03b0b8ef2e9e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:28:08 -0400 Subject: [PATCH 09/16] list-remote-forwards.cabal: http -> https --- list-remote-forwards.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index f19f286..a6158b3 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -220,5 +220,5 @@ test-suite doctests source-repository head type: git - location: http://gitweb.michael.orlitzky.com/list-remote-forwards.git + location: https://gitweb.michael.orlitzky.com/list-remote-forwards.git branch: master -- 2.43.2 From 0b6cd6e1fd4599f00f94cb03e06b954aeef03cf0 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:28:21 -0400 Subject: [PATCH 10/16] list-remote-forwards.cabal: add a homepage --- list-remote-forwards.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index a6158b3..c84b856 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -3,6 +3,7 @@ name: list-remote-forwards version: 0.0.3 author: Michael Orlitzky maintainer: Michael Orlitzky +homepage: https://michael.orlitzky.com/code/list-remote-forwards.xhtml license: AGPL-3.0-only license-file: doc/LICENSE bug-reports: mailto:michael@orlitzky.com -- 2.43.2 From 64e7141055b184c61ba28326e87266a931fc7625 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:29:41 -0400 Subject: [PATCH 11/16] doc/COPYING,list-remote-forwards.cabal: switch to AGPL-3.0-or-later --- doc/COPYING | 15 +++++++++++++++ list-remote-forwards.cabal | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 doc/COPYING diff --git a/doc/COPYING b/doc/COPYING new file mode 100644 index 0000000..bdda28d --- /dev/null +++ b/doc/COPYING @@ -0,0 +1,15 @@ +list-remote-forwards: keep tabs on remote forwards in your MTA +Copyright (C) 2024 Michael Orlitzky + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index c84b856..2ff391d 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -4,12 +4,13 @@ version: 0.0.3 author: Michael Orlitzky maintainer: Michael Orlitzky homepage: https://michael.orlitzky.com/code/list-remote-forwards.xhtml -license: AGPL-3.0-only +license: AGPL-3.0-or-later license-file: doc/LICENSE bug-reports: mailto:michael@orlitzky.com category: Mail, Utils build-type: Simple extra-source-files: + doc/COPYING doc/list-remote-forwardsrc.example doc/man1/list-remote-forwards.1 test/fixtures/postfixadmin.sqlite3 -- 2.43.2 From 20c22c8578a613f6269e7b78f41a701230ccc12d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:31:34 -0400 Subject: [PATCH 12/16] list-remote-forwards.cabal: bump to version 0.0.4 --- list-remote-forwards.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index 2ff391d..52b2b3d 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: list-remote-forwards -version: 0.0.3 +version: 0.0.4 author: Michael Orlitzky maintainer: Michael Orlitzky homepage: https://michael.orlitzky.com/code/list-remote-forwards.xhtml -- 2.43.2 From 299fc3d5e87253e39220833d0302055abd48a173 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Apr 2024 21:49:06 -0400 Subject: [PATCH 13/16] list-remote-forwards.cabal: fix triples -> pairs --- list-remote-forwards.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index 52b2b3d..53dfcd9 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -93,7 +93,7 @@ description: SQL query used to produce a list of all forwards on the mail system. This query should return the set of all (address, goto) - triples, where \"goto\" is the destination address; i.e. to + pairs, where \"goto\" is the destination address; i.e. to where the \"address\" forwards. The \"goto\" field may contain more than one email address, separated by commas. -- 2.43.2 From f8044bf9cce5af9b40be8d77650b51a2a58c5639 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 24 Apr 2024 06:54:56 -0400 Subject: [PATCH 14/16] doc/man1/list-remote-forwards.1: mention the configuration file --- doc/man1/list-remote-forwards.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/man1/list-remote-forwards.1 b/doc/man1/list-remote-forwards.1 index 77eec6e..39042e3 100644 --- a/doc/man1/list-remote-forwards.1 +++ b/doc/man1/list-remote-forwards.1 @@ -93,6 +93,16 @@ Username used to connect to the database (Postgres-only). Default: The current user +.SH CONFIGURATION FILE + +Any of the options above can be placed in a configuration file rather +than passed on the command line. An example config file +\fIdoc/list-remote-forwardsrc.example\fR is included with the +source. You can edit it and rename it to either +\fI$sysconfdir/list-remote-forwardsrc\fR or +\fI~/.list-remote-forwardsrc\fR. The variable \fI$sysconfdir\fR is +determined at build time and is typically \fI/etc\fR on UNIX systems. + .SH EXAMPLES .nf -- 2.43.2 From f5a559d5a48434aa9fba4792730c4b71c727d1d2 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 24 Apr 2024 06:58:04 -0400 Subject: [PATCH 15/16] doc/man1/list-remote-forwards.1: reword the first paragraph --- doc/man1/list-remote-forwards.1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/man1/list-remote-forwards.1 b/doc/man1/list-remote-forwards.1 index 39042e3..851cd60 100644 --- a/doc/man1/list-remote-forwards.1 +++ b/doc/man1/list-remote-forwards.1 @@ -15,10 +15,10 @@ A list of addresses that are forwarded to remote domains. .SH DESCRIPTION .P A list of local domains is supplied to the program (more or less) -through the \fI\-\-domain\-query\fR option. Any addresses which -forward to another address not contained in this list of local domains -is considered a remote forward. Remote forwards can cause problems for -a number of reasons, the most common of which are, +through the \fI\-\-domain\-query\fR option. Any addresses in the list +that forward to an address \fBnot\fR in the list are considered remote +forwards. Remote forwards can cause problems for a number of reasons, +the most common of which are, .IP \(bu 2 If the sender has an SPF record authorizing his mail server to send mail on his behalf, then when his message is forwarded by the @@ -47,7 +47,8 @@ SQL query used to produce a list of local domains. This should return the set of all domains (i.e one column) that are local to the server. See the default value for an example. -Default: \(dqSELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY domain;\(dq +Default: \(dqSELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY +domain;\(dq .IP \fB\-\-exclude-mx\fR,\ \fB-e\fR The name of a mail exchanger, the forwards of whose domains we should -- 2.43.2 From 7dbe05ca7729033af623c37f64d994626eec850e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 24 Apr 2024 06:59:59 -0400 Subject: [PATCH 16/16] list-remote-forwards.cabal: delete the redundant description I'm tired of maintaining this. --- list-remote-forwards.cabal | 121 +------------------------------------ 1 file changed, 3 insertions(+), 118 deletions(-) diff --git a/list-remote-forwards.cabal b/list-remote-forwards.cabal index 53dfcd9..e9a239f 100644 --- a/list-remote-forwards.cabal +++ b/list-remote-forwards.cabal @@ -17,124 +17,9 @@ extra-source-files: synopsis: List all remote forwards for mail accounts stored in a SQL database. description: - /Usage/: - - @ - list-remote-forwards [OPTIONS] - @ - - List all remote forwards for mail accounts stored in a SQL database. - - A list of local domains is supplied to the program (more or less) - through the @--domain-query@ option. Any addresses which - forward to another address not contained in this list of local domains - is considered a remote forward. Remote forwards can cause problems for - a number of reasons, the most common of which are, - - * If the sender has an SPF record authorizing his mail server to send - mail on his behalf, then when his message is forwarded by the - recipient's mail server, it will fail any subsequent SPF checks. This - will likely cause the message to be rejected, and the original - recipient's server will generate backscatter. - - * If any spam makes it through the filter on the recipient's mail - server, that spam will then be forwarded to a remote destination. The - remote destination will blame the forwarding server for the spam, and - that can impact its reputation and potentially lead to a blacklisting - even though the spam did not originate on the recipient's server. - - Whether or not these are an issue depends on the circumstances, but in - any case it is useful to know who is forwarding mail off-site. - - /Input:/ - - None. - - /Output:/ - - A list of addresses that are forwarded to remote domains. - - /Options/: - - * \--database - - The name of the database (or file, if SQLite) to which we should - connect. - - Default: The name of the current user (Postgres only). - - * \--domain-query - - SQL query used to produce a list of local domains. This should - return the set of all domains (i.e one column) that are local to the - server. See the default value for an example. - - Default: \"SELECT domain FROM domain WHERE domain <> 'ALL' ORDER BY - domain;\" - - * \--exclude-mx, -e - - The name of a mail exchanger, the forwards of whose domains we - should ignore. For example, if one mail exchanger, - mx1.example.com, has strict spam filtering, it may be acceptable - to have remote forwarding for domains that have mx1.example.com - as their sole mail exchanger (MX record). In that case, you - might want to exclude those domains from the report by naming - mx1.example.com here. - - A forward will be excluded from the report only if /all/ of its MX - records are contained in the given exclude list. - - This option can be repeated to add mail exchangers to the exclude list. - - Default: [] (empty) - - * \--forward-query, -f - - SQL query used to produce a list of all forwards on the mail - system. This query should return the set of all (address, goto) - pairs, where \"goto\" is the destination address; i.e. to - where the \"address\" forwards. The \"goto\" field may contain - more than one email address, separated by commas. - - Default: \"SELECT address,goto FROM alias ORDER BY address;\" - - * \--host, -h - - Hostname where the database is located (Postgres-only). - - Default: None, a UNIX domain socket connection is attempted - (Postgres only) - - * \--password - - Password used to connect to the database (Postgres-only). - - Default: None (assumes passwordless authentication) - - * \--port - - Port number used to connect to the database (Postgres-only). - - Default: None, a UNIX domain socket connection is attempted - (Postgres only) - - * \--username, -u - - Username used to connect to the database (Postgres-only). - - Default: The current user - - /Examples/: - - @ - $ list-remote-forwards --database=test\/fixtures\/postfixadmin.sqlite3 - user1@example.com -> user1@example.net - user2@example.com -> user1@example.org - user2@example.com -> user2@example.org - user2@example.com -> user3@example.org - user7@example.com -> user8@example.net - @ + List all remote forwards for mail accounts stored in a SQL + database. A description, options, and examples can be found in the + man page. executable list-remote-forwards build-depends: -- 2.43.2