Skip to content

Commit

Permalink
Merge pull request #279 from mknos/mail-mbox-write
Browse files Browse the repository at this point in the history
mail can't write to mbox
  • Loading branch information
briandfoy authored Oct 4, 2023
2 parents b58e3a7 + aa477e4 commit d1ef74c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bin/mail
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,10 @@ sub write {
my $self=shift;
my $wa=shift;

$of=">" . $self->file;
if (exists $$wa{append} ) {
$of=">$of";
}
my $mode = exists $$wa{append} ? '>>' : '>';
my $alt_msg="\"" . $self->file . "\" ";
$alt_msg.=(-e $self->file)?"[Appended]":"[New File]";
if (! open(MBOX, '<', $of )) {
if (!open(MBOX, $mode, $self->file)) {
warn "Failed to write to ", $self->file, ": $!\n";
return;
}
Expand Down

0 comments on commit d1ef74c

Please sign in to comment.