2

我想组织 sendmail 队列以减少活动队列并使邮件发送更快。

我想设置 sendmail 以在第一次连接快速服务器(conn.time 少于 5 秒)。如果 conn.time > 5s,则 sendmail 会将此邮件从活动队列放入文件夹'/var/spool/mqueue/slow' 每小时 sendmail 将尝试从文件夹重新发送邮件'slow'

如果来自文件夹的邮件出现连接超时'slow',sendmail 会将此邮件放入文件夹'/var/spool/mqueue/veryslow' 每 8 小时 sendmail 将尝试重新发送来自文件夹的邮件'veryslow'

例如,我有几封电子邮件。我是通过sendmail发送的。

mail@fast-server   (connection time less than 5s)
mail@slow-server   (connection time 20s)
mail@dead-server   (connection time infinitely)

结果将是

mail@fast-server   - sent
mail@slow-server   - will be in folder 'slow' because of connection timeout
mail@dead-server   - will be in folder 'slow' because of connection timeout

结果将在 1 小时后

mail@slow-server   - sent  (from 'slow' folder)
mail@dead-server   - will be in folder 'veryslow' because of connection timeout

8小时后的结果

     mail@dead-server   - sendmail try to resend message from folder 'veryslow'.
If connection timeout, sendmail must delete this message.

我需要在 sendmail.mc 中写入什么来配置它?

这是我的配置,但我无法完成。

divert(-1)dnl
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.4-2.1ubuntu1 2012-05-23 00:27:22 cowboy Exp $')dnl
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=
define(`confDOMAIN_NAME',`site.com')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`access_db')dnl
FEATURE(`nocanonify', `canonify_hosts')dnl
FEATURE(`delay_checks', `friend')dnl
FEATURE(`ratecontrol', `nodelay',`terminate')dnl
FEATURE(`conncontrol', `nodelay',`terminate')dnl
FEATURE(`no_default_msa')dnl
FEATURE(`authinfo',`hash /etc/mail/authinfo')dnl
FEATURE(`greet_pause', `10')dnl
MODIFY_MAILER_FLAGS(`SMTP', `+0')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
include(`/etc/mail/tls/starttls.m4')dnl
include(`/etc/mail/sasl/sasl.m4')dnl
DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea')dnl
DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
define(`confDELIVERY_MODE', `background')dnl 
define(`confCONNECTION_RATE_THROTTLE', `100')dnl
define(`confBAD_RCPT_THROTTLE', `30')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE', `10m')dnl
define(`confMAX_RCPTS_PER_MESSAGE', `1')dnl
define(`confTO_COMMAND',          `5s')dnl
define(`confTO_CONNECT',          `5s')dnl
define(`confTO_DATABLOCK',        `1m')dnl
define(`confTO_DATAFINAL',        `1m')
define(`confTO_DATAINIT',         `5s')dnl
define(`confTO_HELO',             `5s')dnl
define(`confTO_HOSTSTATUS',       `5s')dnl
define(`confTO_ICONNECT',         `5s')dnl
define(`confTO_IDENT',            `0s')dnl
define(`confTO_INITIAL',          `5s')dnl
define(`confTO_MAIL',             `5s')dnl
define(`confTO_QUIT',             `5s')dnl
define(`confTO_RCPT',             `5s')dnl
define(`confTO_RESOLVER_RETRANS', `5s')dnl
define(`confTO_RESOLVER_RETRY',   `5s')dnl
define(`confTO_RSET',             `5s')dnl
define(`confDIRECT_SUBMISSION_MODIFIERS', `C')
define(`confQUEUE_LA',`40')dnl
define(`confREFUSE_LA',`20')dnl
define(`confMAX_QUEUE_CHILDREN', `150')dnl
define(`confTO_QUEUERETURN', `12h')dnl
define(`confTO_QUEUEWARN', `8h')dnl
define(`QUEUE_DIR', `/var/spool/mqueue')dnl
QUEUE_GROUP(`slow', `P=/var/spool/mqueue/slow, F=f, I=1h, R=20')dnl
QUEUE_GROUP(`veryslow', `P=/var/spool/mqueue/very, F=f, I=8h, R=10')dnl
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
4

0 回答 0