#######################################################
## Installation Instructions for the Prefix WhoIs plug-in for Rspamd
#######################################################

Requirements: Rspamd 3.x (tested with 3.8), outbound TCP to whois.pwhois.org
port 43 from the scanning hosts, python3 for the optional test script, and
optionally a Redis server for a shared lookup cache.  The plug-in is one
Lua file.

1. Install the plug-in, its module declaration and the sample configuration:

      make install

   or by hand:

      install -m 0644 src/pwhois.lua            /usr/share/rspamd/plugins/pwhois.lua
      install -m 0644 conf/modules.d/pwhois.conf /etc/rspamd/modules.d/pwhois.conf
      install -m 0644 conf/pwhois.conf           /etc/rspamd/local.d/pwhois.conf

   The modules.d file declares the module to Rspamd; without it the plug-in
   loads but stays disabled ("enabled but has not been configured").  An
   existing local.d/pwhois.conf is left alone.

2. Review /etc/rspamd/local.d/pwhois.conf.  Defaults: headers on, every
   symbol at score 0, per-worker memory cache, authenticated senders and
   private deliverers skipped, IPv4 connection to the server.  To share the
   cache across workers or hosts add a Redis line:

      servers = "127.0.0.1:6379";

3. Optionally give the symbols weight: merge conf/pwhois.group.conf into
   /etc/rspamd/local.d/groups.conf and adjust.

4. Check and reload:

      rspamadm configtest
      systemctl reload rspamd

5. Verify with the bundled fixture (or any message file):

      rspamc symbols --ip 8.8.8.8 test/fixtures/basic.eml

   PWHOIS appears in the symbol list with asn:, prefix: and cc: options;
   "rspamc --json" shows the X-PWhois-* headers under milter.add_headers.
   sh test/run.sh runs the same checks with assertions.

Postfix and Sendmail need nothing new: the Rspamd proxy worker in milter mode
(smtpd_milters = inet:localhost:11332 for Postfix) carries the headers back
to the MTA.  If you still run the Prefix WhoIs Milter (pwhois-milter), remove
it from the milter chain; running both duplicates the headers.

Daily allowance: Prefix WhoIs grants every address 5,000 queries a day by
default.  Higher limits: https://pwhois.org/contact/?contact=request
