Qsmtp
0.30dev
|
validate email addresses More...
#include <qsmtpd/addrparse.h>
#include <control.h>
#include <netio.h>
#include <qsmtpd/antispam.h>
#include <qsmtpd/qsmtpd.h>
Functions | |
int | addrparse (char *in, const int flags, string *addr, char **more, struct userconf *ds, const char *rcpthosts, const off_t rcpthsize) |
check an email address for syntax errors and/or existence More... | |
validate email addresses
int addrparse | ( | char * | in, |
const int | flags, | ||
string * | addr, | ||
char ** | more, | ||
struct userconf * | ds, | ||
const char * | rcpthosts, | ||
const off_t | rcpthsize | ||
) |
check an email address for syntax errors and/or existence
in | input to parse |
flags |
|
addr | struct string to contain the address (memory will be malloced, is set if 0 or -1 is returned) |
more | here starts the data behind the first '>' behind the first '<' (or NULL if line ends after the '>') |
ds | store the userconf of the user here |
rcpthosts | array of the valid rcpthosts |
rcpthsize | size of rcpthosts array |
0 | address exists locally |
>0 | on error (e.g. ENOMEM, return code is error code) |
-2 | if address not local (this is of course no error condition for MAIL FROM) |
-1 | if address local but nonexistent (expired or most probably faked) OR if domain of address does not exist (in both cases error is sent to network before leaving) |
ds may be NULL in case the result is not interesting (e.g. if only checking MAIL FROM).