- 论坛徽章:
- 0
|
我sendmail邮件服务器已经搭建好了,确认发邮件时是需要认证的,现在想利用mimedefang做发件人唯一性验证(防止冒充其它的邮件地址发信,即让authid与from保持一致)
代码如下:
- sub filter_sender {
- my ($sender,$ip,$hostname,$helo)=@_;
- read_commands_file();
- my $authid=$SendmailMacros{'auth_authen'};
- my $type=$SendmailMacros{'auth_type'};
- my $author=$SendmailMacros{'auth_author'};
- md_syslog('DEBUG', "authid=$auth,type=$type,author=$author");
- return ('REJECT','need authen') if (!defined($SendmailMacros{'auth_authen'}));
- md_syslog('DEBUG', "sender=$sender,authid=$authid");
- return ('REJECT','the sender is not the same as auth_authen') if ($sender !~ $authid);
- return ('CONTINUE', "ok");
- }
复制代码
生效后,所有的邮件都发不出去了,报“need authen",maillog里面显示的我定义的几个值(authid,type,author)都为空,为什么取不到这些值呢? |
|