Qsmtp  0.30dev
Functions | Variables
rcpt_filters.c File Reference

collection of all user filters for access by qsmtpd.c More...

#include <qsmtpd/userfilters.h>
#include "log.h"
#include <syslog.h>

Functions

enum filter_result cb_nomail (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_boolean (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_badmailfrom (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_dnsbl (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_check2822 (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_ipbl (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_badcc (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_fromdomain (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_smtpbugs (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_spf (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_soberg (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_helo (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_usersize (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_forceesmtp (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_namebl (const struct userconf *, const char **, enum config_domain *)
 
enum filter_result cb_wildcardns (const struct userconf *, const char **, enum config_domain *)
 
void logwhitelisted (const char *reason, const int t, const int u)
 

Variables

rcpt_cb rcpt_cbs []
 
rcpt_cb late_cbs []
 
const char * blocktype [] = { NULL, "user", "domain", NULL, "global" }
 

Detailed Description

collection of all user filters for access by qsmtpd.c

Function Documentation

enum filter_result cb_nomail ( const struct userconf ds,
const char **  logmsg,
enum config_domain t 
)

The user does not want to receive any mail

There are three possibilities how to work with the config file "nomail" -if it is empty the mail will simply be rejected with a general error message -if the message starts with "XYY X.Y.Y" (where Y is a decimal number and X is either 4 or 5) this will be used as the error code. -if the message does not start with a SMTP rejection code it will be used with a rejection code of "550 5.7.1 ".

enum filter_result cb_soberg ( const struct userconf ds,
const char **  logmsg,
enum config_domain t 
)

This checks if the combination of "MAIL FROM:" and "HELO" looks like SoberG

SoberG's MAIL FROM: foo@b.nosp@m.ar.c.nosp@m.om would lead to HELO foo.com

void logwhitelisted ( const char *  reason,
const int  t,
const int  u 
)

write message to syslog that a otherwise rejected mail has been passed because of whitelisting

Parameters
reasonreason of whitelisting
twhich type of filter caused blacklisting
uwhich type of filter caused whitelisting

Variable Documentation

const char* blocktype[] = { NULL, "user", "domain", NULL, "global" }

string constants for the type of blocklists

rcpt_cb late_cbs[]
Initial value:
= {
cb_badcc
}
rcpt_cb rcpt_cbs[]
Initial value:
= {
cb_boolean,
cb_smtpbugs,
cb_usersize,
cb_ipbl,
cb_helo,
cb_spf,
cb_badmailfrom,
cb_badcc,
cb_fromdomain,
cb_dnsbl,
cb_forceesmtp,
cb_namebl,
cb_wildcardns,
cb_check2822,
NULL}
enum filter_result cb_soberg(const struct userconf *, const char **, enum config_domain *)
Definition: soberg.c:15
enum filter_result cb_nomail(const struct userconf *, const char **, enum config_domain *)
Definition: nomail.c:22

the user filters will be called in the order in this array