--- sbbs/src/sbbs3/mailsrvr.h 2018/04/24 16:41:24 1.1.1.1 +++ sbbs/src/sbbs3/mailsrvr.h 2018/04/24 16:43:48 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet Mail (SMTP/POP3/SendMail) server */ -/* $Id: mailsrvr.h,v 1.1.1.1 2018/04/24 16:41:24 root Exp $ */ +/* $Id: mailsrvr.h,v 1.1.1.2 2018/04/24 16:43:48 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -46,6 +46,7 @@ typedef struct { DWORD size; /* sizeof(mail_startup_t) */ WORD smtp_port; WORD pop3_port; + WORD submission_port; WORD max_clients; WORD max_inactivity; WORD max_delivery_attempts; @@ -56,13 +57,16 @@ typedef struct { WORD sem_chk_freq; /* semaphore file checking frequency (in seconds) */ DWORD interface_addr; DWORD options; /* See MAIL_OPT definitions */ - DWORD max_msg_size; + DWORD max_msg_size; /* Max msg size in bytes (0=unlimited) */ + DWORD max_msgs_waiting; /* Max msgs in user's inbox (0=unlimited) */ + DWORD connect_timeout; /* in seconds, for non-blocking connect (0=blocking socket) */ void* cbdata; /* Private data passed to callbacks */ /* Callbacks (NULL if unused) */ - int (*lputs)(void*, int, char*); - void (*status)(void*, char*); + int (*lputs)(void*, int level, const char* msg); + void (*errormsg)(void*, int level, const char* msg); + void (*status)(void*, const char*); void (*started)(void*); void (*recycle)(void*); void (*terminated)(void*, int code); @@ -104,6 +108,13 @@ typedef struct { /* JavaScript operating parameters */ js_startup_t js; + /* Login Attempt parameters */ + ulong login_attempt_delay; + ulong login_attempt_throttle; + ulong login_attempt_hack_threshold; + ulong login_attempt_filter_threshold; + link_list_t* login_attempt_list; + } mail_startup_t; /* startup options that requires re-initialization/recycle when changed */ @@ -127,6 +138,7 @@ static struct init_field mail_init_field #define MAIL_OPT_ALLOW_RX_BY_NUMBER (1<<7) /* Receive mail sent to user # */ #define MAIL_OPT_NO_NOTIFY (1<<8) /* Don't notify local recipients */ #define MAIL_OPT_ALLOW_SYSOP_ALIASES (1<<9) /* Receive mail sent to built-in sysop aliases (i.e. "sysop" and "postmaster") */ +#define MAIL_OPT_USE_SUBMISSION_PORT (1<<10) /* Listen on the "MSA" service port for mail submissions */ #define MAIL_OPT_NO_HOST_LOOKUP (1<<11) /* Don't look-up hostnames */ #define MAIL_OPT_USE_TCP_DNS (1<<12) /* Use TCP vs UDP for DNS req */ #define MAIL_OPT_NO_SENDMAIL (1<<13) /* Don't run SendMail thread */ @@ -136,20 +148,20 @@ static struct init_field mail_init_field #define MAIL_OPT_DNSBL_BADUSER (1<<17) /* Refuse mail (bad user name) */ #define MAIL_OPT_DNSBL_CHKRECVHDRS (1<<18) /* Check all Recieved: from addresses */ #define MAIL_OPT_DNSBL_THROTTLE (1<<19) /* Throttle receive from blacklisted servers */ -#define MAIL_OPT_DNSBL_DEBUG (1<<20) /* Debug DNSBL activity */ +#define MAIL_OPT_DNSBL_SPAMHASH (1<<20) /* Store hashes of ignored or tagged messages in spam.hash */ #define MAIL_OPT_SMTP_AUTH_VIA_IP (1<<21) /* Allow SMTP authentication via IP */ #define MAIL_OPT_SEND_INTRANSIT (1<<22) /* Send mail, even if already "in transit" */ #define MAIL_OPT_RELAY_AUTH_PLAIN (1<<23) #define MAIL_OPT_RELAY_AUTH_LOGIN (1<<24) #define MAIL_OPT_RELAY_AUTH_CRAM_MD5 (1<<25) +#define MAIL_OPT_NO_AUTO_EXEMPT (1<<26) /* Do not auto DNSBL-exempt recipient e-mail addresses */ #define MAIL_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */ -#define MAIL_OPT_LOCAL_TIMEZONE (1<<30) /* Don't force UTC/GMT */ #define MAIL_OPT_MUTE (1<<31) #define MAIL_OPT_RELAY_AUTH_MASK (MAIL_OPT_RELAY_AUTH_PLAIN|MAIL_OPT_RELAY_AUTH_LOGIN|MAIL_OPT_RELAY_AUTH_CRAM_MD5) /* mail_startup_t.options bits that require re-init/recycle when changed */ -#define MAIL_INIT_OPTS (MAIL_OPT_ALLOW_POP3|MAIL_OPT_NO_SENDMAIL|MAIL_OPT_LOCAL_TIMEZONE) +#define MAIL_INIT_OPTS (MAIL_OPT_ALLOW_POP3|MAIL_OPT_NO_SENDMAIL) #if defined(STARTUP_INI_BITDESC_TABLES) static ini_bitdesc_t mail_options[] = { @@ -163,6 +175,7 @@ static ini_bitdesc_t mail_options[] = { { MAIL_OPT_DEBUG_POP3 ,"DEBUG_POP3" }, { MAIL_OPT_ALLOW_RX_BY_NUMBER ,"ALLOW_RX_BY_NUMBER" }, { MAIL_OPT_ALLOW_SYSOP_ALIASES ,"ALLOW_SYSOP_ALIASES" }, + { MAIL_OPT_USE_SUBMISSION_PORT ,"USE_SUBMISSION_PORT" }, { MAIL_OPT_NO_NOTIFY ,"NO_NOTIFY" }, { MAIL_OPT_NO_HOST_LOOKUP ,"NO_HOST_LOOKUP" }, { MAIL_OPT_USE_TCP_DNS ,"USE_TCP_DNS" }, @@ -174,13 +187,13 @@ static ini_bitdesc_t mail_options[] = { { MAIL_OPT_DNSBL_BADUSER ,"DNSBL_BADUSER" }, { MAIL_OPT_DNSBL_CHKRECVHDRS ,"DNSBL_CHKRECVHDRS" }, { MAIL_OPT_DNSBL_THROTTLE ,"DNSBL_THROTTLE" }, - { MAIL_OPT_DNSBL_DEBUG ,"DNSBL_DEBUG" }, + { MAIL_OPT_DNSBL_SPAMHASH ,"DNSBL_SPAMHASH" }, { MAIL_OPT_SEND_INTRANSIT ,"SEND_INTRANSIT" }, { MAIL_OPT_RELAY_AUTH_PLAIN ,"RELAY_AUTH_PLAIN" }, { MAIL_OPT_RELAY_AUTH_LOGIN ,"RELAY_AUTH_LOGIN" }, { MAIL_OPT_RELAY_AUTH_CRAM_MD5 ,"RELAY_AUTH_CRAM_MD5" }, + { MAIL_OPT_NO_AUTO_EXEMPT ,"NO_AUTO_EXEMPT" }, { MAIL_OPT_NO_RECYCLE ,"NO_RECYCLE" }, - { MAIL_OPT_LOCAL_TIMEZONE ,"LOCAL_TIMEZONE" }, { MAIL_OPT_MUTE ,"MUTE" }, /* terminator */ { 0 ,NULL }