The list-remote-forwards package

[ Tags: gpl, mail, program, utils ] [ Propose Tags ]


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,

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.




A list of addresses that are forwarded to remote domains.



The name of the database (or file, if SQLite) to which we should connect.

Default: The name of the current user (Postgres only).


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,, has strict spam filtering, it may be acceptable to have remote forwarding for domains that have as their sole mail exchanger (MX record). In that case, you might want to exclude those domains from the report by naming 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 used to connect to the database (Postgres-only).

Default: None (assumes passwordless authentication)


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


$ list-remote-forwards --database=testfixturespostfixadmin.sqlite3 -> -> -> -> ->


Versions 0.0.1
Dependencies base (>=4.6 && <5), bytestring (>=0.10), cmdargs (>=0.10), configurator (>=0.2), containers (>=0.5), directory (>=1.2), dns (>=1.4), filepath (>=1.3), HDBC (>=2.4), HDBC-postgresql (>=2.3), HDBC-sqlite3 (>=2.3), MissingH (>=1.2), tasty (>=0.8), tasty-hunit (>=0.8), tasty-quickcheck (>=0.8) [details]
License GPL-3
Author Michael Orlitzky
Maintainer Michael Orlitzky <>
Category Mail, Utils
Bug tracker
Source repo head: git clone -b master
Uploaded Fri Nov 28 19:58:03 UTC 2014 by MichaelOrlitzky
Distributions NixOS:0.0.1
Executables list-remote-forwards
Downloads 399 total (9 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2016-12-12 [all 7 reports]
Hackage Matrix CI


Maintainer's Corner

For package maintainers and hackage trustees