6.9.4 qmgr_active_done_25_generic函数:发送退信或延迟提醒信
2016-04-07 15:41
387 查看
/qmgr/qmgr_active.c 425 /* qmgr_active_done_25_generic -continue processing */ 426 427 static voidqmgr_active_done_25_generic(QMGR_MESSAGE *message) 428 { 429 const char *myname = "qmgr_active_done_25_generic"; 430 431 /* 432 * If we get to this point we have tried all recipients for this message. 433 * If the message is too old, try to bounce it. 434 * 435 * Bounces are sent asynchronously to avoid stalling while the cleanup 436 * daemon waits for the qmgr to accept the "new mail" trigger. 437 */ 438 if (message->flags) { 439 if (event_time() >= message->create_time + 440 (*message->sender ?var_max_queue_time : var_dsn_queue_time)) { 441 msg_info("%s:from=<%s>, status=expired, returned to sender", 442 message->queue_id,message->sender); 443 if (message->verp_delims == 0|| var_verp_bounce_off) 444 adefer_flush(BOUNCE_FLAG_KEEP, //参数 454 else 455 adefer_flush_verp(BOUNCE_FLAG_KEEP, //参数 466 return;
439-466 确定邮件是否过期,过期则发送退信
var_max_queue_time即参数maximal_queue_lifetime,表示邮件在等待队列里的最长时间。var_dsn_queue_time 即参数bounce_queue_lifetime,表示退信发送的期限上限。
这两个参数的默认值均为5天。
如果邮件存在发件人,说明是延迟邮件,采用参数maximal_queue_lifetime参与计算。系统生成的邮件没有发件人,对于没有发件人的给用户的通知邮件,postfix会将收件人设置为MAILER-DEMON。见7.5节。
如果当前时间大于邮件入队时间和参数时间之和,说明邮件已过期,采用adefer_flush或adefer_flush_verp发送退信。adefer_flush或adefer_flush_verp使用BOUNCE_CMD_FLUSH命令调用bounce模块的bounce_notify_service函数。
467 } else if (message->warn_time > 0 468 && event_time()>= message->warn_time - 1) { 469 if (msg_verbose) 470 msg_info("%s: sendingdefer warning for %s", myname, message->queue_id); 471 adefer_warn(BOUNCE_FLAG_KEEP, //参数 481 return; 482 } 483 } 484 485 /* 486 * Asynchronous processing does not reach this point. 487 */ 488 qmgr_active_done_3_generic(message); 489 }
467-482 如果设定了QMGR_MESSAGE->warn_time字段,即发送延迟提醒信的时间,并且该时间已过期,则使用adefer_warn函数发送延迟提醒信。该函数以BOUNCE_CMD_WARN命令调用bounce模块的bounce_warn_service函数。
相关文章推荐
- mysql innodb 优化 参数篇
- Android自定义绘制
- JPA Many To Many Duplicate record in join table
- 一个函数看懂View事件分发机制
- activiti自定义流程之Spring整合activiti-modeler5.16实例(九):历史任务查询
- R 语言笔记 频数表和列联表
- 在网页中使用SVG技术
- Xcode 运行项目时候选择模拟器位置处显示"My Mac" 的处理
- activiti自定义流程之Spring整合activiti-modeler5.16实例(九):历史任务查询
- vs2012 使用正则查找和替换
- UITableView优化技巧
- 脚本编译安装DRBD
- web.xml中load-on-startup的作用
- 一个实现 Twitter SnowFlake 算法 的 Go 分布式 UID 生成器
- 学习笔记一
- 6.9.3 qmgr_active_done_2_generic函数:发送邮件状态通知信
- [LeetCode]题解(python):138-Copy List with Random Pointer
- shader param
- 太原网络营销师如何分析及考核百度竞价(SEM)人员
- 闭包