]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-mda
drop dependency on File::Path::Expand
[public-inbox.git] / script / public-inbox-mda
index 6ac0e8c48d82befb762d813661c8bdb01332970a..84219ac3c2531dcd9cbc98800b7e42f673d6ed2a 100755 (executable)
@@ -9,7 +9,8 @@ my $usage = 'public-inbox-mda < rfc2822_message';
 
 use Email::Filter;
 use Email::MIME;
-use File::Path::Expand qw/expand_filename/;
+use Email::MIME::ContentType;
+$Email::MIME::ContentType::STRICT_PARAMS = 0; # user input is imperfect
 use IPC::Run qw(run);
 use PublicInbox::MDA;
 use PublicInbox::Filter;
@@ -20,8 +21,7 @@ use PublicInbox::Git;
 # n.b: hopefully we can setup the emergency path without bailing due to
 # user error, we really want to setup the emergency destination ASAP
 # in case there's bugs in our code or user error.
-my $emergency = $ENV{PI_EMERGENCY} || '~/.public-inbox/emergency/';
-$emergency = expand_filename($emergency);
+my $emergency = $ENV{PI_EMERGENCY} || "$ENV{HOME}/.public-inbox/emergency/";
 
 # this reads the message from stdin
 my $filter = Email::Filter->new(emergency => $emergency);