如何配置sendmail队列?

时间:2013-10-04 09:43:44

标签: sendmail

我想组织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

0 个答案:

没有答案