headers of address parser functions
More...
Go to the source code of this file.
|
int | checkaddr (const char *const) |
|
int | addrsyntax (char *in, const int flags, string *addr, char **more) |
| check an email address for syntax errors More...
|
|
int | addrspec_valid (const char *const addr) |
|
int | addrparse (char *in, const int flags, string *addr, char **more, struct userconf *ds, const char *, const off_t) |
| check an email address for syntax errors and/or existence More...
|
|
int | user_exists (const string *localpart, const char *domain, struct userconf *dsp) |
| check if the user identified by localpart and ds->domainpath exists More...
|
|
headers of address parser 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
- Parameters
-
in | input to parse |
flags |
0 : mail from checks
1 : rcpt to checks (e.g. source route is allowed)
|
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 |
- Returns
- if address was validated
- Return values
-
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).
int addrspec_valid |
( |
const char *const |
addr | ) |
|
check if the given string is a valid addr-spec
- Parameters
-
- Returns
- if string is valid addrspec
- Return values
-
0 | string is invalid |
1 | string is valid |
int addrsyntax |
( |
char * |
in, |
|
|
const int |
flags, |
|
|
string * |
addr, |
|
|
char ** |
more |
|
) |
| |
check an email address for syntax errors
- Parameters
-
in | address to parse |
flags |
0 : mail from checks,
1 : rcpt to checks (e.g. source route is allowed),
2 : checks for badmailfrom/goodmailfrom lists
|
addr | struct string to contain the address (memory will be malloced) |
more | here starts the data behind the first '>' behind the first '<' (or NULL if none) |
- Returns
- >0 on success
- Return values
-
1 | address is empty (only possible if flags is 0) |
3 | address is a full email address |
4 | address is a full email address with IPv4 or IPv6 address literal |
0 | in is invalid |
-1 | an error occured (e.g. ENOMEM) |
int checkaddr |
( |
const char *const |
addr | ) |
|
check an email address for validity, use as loadlistfd callback
- Parameters
-
- Returns
- if address valid
- Return values
-
0 | address is valid |
1 | address is invalid |
This is just !parseaddr(addr). This allows this to be used as callback.
int user_exists |
( |
const string * |
localpart, |
|
|
const char * |
domain, |
|
|
struct userconf * |
dsp |
|
) |
| |
check if the user identified by localpart and ds->domainpath exists
- Parameters
-
localpart | localpart of mail address |
domain | domainpart of the domain |
ds | path of domain |
- Return values
-
0 | user doesn't exist |
1 | user exists |
2 | mail would be catched by .qmail-default and .qmail-default != vpopbounce |
3 | domain is not filtered (use for domains not local) |
4 | mail would be catched by .qmail-foo-default (i.e. mailinglist) |
5 | domain is not local |
<0 | error code |
If the user has it's own mail directory ds->userpath will be filled with the correct values.
This function must be implemented by the password backend (i.e. currently vpop.c).