4 # Copyright (c) Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @f = split /\s+/, $line;
17 return (1, $self->msg("e5")) if $self->priv < 9 || $self->consort ne 'local' || $self->remotecmd;
19 return (1, $self->msg("export1")) unless @f == 2 && $f[0] =~ /^\d+$/;
23 $ref = DXMsg::get($f[0]);
24 return (1, $self->msg('read2', $msgno)) unless $ref;
26 my $m = $self->msg('e16', $fn);
27 Log('msg', $self->call . " tried to export $m");
28 dbg($m) if isdbg('msg');
32 return (1, $self->msg('e16', $fn)) if -e $fn;
34 my $s = $ref->private ? "SP " : "SB " ;
35 push @body, $s . $ref->to . " < " . $ref->from;
36 push @body, $ref->subject;
37 push @body, $ref->read_msg_body;
40 my $fh = new IO::File ">$fn";
43 print $fh map { "$_\n" } @body;
45 $m = $self->msg('export3', $msgno, $fn, $self->call);
47 $m = $self->msg('export2', $msgno, $fn, $!, $self->call);
50 dbg($m) if isdbg('msg');