Переменная $Sender выставляется "автоматически".
В man все есть.
Вот живой пример:
sub filter_begin () {
# ----- check sending messages to ALL@PCB.COM ---------------------
my @Auth_for_all = ('vasea','petea','dodik','max@camtek.com','max');
foreach $recip (@Recipients) {
if ($recip =~ /^<?all\@pcb.com>?$/i) {
md_graphdefang_log("WARNING : sending to all");
$valid_for_all = 0;
foreach $authuser (@Auth_for_all) {
$authuser = $authuser . '@pcb.com' if ($authuser !~ /\@/);
$authuser = '<' . $authuser . '>';
if (lc($Sender) eq $authuser) {
$valid_for_all = 1;
last;
}
}
if (!$valid_for_all) {
md_graphdefang_log("WARNING! unauthorized mail to ALL\@PCB.COM from $Sender");
return action_bounce('You not authorized to send mail for all@pcb.com');
last;
}
} #end if
} #end foreach
#---------------------- default code --------------------------
# ALWAYS drop messages with suspicious chars in headers
if ($SuspiciousCharsInHeaders) {
############################################################
Я тебя предупреждал, без перла тут не обойтись.