<file name="cf/feature/custom_listen.m4">

dnl #  allow MSA to be redefined below
FEATURE(`no_default_msa')

dnl #  bind only to our address
DAEMON_OPTIONS(`Addr=confMYIPADDRESS, Port=25,  Name=MTA')
DAEMON_OPTIONS(`Addr=confMYIPADDRESS, Port=587, Name=MSA, M=E')

dnl #  perform SMTP client connections this way
fCLIENT_OPTIONS(`Addr=confMYIPADDRESS')

</file>
<file name="cf/feature/custom_texts.m4">

dnl #  Custom texts.
define(`confPROCESS_TITLE_PREFIX', 
       `confMYHOSTNAME.confMYDOMAINNAME')
define(`confSMTP_LOGIN_MSG', 
       `confMYHOSTNAME.confMYDOMAINNAME SMTP Sendmail $v ready')
define(`confRECEIVED_HEADER', 
       `by confMYHOSTNAME.confMYDOMAINNAME (Sendmail $v)$?r via $r$.$?u for $u$.
	$?sfrom $s $.id $i; $b')dnl

</file>
<file name="cf/feature/dos.m4">

dnl #  Denial Of Service (DoS) prevention
define(`confMAX_MIME_HEADER_LENGTH', `2048/512')
define(`confMAX_MESSAGE_SIZE',       `16000000')
define(`SMTPFEED_MAILER_MAX',        `confMAX_MESSAGE_SIZE')
define(`UUCP_MAILER_MAX',            `confMAX_MESSAGE_SIZE')
define(`PROCMAIL_MAILER_MAX',        `confMAX_MESSAGE_SIZE')

</file>
<file name="cf/feature/performance.m4">

dnl #  Performance tuning: incoming.
define(`confMAX_DAEMON_CHILDREN',      `8'       )dnl # no more than this children
define(`confMCI_CACHE_SIZE',           `2'       )dnl # cache this number of connections
define(`confMCI_CACHE_TIMEOUT',        `2m'      )dnl # close cached connections after...
define(`confCONNECTION_RATE_THROTTLE', `100'     )dnl # max number of connects per seconds
define(`confTO_INITIAL',               `2m'      )dnl # timeout for initial connect() to complete
define(`confTO_HELO',                  `2m'      )dnl # timeout for response to HELO command
define(`confTO_COMMAND',               `2m'      )dnl # timeout waiting for a command to be issued in server mode
define(`confTO_IDENT',                 `5s'      )dnl # timeout for an IDENT query
define(`confREFUSE_LA',                `8'       )dnl # load average for connection reject

dnl #  Performance tuning: outgoing.
define(`confQUEUE_LA',                 `12'      )dnl # load average for queue only
define(`confDELIVERY_MODE',            `q'       )dnl # queued only
define(`confCHECKPOINT_INTERVAL',      `4'       )dnl # save back queue files every N reciptions
define(`confMAX_QUEUE_RUN_SIZE',       `0'       )dnl # maximum queue run size (unlimited)
define(`confQUEUE_SORT_ORDER',         `Priority')dnl # priority scheduling
define(`confMIN_QUEUE_AGE',            `30m'     )dnl # a queued job is re-checked after this time
define(`confSAFE_QUEUE',               `True'    )dnl # commit all to disk before forking
define(`confTO_QUEUEWARN',             `12h'     )dnl # undeliverable mail warning
define(`confTO_QUEUERETURN',           `4d'      )dnl # undeliverable mail timeout

</file>
<file name="cf/feature/tls.m4">

dnl #  STARTTLS support
define(`confSERVER_CERT', `confMYETCDIR/sendmail.crt')
define(`confSERVER_KEY',  `confMYETCDIR/sendmail.key')
define(`confCLIENT_CERT', `confMYETCDIR/sendmail.crt')
define(`confCLIENT_KEY',  `confMYETCDIR/sendmail.key')
define(`confCACERT',      `confMYETCDIR/ca.crt')
define(`confCACERT_PATH', `confMYETCDIR/')
define(`confRAND_FILE',   `file:/dev/urandom')

</file>
<file name="cf/mailer/smtpfeed.m4">
PUSHDIVERT(-1)

_DEFIFNOT(`SMTPFEED_MAILER_PATH',            `/usr/local/bin/smtpfeed')
_DEFIFNOT(`SMTPFEED_MAILER_FLAGS',           `mDFMuXz_')
_DEFIFNOT(`SMTPFEED_MAILER_MINRCPTS',        `2')
_DEFIFNOT(`SMTPFEED_MAILER_MAXRCPTS',        `2000')
_DEFIFNOT(`SMTPFEED_MAILER_MAX',             `800000')
_DEFIFNOT(`SMTPFEED_MAILER_ARGS',            `')
_DEFIFNOT(`SMTPFEED_MAILER_TIMEOUT_CONNECT', `1m')
_DEFIFNOT(`SMTPFEED_MAILER_TIMEOUT_GREET',   `1m')
_DEFIFNOT(`SMTPFEED_MAILER_TIMEOUT_RSET',    `2m')

POPDIVERT

#########################################
###   SMTPfeed Mailer specification   ###
#########################################

Msmtpfeed, P=SMTPFEED_MAILER_PATH, F=SMTPFEED_MAILER_FLAGS,
           S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, 
           L=990, T=DNS/RFC822/SMTP, M=SMTPFEED_MAILER_MAX,
           r=SMTPFEED_MAILER_MAXRCPTS, *=SMTPFEED_MAILER_MINRCPTS,
           A=smtpfeed SMTPFEED_MAILER_ARGS -n 512 -u -V dnl
             -l mail -c $j $?{runqueue}-i$i$|-I$i$. -E dnl
             -s SMTPFEED_MAILER_MAX dnl
             -r SMTPFEED_MAILER_MINRCPTS -R SMTPFEED_MAILER_MAXRCPTS dnl
             -t connect=SMTPFEED_MAILER_TIMEOUT_CONNECT dnl
             -t greet=SMTPFEED_MAILER_TIMEOUT_GREET dnl
             -t rset=SMTPFEED_MAILER_TIMEOUT_RSET

dnl # Special: Multiple Mailer Feature for SMTP/SMTPfeed
dnl # (requires WIDE's Sendmail patches we use!):
dnl # first "smtpfeed" mailer is tried, second the "smtp" mailer.
dnl #
dnl # The OperatorChars hack is required to make Sendmail happy because of S95,
dnl # see http://www.harker.com/sendmail/adding-to-rulesets.html for details.
LOCAL_CONFIG
O OperatorChars=.:%@!^/[]+
undefine(`confOPERATORS')
SMailerToTriple=95
R< smtpfeed : LMTP > $*<@$*>$*	$#smtpfeed$@LMTP$:$1<@$2>$3$#smtp$@$2.$:$1<@$2>$3
R< smtpfeed : $* > $*	        $#smtpfeed$@LMTP$:$2$#smtp$@$1.$:$2
R< smtpfeed > $*<@$*>$*		$#smtpfeed$@LMTP$:$1<@$2>$3$#smtp$@$2.$:$1<@$2>$3

</file>
