Some of the options described below search directory structures for rDNS names. A directory structure is used because repeatedly searching a file full of domain names incurs a serious performance penalty. Querying the filesystem for the existance of a single file is very fast. Rule of thumb: if there are more than 100-200 entries in a file, consider switching to a directory structure instead.
To construct the directory path it uses, spamdyke takes the remote server's rDNS name, breaks it apart at the dots and reverses it using the following patterns:
The final filename is treated as a wildcard and matches any host that ends with the given name. For example, if the following file existed in the directory structure:
These directory and filenames can be constructed with the domain2path tool,
included with spamdyke. domain2path takes one rDNS name as an argument and
returns the correct path to that name. domain2path also accepts a flag,
which makes it only return the directories in the path. This is useful in
mkdir -p /PATH/TO/DIR/`domain2path -d FQDN`
touch /PATH/TO/DIR/`domain2path FQDN`
NOTE: The names of all the directories and files used in the directory structure must be lowercase or spamdyke will not match them. Unfortunately, searching a case sensitive filesystem in a case insensitive manner is not practical.