| 
    Qsmtp
    0.30dev
    
   | 
 
headers of antispam helper functions More...
#include <sys/types.h>Go to the source code of this file.
Macros | |
| #define | SPF_IS_FAILURE(x) (((x) == SPF_FAIL) || ((x) == SPF_PERMERROR)) | 
Enumerations | |
| enum | spf_eval_result {  SPF_NONE = 0, SPF_PASS = 1, SPF_NEUTRAL = 2, SPF_SOFTFAIL = 3, SPF_FAIL = 4, SPF_PERMERROR = 5, SPF_TEMPERROR = 7, SPF_DNS_HARD_ERROR = 8, SPF_IGNORE = 15 }  | 
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_IS_FAILURE | ( | x | ) | (((x) == SPF_FAIL) || ((x) == SPF_PERMERROR)) | 
check if one of the conditions is given to fail SPF policy
| enum spf_eval_result | 
| 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.
If txt is NULL no TXT record lookup will be performed.
| 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 | no match | 
fd will always be closed.
| 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.8.10