1 package FS::part_export::status_shellcommands;
2 use base qw( FS::part_export::shellcommands );
6 use String::ShellQuote;
8 tie my %options, 'Tie::IxHash',
9 'user' => { label=>'Remote username', default=>'root' },
11 'spam_enable' => { label=>'Spam filtering enable command', },
12 'spam_disable' => { label=>'Spam filtering disable command', },
13 'spam_tag2_level' => { label=>'Spam set tag2 level command', },
14 'spam_kill_level' => { label=>'Spam set kill level command', },
16 'ignore_all_output' => {
17 label => 'Ignore all output and errors from the command',
24 'desc' => 'Set mailbox status via shell commands',
25 'options' => \%options,
28 Set mailbox status information (vacation and spam settings) with shell commands.
32 #don't want to inherit these from shellcommands
34 sub _export_replace {}
36 sub _export_suspend {}
37 sub _export_unsuspend {}
39 sub export_setstatus {
40 my($self, $svc_acct, $hashref) = @_;
44 user => $self->option('user') || 'root',
45 host => $self->machine,
46 #stdin_string => $stdin_string,
47 ignore_all_output => $self->option('ignore_all_output'),
48 #ignored_errors => $self->option('ignored_errors') || '',
51 $self->shellcommands_queue( @shallargs, 'command' =>
52 $self->option('spam_enable'). ' '.
53 shell_quote($svc_acct->email)
55 || $self->shellcommands_queue( @shallargs, 'command' =>
56 $self->option('spam_tag2_level'). ' '.
57 shell_quote($svc_acct->email). ' '.
58 $hashref->{'spam_tag2_level'}
60 || $self->shellcommands_queue( @shallargs, 'command' =>
61 $self->option('spam_kill_level'). ' '.
62 shell_quote($svc_acct->email). ' '.
63 $hashref->{'spam_kill_level'}