|
Qsmtp
0.23svn
|
headers of antispam helper functions More...
#include <sys/types.h>Go to the source code of this file.
Defines | |
| #define | SPF_NONE 0 |
| #define | SPF_PASS 1 |
| #define | SPF_NEUTRAL 2 |
| #define | SPF_SOFTFAIL 3 |
| #define | SPF_FAIL_PERM 4 |
| #define | SPF_FAIL_MALF 5 |
| #define | SPF_TEMP_ERROR 7 |
| #define | SPF_HARD_ERROR 8 |
| #define | SPF_IGNORE 15 |
| #define | SPF_FAIL(x) (((x) == SPF_FAIL_PERM) || ((x) == SPF_FAIL_MALF)) |
Functions | |
| void | dotip6 (char *) |
| int | check_rbl (char *const *, char **) |
| void | tarpit (void) |
| int | domainmatch (const char *fqdn, const size_t len, const char **list) |
| int | lookupipbl (int) |
| int | check_host (const char *) |
| int | spfreceived (int, const int) |
headers of antispam helper functions
| #define SPF_FAIL | ( | x | ) | (((x) == SPF_FAIL_PERM) || ((x) == SPF_FAIL_MALF)) |
check if one of the conditions is given to fail SPF policy
| #define SPF_FAIL_MALF 5 |
SPF entry is malformed
| #define SPF_FAIL_PERM 4 |
host is denied by SPF policy
| #define SPF_HARD_ERROR 8 |
permanent DNS error while SPF testing
| #define SPF_IGNORE 15 |
SPF policy for this host will not be tested
| #define SPF_NEUTRAL 2 |
host has neutral match in SPF policy
| #define SPF_NONE 0 |
no SPF policy given
| #define SPF_PASS 1 |
host matches SPF policy
| #define SPF_SOFTFAIL 3 |
host has softfail match in SPF policy
| #define SPF_TEMP_ERROR 7 |
temporary DNS error while SPF testing
| int check_host | ( | const char * | domain | ) |
look up SPF records for domain
This works a like the check_host in the SPF draft but takes two arguments less. The remote ip and the full sender address can be taken directly from xmitstat.
| domain | no idea what this might be for ;) |
| int check_rbl | ( | char *const * | rbls, |
| char ** | txt | ||
| ) |
do a rbl lookup for remoteip
| rbls | a NULL terminated array of rbls |
| txt | pointer to "char *" where the TXT record of the listing will be stored if existent |
| -1 | if not listed or error (if not listed errno is set to 0) |
If no match was found but temporary DNS errors were encountered errno is set to EAGAIN.
| int domainmatch | ( | const char * | fqdn, |
| const size_t | len, | ||
| const char ** | list | ||
| ) |
check if a given host name matches against domain list
| fqdn | hostname to check |
| len | length of fqdn |
| list | list of domains and hosts to check against, NULL terminated |
-if list is NULL terminated and every list[x] and fqdn are 0-terminated there can't be any errors
| void dotip6 | ( | char * | buffer | ) |
print IPv6 address of remote host in dotted form in buffer
| buffer | buffer to store result |
| int lookupipbl | ( | int | fd | ) |
check if the remote host is listed in local IP map file given by fd
| fd | file descriptor to file |
<0 on error >0 on match 0 otherwise | int spfreceived | ( | int | fd, |
| const int | spf | ||
| ) |
print "Received-SPF:" to message header
| fd | file descriptor of message body |
| spf | SPF status of mail transaction |
| void tarpit | ( | void | ) |
delay the next reply to the client
This should be used in all places where the client seems to be a spammer. This will delay him so he can't send so much spams.
tarpit does not sleep if there is input pending. If the client is using pipelining or (more likely) a worm or spambot ignoring our replies we kick him earlier and save some traffic.
1.7.6.1