commit 17743f4455b52e3e6eed78d168f5f930d0a9942d from: Caleb Stein date: Thu Jun 4 20:48:18 2026 UTC run addrcache in a separate process to not block commit - 04187ec12a00a67f5de0e0391f18eba3244d0876 commit + 17743f4455b52e3e6eed78d168f5f930d0a9942d blob - 2bae5b33783bc75d8477e2effe7995b4f1bbf6b7 blob + 7b803620d5db63bb812ed12cb85c78175c3418c8 --- mailread.pl +++ mailread.pl @@ -4,10 +4,20 @@ use strict; use IPC::Run3; my ($headers, $body) = do { local $/; <> } =~ /(^(.*?\n)\n(.*)$)/s ? ($2, $3) : ('', $1); -run3(['addrcache'], \$headers, undef, undef); - my $ishtml = qr/< *(?:html|head|body|div|table|p|span|br) *\/?>/i; +my $pid = fork(); +if ($pid == 0) +{ + my $addrcache_pid = open my $addrcache_fh, '|-', '/usr/local/bin/addrcache'; + die "Failed to start addrcache: $!" if !defined $addrcache_pid; + + print $addrcache_fh $headers; + close $addrcache_fh; + + exit 0; +} + run3(['lynx', '-dump', '-force_html', '-stdin'], \$body, \$body, undef) if ($body =~ $ishtml); print "$headers\n"; {