邮件服务器-邮件系统-邮件技术论坛(BBS)

标题: 如何限制附件? [打印本页]

作者: phpasp    时间: 2007-1-12 12:55
标题: 如何限制附件?
sendmail postfix qmail等,想要禁止发送邮件附件,要如何做?
请给个实例吧,谢谢
作者: abel    时间: 2007-1-17 11:32
sendmail + Mimedefang 什麼都能做!

/etc/mail/mimedefang-filter:

  1. sub filter {
  2. my($entity, $fname, $ext, $type) = @_;
  3. if (filter_bad_filename($entity)) {
  4.         md_syslog('info',"BAD FILE EXT: filename=$fname, type=$type");
  5.         return action_bounce("An attachment of type $type, named $fname was not transmitted","554","5.7.1");
  6. }
  7. }

  8. sub filter_bad_filename  {
  9. my($entity) = @_;
  10. my($bad_exts, $re);
  11. $bad_exts = '.*';
  12. $re = '\.' . $bad_exts . '\.*$';
  13. return 1 if (re_match($entity, $re));
  14. return 0;
  15. }
复制代码

作者: feitianxiang    时间: 2007-1-22 20:17
谢谢,研究中




欢迎光临 邮件服务器-邮件系统-邮件技术论坛(BBS) (http://bbs.5dmail.cn/) Powered by Discuz! X3.2