- 論壇徽章:
- 0
|
我sendmail郵件服務(wù)器已經(jīng)搭建好了,確認(rèn)發(fā)郵件時(shí)是需要認(rèn)證的,現(xiàn)在想利用mimedefang做發(fā)件人唯一性驗(yàn)證(防止冒充其它的郵件地址發(fā)信,即讓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");
- }
復(fù)制代碼
生效后,所有的郵件都發(fā)不出去了,報(bào)“need authen",maillog里面顯示的我定義的幾個(gè)值(authid,type,author)都為空,為什么取不到這些值呢? |
|