You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/04/02 19:28:06 UTC

[whimsy] branch master updated: override text/plain based on extension

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  3342ae1   override text/plain based on extension
3342ae1 is described below

commit 3342ae1e6823fd77388056f4d46df2726d2fc67c
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun Apr 2 15:27:52 2017 -0400

    override text/plain based on extension
---
 www/secmail/models/attachment.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/secmail/models/attachment.rb b/www/secmail/models/attachment.rb
index ee2dcba..8d340c6 100644
--- a/www/secmail/models/attachment.rb
+++ b/www/secmail/models/attachment.rb
@@ -15,7 +15,7 @@ class Attachment
   def content_type
     type = headers[:mime] || @part.content_type
 
-    if type == 'application/octet-stream'
+    if type == 'application/octet-stream' or type == 'text/plain'
       type = 'text/plain' if name.end_with? '.sig'
       type = 'text/plain' if name.end_with? '.asc'
       type = 'application/pdf' if name.end_with? '.pdf'

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].

Re: [whimsy] branch master updated: override text/plain based on extension

Posted by Sam Ruby <ru...@intertwingly.net>.
On Sun, Apr 2, 2017 at 6:23 PM, Craig Russell <cr...@oracle.com> wrote:
> Just because I'm curious:
>
> Which email clients send xxx.pdf as mime-type text/plain instead of application/pdf???
>
> Sounds like a 1992 mail client. Or is there more to the story?

As with most things, there is more to the story.  Here's the basic
facts, with no value judgment:

1) The mail client self reports itself as "The Bat! (v4.2.36.4) Professional".

2) The content type for the attachment in question is "pdf".

3) Content types always have a slash in them

4) The content type for this attachment, as provided by the Ruby mail
gem, is 'text/plain'.

After many many months with the current secmail tool, we have never
seen this before.  And may never again.

- Sam Ruby



>> On Apr 2, 2017, at 12:28 PM, rubys@apache.org wrote:
>>
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> rubys pushed a commit to branch master
>> in repository https://gitbox.apache.org/repos/asf/whimsy.git
>>
>> The following commit(s) were added to refs/heads/master by this push:
>>       new  3342ae1   override text/plain based on extension
>> 3342ae1 is described below
>>
>> commit 3342ae1e6823fd77388056f4d46df2726d2fc67c
>> Author: Sam Ruby <ru...@intertwingly.net>
>> AuthorDate: Sun Apr 2 15:27:52 2017 -0400
>>
>>    override text/plain based on extension
>> ---
>> www/secmail/models/attachment.rb | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/www/secmail/models/attachment.rb b/www/secmail/models/attachment.rb
>> index ee2dcba..8d340c6 100644
>> --- a/www/secmail/models/attachment.rb
>> +++ b/www/secmail/models/attachment.rb
>> @@ -15,7 +15,7 @@ class Attachment
>>   def content_type
>>     type = headers[:mime] || @part.content_type
>>
>> -    if type == 'application/octet-stream'
>> +    if type == 'application/octet-stream' or type == 'text/plain'
>>       type = 'text/plain' if name.end_with? '.sig'
>>       type = 'text/plain' if name.end_with? '.asc'
>>       type = 'application/pdf' if name.end_with? '.pdf'
>>
>> --
>> To stop receiving notification emails like this one, please contact
>> ['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].
>
> Craig L Russell
> Architect
> craig.russell@oracle.com
> P.S. A good JDO? O, Gasp!
>
>
>
>
>

Re: [whimsy] branch master updated: override text/plain based on extension

Posted by Craig Russell <cr...@oracle.com>.
Just because I'm curious:

Which email clients send xxx.pdf as mime-type text/plain instead of application/pdf???

Sounds like a 1992 mail client. Or is there more to the story?


> On Apr 2, 2017, at 12:28 PM, rubys@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> rubys pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/whimsy.git
> 
> The following commit(s) were added to refs/heads/master by this push:
>       new  3342ae1   override text/plain based on extension
> 3342ae1 is described below
> 
> commit 3342ae1e6823fd77388056f4d46df2726d2fc67c
> Author: Sam Ruby <ru...@intertwingly.net>
> AuthorDate: Sun Apr 2 15:27:52 2017 -0400
> 
>    override text/plain based on extension
> ---
> www/secmail/models/attachment.rb | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/www/secmail/models/attachment.rb b/www/secmail/models/attachment.rb
> index ee2dcba..8d340c6 100644
> --- a/www/secmail/models/attachment.rb
> +++ b/www/secmail/models/attachment.rb
> @@ -15,7 +15,7 @@ class Attachment
>   def content_type
>     type = headers[:mime] || @part.content_type
> 
> -    if type == 'application/octet-stream'
> +    if type == 'application/octet-stream' or type == 'text/plain'
>       type = 'text/plain' if name.end_with? '.sig'
>       type = 'text/plain' if name.end_with? '.asc'
>       type = 'application/pdf' if name.end_with? '.pdf'
> 
> -- 
> To stop receiving notification emails like this one, please contact
> ['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].

Craig L Russell
Architect
craig.russell@oracle.com
P.S. A good JDO? O, Gasp!