Qsmtp
0.30dev
|
check syntax of email addresses and SMTP helos More...
#include <qsmtpd/addrparse.h>
#include <qdns.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
Functions | |
static int | parselocalpart (const char *const addr) |
static int | parseaddr (const char *addr) |
int | checkaddr (const char *const addr) |
int | addrspec_valid (const char *const addr) |
int | addrsyntax (char *in, const int flags, string *addr, char **more) |
check an email address for syntax errors More... | |
check syntax of email addresses and SMTP helos
int addrspec_valid | ( | const char *const | addr | ) |
check if the given string is a valid addr-spec
addr | string to check |
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
in | address to parse |
flags |
|
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) |
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
addr | the address to check |
0 | address is valid |
1 | address is invalid |
This is just !parseaddr(addr). This allows this to be used as callback.
|
static |
check type and correctness of mail address
addr | address to check |
0 | address invalid |
1 | address only contains a domain name |
2 | address contains @domain |
3 | address is a full email address |
4 | address is a full email address with IPv4 or IPv6 address literal |
|
static |
check syntax correctness of local part
addr | address to check |
-1 | syntax error in localpart |