my $opt_mode;
my $opt_smstest; # 1 or $smscount
my $opt_idle;
+my $opt_dry;
sub process;
$profile=$store_profile if !$profile;
my %do=map({ (!/=/ ? ($_=>1) : ($`=>$')); } profile_eval($profile));
- Sys::Syslog::syslog("info","%s%s: %s: %s",
+ Sys::Syslog::syslog("info","%s%s%s: %s: %s",
+ (!$opt_dry ? "" : "--dry: "),
(!$store_ignore ? "" : "IGNORED[$store_ignore]: "),
map({ cut($_); } $folder,address_show(unmime($Audit->from())),unmime($Audit->subject())),
)
- if $do{"syslog"};
+ if $do{"syslog"} || $opt_dry;
$folder=~s/;.*$//s;
$folder="$Mail/".$' if $folder=~/^=/;
push @AuditStored,$folder if $do{"did"};
- return if $store_ignore;
+ return if $store_ignore || $opt_dry;
$DoBell++ if $do{"bell"};
write_message($folder);
smssend_tryall $store_ignorenewmail,$do{"sms"},%args if $do{"sms"};
{
my($folder)=@_;
+ return if $opt_dry;
local *F;
open F,">>$folder" or do { warn "Append \"$folder\": $!"; return 0; };
{
die "GetOptions error" if !Getopt::Long::GetOptions(
"inetd" ,sub { $opt_mode=\&inetd; },
"stdin" ,sub { $opt_mode=\&stdin; },
+ "dry" ,\$opt_dry,
"smstest:s",sub { $opt_mode=\&stdin; $opt_smstest=($_[1] || 1); },
"idle!" ,\$opt_idle,
"idletest" ,sub { syslogging_restore(); print((defined($_=useridle()) ? $_ : "<undef>")."\n"); exit 0; },