-h, --help display this help and exit
--version output version information and exit
-v, --verbose increase verbosity level
--syslog-facility Syslog facility to use (default mail)
-q, --quiet decrease verbosity level
-u, --unix=PATH listen on unix socket PATH
-i, --inet=[HOST:]PORT listen on PORT, localhost if HOST is not specified
-d, --daemonize run in the background
--pidfile=PATH put daemon pid into this file
--user=USER run as USER (default: postgrey)
--group=GROUP run as group GROUP (default: postgrey)
--dbdir=PATH put db files in PATH (default: /var/lib/postgrey)
--delay=N greylist for N seconds (default: 300)
--max-age=N delete entries older than N days since the last time
that they have been seen (default: 35)
--retry-window=N allow only N days for the first retrial (default: 2)
append 'h' if you want to specify it in hours
--greylist-action=A if greylisted, return A to Postfix (default: DEFER_IF_PERMIT)
--greylist-text=TXT response when a mail is greylisted
(default: Greylisted + help url, see below)
--lookup-by-subnet strip the last 8 bits from IP addresses (default)
--lookup-by-host do not strip the last 8 bits from IP addresses
--privacy store data using one-way hash functions
--hostname=NAME set the hostname (default: `hostname`)
--exim don't reuse a socket for more than one query (exim compatible)
--whitelist-clients=FILE default: /etc/postgrey/whitelist_clients
--whitelist-recipients=FILE default: /etc/postgrey/whitelist_recipients
--auto-whitelist-clients=N whitelist host after first successful delivery
N is the minimal count of mails before a client is
whitelisted (turned on by default with value 5)
specify N=0 to disable.
--listen-queue-size=N allow for N waiting connections to our socket
Note that the --whitelist-x options can be specified multiple times,
and that per default /etc/postgrey/whitelist_clients.local and
/etc/postgrey/whitelist_recipients.local are also read, so that you can put
there local entries.
When a request for delivery of a mail is received by Postfix via SMTP, the triplet "CLIENT_IP" / "SENDER" / "RECIPIENT" is built. If it is the first time that this triplet is seen, or if the triplet was first seen less than delay seconds (300 is the default), then the mail gets rejected with a temporary error. Hopefully spammers or viruses will not try again later, as it is however required per RFC.
Note that you shouldn't use the --lookup-by-host option unless you know what you are doing: there are a lot of mail servers that use a pool of addresses to send emails, so that they can change IP every time they try again. That's why without this option postgrey will strip the last byte of the IP address when doing lookups in the database.
postgrey --inet=10023 -d
smtpd_recipient_restrictions =
permit_mynetworks
...
reject_unauth_destination
check_policy_service inet:127.0.0.1:10023
/etc/postgrey/whitelist_clients /etc/postgrey/whitelist_clients.local /etc/postgrey/whitelist_recipients /etc/postgrey/whitelist_recipients.local
You can specify alternative paths with the --whitelist-x options.
Postgrey whitelists follow similar syntax rules as Postfix access tables. The following can be specified for recipient addresses:
The following can be specified for client addresses:
By default, postgrey returns DEFER_IF_PERMIT, which causes postfix to check the rest of the restrictions and defer the message only if it would otherwise be accepted. A delay action of 451 causes postfix to always defer the message with an SMTP reply code of 451 (temp fail).
See the postfix manual page access(5) for a discussion of the actions allowed.
Greylisted, see http://postgrey.schweikert.ch/help/example.com.html
Usually no user should see that error message and the idea of that URL is to provide some help to system administrators seeing that message or users of broken mail clients which try to send mails directly and get a greylisting error. Note that the default help-URL contains the original recipient domain (example.com), so that domain-specific help can be presented to the user (on the default page it is said to contact postmaster@example.com)
You can change the text (and URL) with the --greylist-text parameter. The following special variables will be replaced in the text:
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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.