use PublicInbox::Hval qw(ascii_html obfuscate_addrs mid_href);
use PublicInbox::Address;
use PublicInbox::MID qw(mid_clean);
+use PublicInbox::Config;
-sub squote_maybe ($) {
- my ($val) = @_;
- if ($val =~ m{([^\w@\./,\%\+\-])}) {
- $val =~ s/(['!])/'\\$1'/g; # '!' for csh
- return "'$val'";
- }
- $val;
-}
+*squote_maybe = \&PublicInbox::Config::squote_maybe;
sub add_addrs {
my ($to, $cc, @addrs) = @_;
my $obfs = $ibx->{obfuscate};
my $subj = $hdr->header('Subject') || '';
$subj = "Re: $subj" unless $subj =~ /\bRe:/i;
+ my $subj_raw = $subj;
my $mid = $hdr->header_raw('Message-ID');
push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));
my $irt = mid_href($mid);
}
}
+ push @arg, "--subject=".squote_maybe($subj_raw);
+
# I'm not sure if address obfuscation and mailto: links can
# be made compatible; and address obfuscation is misguided,
# anyways.