From: Eric Wong Date: Fri, 23 Jun 2017 03:39:08 +0000 (+0000) Subject: mbox: show application/mbox for obfuscated inboxes X-Git-Tag: v1.0.0~45 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;ds=sidebyside;h=31c516e54a6fd9df6122aaf3383f95ce9fc06834;hp=666844ae42b5b17fd2e9b7ea6cf04727487b5322;p=public-inbox.git mbox: show application/mbox for obfuscated inboxes Sigh, yet another place to handle obfuscation for misguided people who expect it. Maybe this will do something to prevent spammers from getting addresses, while still allowing the "curl $URL | git am" use case to work. --- diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 2565ea58..88daba75 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -12,8 +12,12 @@ require Email::Simple; sub emit1 { my ($ctx, $msg) = @_; $msg = Email::Simple->new($msg); - # single message should be easily renderable in browsers - [200, ['Content-Type', 'text/plain'], [ msg_str($ctx, $msg)] ] + + # single message should be easily renderable in browsers, + # unless obfuscation is enabled :< + [ 200, [ 'Content-Type', + $ctx->{-inbox}->{obfuscate} ? 'application/mbox' : 'text/plain' ], + [ msg_str($ctx, $msg)] ] } sub msg_str {