|
Qsmtp
0.30dev
|
main part of Qsmtpd More...
#include <qsmtpd/qsmtpd.h>#include <control.h>#include <diropen.h>#include <log.h>#include <mmap.h>#include <netio.h>#include <qdns.h>#include <qmaildir.h>#include <qsmtpd/antispam.h>#include <qsmtpd/commands.h>#include <qsmtpd/qsauth.h>#include <qsmtpd/qsdata.h>#include <qsmtpd/starttls.h>#include <qsmtpd/syntax.h>#include <qsmtpd/userconf.h>#include <sstring.h>#include <tls.h>#include <version.h>#include <arpa/inet.h>#include <assert.h>#include <errno.h>#include <fcntl.h>#include <netinet/in.h>#include <signal.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <sys/file.h>#include <sys/mman.h>#include <sys/queue.h>#include <sys/stat.h>#include <sys/types.h>#include <syslog.h>#include <unistd.h>Macros | |
| #define | _C(c, m, f, s, o) { .name = c, .len = sizeof(c) - 1, .mask = m, .func = f, .state = s, .flags = o } |
Functions | |
| int | err_control (const char *fn) |
| write and log error message if opening config file leads to an error More... | |
| int | err_control2 (const char *msg, const char *fn) |
| write and log error message if opening config file leads to an error More... | |
| void | dieerror (int error) |
| static int | setup (void) |
| static int | connsetup (void) |
| void | freedata (void) |
| free all ressources allocated for mail transaction | |
| pid_t | fork_clean () |
| fork() but clean up internal structures More... | |
| void | conn_cleanup (const int rc) |
| clean up the allocated data and exit the process More... | |
| static int | smtp_temperror (void) |
| static int | line_valid () |
| static void | smtploop (void) |
| int | main (int argc, char **argv) |
Variables | |
| struct smtpcomm * | current_command |
| static struct smtpcomm | commands [] |
| unsigned int | rcptcount |
| int | relayclient |
| char * | rcpthosts |
| off_t | rcpthsize |
| unsigned long | sslauth |
| unsigned long | databytes |
| unsigned int | goodrcpt |
| int | badbounce |
| struct xmitstat | xmitstat |
| const char ** | globalconf |
| string | heloname |
| string | msgidhost |
| string | liphost |
| int | socketd = 1 |
| unsigned long | comstate = 0x001 |
| int | authhide |
| int | submission_mode |
| struct recip * | thisrecip |
| static int | flagbogus |
main part of Qsmtpd
This file contains the main function and the basic commands of Qsmtpd SMTP server.
| void conn_cleanup | ( | const int | rc | ) |
clean up the allocated data and exit the process
| rc | desired return code of the process |
|
static |
initialize variables related to this connection
| void dieerror | ( | int | error | ) |
log error message and terminate program
| error | error code that caused the program termination |
| int err_control | ( | const char * | fn | ) |
write and log error message if opening config file leads to an error
| fn | name of the file that caused the error |
| int err_control2 | ( | const char * | msg, |
| const char * | fn | ||
| ) |
write and log error message if opening config file leads to an error
| msg | additional message to log |
| fn | name of the file that caused the error |
| pid_t fork_clean | ( | ) |
fork() but clean up internal structures
This will work exactly like fork(). If it returns 0 (i.e. you are the child) it will also clean the memory mappings etc. of the Qsmtpd process that the child doesn't need.
|
static |
line_valid - check if input line contains only syntactically correct characters
| int authhide |
hide source of authenticated mail
| int badbounce |
bounce message with more than one recipient
|
static |
| unsigned long comstate = 0x001 |
status of the command state machine, initialized to noop
| struct smtpcomm* current_command |
the SMTP command currently processed
| unsigned long databytes |
maximum message size
| const char** globalconf |
contents of the global "filterconf" file (or NULL)
| unsigned int goodrcpt |
number of valid recipients
| string heloname |
the fqdn to show in helo
| string liphost |
replacement domain if TO address is <foo@[ip]>
| string msgidhost |
the fqdn to use if a message-id is added
| unsigned int rcptcount |
number of recipients in lists including rejected
| char* rcpthosts |
memory mapping of control/rcpthosts
| off_t rcpthsize |
sizeof("control/rcpthosts")
| int relayclient |
flag if this client is allowed to relay by IP: 0 unchecked, 1 allowed, 2 denied
| int socketd = 1 |
the descriptor where messages to network are written to
| unsigned long sslauth |
if SMTP AUTH is only allowed after STARTTLS
| int submission_mode |
if we should act as message submission agent
1.8.10