Community Discussions and Support
attachment with the identifier filename*=UTF-8''

I’ve recently started receiving emails where the attachment isn’t recognised. It just shows up as [Type unknown]. The "raw view" shows:
Content-Disposition: attachment;
filename*=UTF-8''Geb%C3%A4ude.pdf
The attachment displays correctly in Thunderbird and Outlook. According to a forum, the RFC 5987/8187 standard hasn’t been implemented. Has anyone else had similar problems?


Even the latest Pegasus Mail Version 4.91.1746 has this problem!


I’ve recently started receiving emails where the attachment isn’t recognised. It just shows up as [Type unknown]. The "raw view" shows: Content-Disposition: attachment; filename*=UTF-8''Geb%C3%A4ude.pdf The attachment displays correctly in Thunderbird and Outlook. According to a forum, the RFC 5987/8187 standard hasn’t been implemented. Has anyone else had similar problems? Even the latest Pegasus Mail Version 4.91.1746 has this problem!

A .pdf document should be assigned as such in the Content-type header for the attachment (eg: Content-type: application/pdf). My guess is that yours is defined as "application-octet stream" which is a generic MIME definition that has become increasing common for .pdf attachments. Pegasus Mail only looks at this header for determining attachment file type so is clueless what an "application-octet stream" attachment might be. The best workaround I have found to the "Type unknown" attachment type is to make Pegasus Mail display "See-filename" instead. This is done by adding the following entry to the mime-map.pm file located in the \Programs directory of the Pegasus Mail installation.


application/octet-stream = See-filename


I also suggest adding this line for content type definitions that are defined as application/pdf


application/pdf = PDF-document


The mime-map.pm file is a plain text file so can be edited with a text editor. Instructions about its usage are in the file itself. This is what mine contains (note the additional entry for HTML text, which is optional):


==============
;
; Pegasus Mail MIME Mapping file.
; This file is used to add MIME content-type mappings into Pegasus Mail
;
; Each line in the file defines a bi-directional mapping between a MIME
; content type on the left and a Pegasus Mail attachment type on the
; right.
;
; When you add an attachment to a message, WinPMail will look through
; this file looking for an attachment type match; when it finds one, it
; will write the attachment using that MIME content type.
;
; When looking for viewers, Pegasus Mail performs the reverse of the
; same search, looking for a line containing a content type that matches
; the one used to send the file; if it finds one, it searches its list
; of attachment viewers for the attachment type defined on the same line.
;
; The format of this file is:
;
; content_type = attachment_type
;


Text/HTML = HTML-text
application/pdf = PDF-document
application/octet-stream = See-filename


==============


A .pdf document should be assigned as such in the Content-type header for the attachment (eg: Content-type: application/pdf). My guess is that yours is defined as "application-octet stream" which is a generic MIME definition that has become increasing common for .pdf attachments. Pegasus Mail only looks at this header for determining attachment file type so is clueless what an "application-octet stream" attachment might be. The best workaround I have found to the "Type unknown" attachment type is to make Pegasus Mail display "See-filename" instead. This is done by adding the following entry to the mime-map.pm file located in the \Programs directory of the Pegasus Mail installation. application/octet-stream = See-filename I also suggest adding this line for content type definitions that are defined as application/pdf application/pdf = PDF-document The mime-map.pm file is a plain text file so can be edited with a text editor. Instructions about its usage are in the file itself. This is what mine contains (note the additional entry for HTML text, which is optional): ============== ; ; Pegasus Mail MIME Mapping file. ; This file is used to add MIME content-type mappings into Pegasus Mail ; ; Each line in the file defines a bi-directional mapping between a MIME ; content type on the left and a Pegasus Mail attachment type on the ; right. ; ; When you add an attachment to a message, WinPMail will look through ; this file looking for an attachment type match; when it finds one, it ; will write the attachment using that MIME content type. ; ; When looking for viewers, Pegasus Mail performs the reverse of the ; same search, looking for a line containing a content type that matches ; the one used to send the file; if it finds one, it searches its list ; of attachment viewers for the attachment type defined on the same line. ; ; The format of this file is: ; ; content_type = attachment_type ; Text/HTML = HTML-text application/pdf = PDF-document application/octet-stream = See-filename ==============

Just for info.
c3a4;LATIN SMALL LETTER A WITH DIAERESIS (U+00E4)


Don't know if FILETYPE.PM is used in this?
Mine has
PDF-FILE,0,S,1,PDF,X,0,.PDF
PDF-file,0,X,0,.pdf


Just for info. c3a4;LATIN SMALL LETTER A WITH DIAERESIS (U+00E4) Don't know if FILETYPE.PM is used in this? Mine has PDF-FILE,0,S,1,PDF,X,0,.PDF PDF-file,0,X,0,.pdf

mikes@guam.net

FILETYPE.PM is used for defining outgoing attachments. The Pegasus Mail Help and manual indicate that there should be a corresponding entries in FILETYPE and MIME-MAP but I have not found that to be necessary. Admittedly, those entries in FILETYPE.PM are likely worthwhile to the recipients of attached .pdf files.


FILETYPE.PM is used for defining outgoing attachments. The Pegasus Mail Help and manual indicate that there should be a corresponding entries in FILETYPE and MIME-MAP but I have not found that to be necessary. Admittedly, those entries in FILETYPE.PM are likely worthwhile to the recipients of attached .pdf files.

If I add “application/pdf = PDF document” to the mime-map.pm file, Pegasus displays “PDF document” instead of “Type unknown.”
To open the attachment automatically, you need to create an entry for “PDF document” under “Tools -> Options...” in the “Content viewers” section:
69dcbff83ad7a


Is this option also available for Mercury?
Unfortunately, the “Filterung set" -> Check the extension portion if it contains "pdf", doesn't detect PDF attachments here either.


Thanks in advance for the tip about the mime-map.pm file.


If I add “application/pdf = PDF document” to the mime-map.pm file, Pegasus displays “PDF document” instead of “Type unknown.” To open the attachment automatically, you need to create an entry for “PDF document” under “Tools -> Options...” in the “Content viewers” section: ![69dcbff83ad7a](serve/attachment&path=69dcbff83ad7a) Is this option also available for Mercury? Unfortunately, the “Filterung set" -> Check the extension portion if it contains "pdf", doesn't detect PDF attachments here either. Thanks in advance for the tip about the mime-map.pm file.

If I add “application/pdf = PDF document” to the mime-map.pm file, Pegasus displays “PDF document” instead of “Type unknown.”


This was the global solution when pdf attachments were reliably defined as such. Unfortunately, the trend of defining them as application/octet-stream causes them to not be detectable as pdf documents.


In you Content viewer, I suggest checking the Filename extension rather than the attachment type info.


69dce9197793b


Regarding Mercury, what exactly are you trying to accomplish? I know that Mercury can detect attachment file types because I used to block ones that were potentially hazardous. That was many years ago though. I think I have forgotten more than I remember about Mercury. This might be a question to post in the Mercury category on this forum.


[quote="pid:58854, uid:2277"]If I add “application/pdf = PDF document” to the mime-map.pm file, Pegasus displays “PDF document” instead of “Type unknown.”[/quote] This was the global solution when pdf attachments were reliably defined as such. Unfortunately, the trend of defining them as application/octet-stream causes them to not be detectable as pdf documents. In you Content viewer, I suggest checking the Filename extension rather than the attachment type info. ![69dce9197793b](serve/attachment&path=69dce9197793b) Regarding Mercury, what exactly are you trying to accomplish? I know that Mercury can detect attachment file types because I used to block ones that were potentially hazardous. That was many years ago though. I think I have forgotten more than I remember about Mercury. This might be a question to post in the Mercury category on this forum.

Just as an FYI...


This is an example of a pdf attachment defined with a Content-Type of application/octet-stream:


69dcf5a4433f9


This is how that attachment is listed in the Attachments tab of my Pegasus Mail:


69dcf5fd60495


Just as an FYI... This is an example of a pdf attachment defined with a Content-Type of application/octet-stream: ![69dcf5a4433f9](serve/attachment&path=69dcf5a4433f9) This is how that attachment is listed in the Attachments tab of my Pegasus Mail: ![69dcf5fd60495](serve/attachment&path=69dcf5fd60495)

Wondering if adding a viewer?


69dd3f3b4c081


Click add and enter the type. application/octet-stream.
There is no listing for it, so adding it might work, don't know what would happen if there was a application/octet-stream that wasn't a PDF file?


Wondering if adding a viewer? ![69dd3f3b4c081](serve/attachment&path=69dd3f3b4c081) Click add and enter the type. application/octet-stream. There is no listing for it, so adding it might work, don't know what would happen if there was a application/octet-stream that wasn't a PDF file?

mikes@guam.net

Thought it would modify
MIME-MAP.PM in C:\PMAIL\Programs but it just ends with
Text/HTML = HTML-text
application/pdf = PDF-document


The VIEWER.PM in C:\PMAIL\Programs is also unchanged.


The VIEWER.PM in user mail directory is changed.
VIEWER.PM | grep -i pdf shows these lines with pdf


1;.pdf;-;/usr/bin/pegattach
2;application/octet-stream;.pdf;-


Thought it would modify MIME-MAP.PM in C:\PMAIL\Programs but it just ends with Text/HTML = HTML-text application/pdf = PDF-document The VIEWER.PM in C:\PMAIL\Programs is also unchanged. The VIEWER.PM in user mail directory is changed. VIEWER.PM | grep -i pdf shows these lines with pdf 1;.pdf;-;/usr/bin/pegattach 2;application/octet-stream;.pdf;-

mikes@guam.net

I don't believe Windows has any program associated with the MIME type of "application/octet-stream" so defining a viewer for that attachment type would certainly need a program command line to invoke. Unfortunately there are other file types that are defined as "application/octet-stream". A search of my mail for the last 365 days revealed these:


.GPX
.PDF
.KEY


Based on that, I don't think a viewer for attachment type "application/octet-stream" that invoked a PDF reader would be wise.


Also, adding content viewers only adds entries to the VIEWER.PM file of the Pegasus Mail user who is adding the entry. This is why the addition appeared in the VIEWER.PM file located in the mailbox directory. When looking at the list of content viewers, entries in blue are global (from the VIEWER.PM in \Programs) while entries in black are user specific (from the VIEWER.PM in the mailbox directory).


I don't believe Windows has any program associated with the MIME type of "application/octet-stream" so defining a viewer for that attachment type would certainly need a program command line to invoke. Unfortunately there are other file types that are defined as "application/octet-stream". A search of my mail for the last 365 days revealed these: .GPX .PDF .KEY Based on that, I don't think a viewer for attachment type "application/octet-stream" that invoked a PDF reader would be wise. Also, adding content viewers only adds entries to the VIEWER.PM file of the Pegasus Mail user who is adding the entry. This is why the addition appeared in the VIEWER.PM file located in the mailbox directory. When looking at the list of content viewers, entries in blue are global (from the VIEWER.PM in \Programs) while entries in black are user specific (from the VIEWER.PM in the mailbox directory).

Based on that, I don't think a viewer for attachment type "application/octet-stream" that invoked a PDF reader would be wise.


Here's the definition of this type , based on RFCs, listed on the media-type database of the Internet Assigned Numbers Authority, starting with:



The "octet-stream" subtype is used to indicate that a body contains
arbitrary binary data.



[quote="pid:58859, uid:28772"]Based on that, I don't think a viewer for attachment type "application/octet-stream" that invoked a PDF reader would be wise.[/quote] Here's [the definition of this type](https://www.iana.org/assignments/media-types/application/octet-stream) , based on RFCs, listed on the _media-type_ database of the _Internet Assigned Numbers Authority_, starting with: > The "octet-stream" subtype is used to indicate that a body contains arbitrary binary data.
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

Perhaps I'm not looking at this correct.


  1. Current situation is that the PDF attachment is not working at all?

  2. Adding this might work having the document passed to windows pdf viewer.(Did think of having it use the .pdf extension of file as an option).


It is true that if some other file of this mime type is passed the viewer would fail to open it?


Has anyone gotten one of the GFX attachments sent? And wouldn't they have same issue with viewing it?
A GPX file (GPS Exchange Format) is a universal text file used to store and share geographic data, such as waypoints, tracks, and routes, between GPS devices, maps, and software.


A .key file is most commonly a Keynote Presentation file created by Apple's Keynote software, used for slideshows on macOS, iOS, and iCloud.


Don't know if there is a windows keynote viewer?


The FILETYPE.PM file on my setup has
PDF-FILE,0,S,1,PDF,X,0,.PDF
PDF-file,0,X,0,.pdf


So, it can identify a PDF file by the extension or bytes 2 3 4 are P D F.


Don't know if there would be a way to have the mime type to a similar check on the file to confirm that it was or wasn't a PDF?


I've had to do a program for Pegasus to work with some attachment on linux under wine to work. Generally, pretty generic, and seems to work


1;.WMV;-;Z:\usr\bin\pegattach
1;.doc;-;Z:\usr\bin\pegattach
1;.docx;-;Z:\usr\bin\pegattach
1;.pdf;-;/usr/bin/pegattach
1;.ods;-;/usr/bin/pegattach
1;.wpd;-;/usr/bin/pegattach
1;.wav;-;Z:\usr\bin\pegattach
1;.xlsx;-;Z:\usr\bin\pegattach
1;.xls;-;Z:\usr\bin\pegattach
1;.odt;-;Z:\usr\bin\pegattach
1;.mpv;-;Z:\usr\bin\pegattach
2;MPEG4-video-file;-;Z:\usr\bin\pegattach


The script has worked for me, basically passes modified link to gnome-open, which would be similar to having windows use its default viewer. Could add code to check for PDF as characters at 2nd character of attachment,


cat /usr/bin/pegattach


!/bin/sh


cd ~
echo $1 Value of $1 >>/tmp/pegattach
if [ "echo $1 | cut -b 1-1" = "/" ]; then
p1=echo $1 | cut -b 2-120
else
p1=$1
fi
echo "[" $p1 "]" >>/tmp/pegattach
if [ echo $p1 | cut -b 1-1 = C ]; then
{
echo .wine/drive_c/echo $p1 | cut -b 4-120 | sed -e 's:\\\:/:g' >>/tmp/pegattach
gnome-open "/home/msetzerii/.wine/drive_c/echo $p1 | cut -b 4-120 | sed -e 's:\\\:/:g'"
}
else
{
xtest=echo $p1 | cut -b 3-120 | sed -e 's:\\\:/:g'
echo $xtest >>/tmp/pegattach
gnome-open "$xtest" 2>>/tmp/pegattach
}
fi


Don't recall ever getting a PDF file with this encoding, so don't know for sure this would work.


Just looking for option that might make it work.


Perhaps I'm not looking at this correct. 1. Current situation is that the PDF attachment is not working at all? 2. Adding this might work having the document passed to windows pdf viewer. (Did think of having it use the .pdf extension of file as an option). It is true that if some other file of this mime type is passed the viewer would fail to open it? Has anyone gotten one of the GFX attachments sent? And wouldn't they have same issue with viewing it? A GPX file (GPS Exchange Format) is a universal text file used to store and share geographic data, such as waypoints, tracks, and routes, between GPS devices, maps, and software. A .key file is most commonly a Keynote Presentation file created by Apple's Keynote software, used for slideshows on macOS, iOS, and iCloud. Don't know if there is a windows keynote viewer? The FILETYPE.PM file on my setup has PDF-FILE,0,S,1,PDF,X,0,.PDF PDF-file,0,X,0,.pdf So, it can identify a PDF file by the extension or bytes 2 3 4 are P D F. Don't know if there would be a way to have the mime type to a similar check on the file to confirm that it was or wasn't a PDF? I've had to do a program for Pegasus to work with some attachment on linux under wine to work. Generally, pretty generic, and seems to work 1;.WMV;-;Z:\usr\bin\pegattach 1;.doc;-;Z:\usr\bin\pegattach 1;.docx;-;Z:\usr\bin\pegattach 1;.pdf;-;/usr/bin/pegattach 1;.ods;-;/usr/bin/pegattach 1;.wpd;-;/usr/bin/pegattach 1;.wav;-;Z:\usr\bin\pegattach 1;.xlsx;-;Z:\usr\bin\pegattach 1;.xls;-;Z:\usr\bin\pegattach 1;.odt;-;Z:\usr\bin\pegattach 1;.mpv;-;Z:\usr\bin\pegattach 2;MPEG4-video-file;-;Z:\usr\bin\pegattach The script has worked for me, basically passes modified link to gnome-open, which would be similar to having windows use its default viewer. Could add code to check for PDF as characters at 2nd character of attachment, cat /usr/bin/pegattach #!/bin/sh cd ~ echo $1 Value of $1 >>/tmp/pegattach if [ "`echo $1 | cut -b 1-1`" = "/" ]; then p1=`echo $1 | cut -b 2-120` else p1=$1 fi echo "[" $p1 "]" >>/tmp/pegattach if [ `echo $p1 | cut -b 1-1` = C ]; then { echo .wine/drive_c/`echo $p1 | cut -b 4-120 | sed -e 's:\\\:/:g' ` >>/tmp/pegattach gnome-open "/home/msetzerii/.wine/drive_c/`echo $p1 | cut -b 4-120 | sed -e 's:\\\:/:g' `" } else { xtest=`echo $p1 | cut -b 3-120 | sed -e 's:\\\:/:g' ` echo $xtest >>/tmp/pegattach gnome-open "$xtest" 2>>/tmp/pegattach } fi Don't recall ever getting a PDF file with this encoding, so don't know for sure this would work. Just looking for option that might make it work.

mikes@guam.net

Perhaps I'm not looking at this correct.


Current situation is that the PDF attachment is not working at all?


Hmmm... Maybe I misunderstood the OP because I interpreted it as a request for help with "Type unknown" in the Type column of the Attachment pane.


[quote="pid:58861, uid:2546"]Perhaps I'm not looking at this correct. Current situation is that the PDF attachment is not working at all?[/quote] Hmmm... Maybe I misunderstood the OP because I interpreted it as a request for help with "Type unknown" in the Type column of the Attachment pane.

I could also be wrong. I was assuming that question was asked since the attachment was not opening the pdf since it wasn't actually seeing it as a PDF.


Know I've gotten some emails with attachments that don't have a viewer.


So, could be 50/50.


I could also be wrong. I was assuming that question was asked since the attachment was not opening the pdf since it wasn't actually seeing it as a PDF. Know I've gotten some emails with attachments that don't have a viewer. So, could be 50/50.

mikes@guam.net

Everything works fine in Pegasus if I add the two lines to the mime-map.pm and viewer.pm files.
But the real problem lies elsewhere:
Normally, Pegasus opens PDF files in attachments without any issues. It recognizes the “.PDF” file extension and opens the file in the appropriate viewer.
But recently, Pegasus sometimes fails to recognize the filename in emails because it is encoded in UTF-8. As mentioned above, the attachment is preceded by:


------=_Part_32737_887250361.1775626763872
Content-Type: application/pdf;
name=UTF-8''Geb%C3%A4ude.pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename
=UTF-8''Geb%C3%A4ude.pdf


Because the filename is UTF-8 encoded, the file extension is not recognized!


Everything works fine in Pegasus if I add the two lines to the mime-map.pm and viewer.pm files. But the real problem lies elsewhere: Normally, Pegasus opens PDF files in attachments without any issues. It recognizes the “.PDF” file extension and opens the file in the appropriate viewer. But recently, Pegasus sometimes fails to recognize the filename in emails because it is encoded in UTF-8. As mentioned above, the attachment is preceded by: ------=_Part_32737_887250361.1775626763872 Content-Type: application/pdf; name*=UTF-8''Geb%C3%A4ude.pdf Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*=UTF-8''Geb%C3%A4ude.pdf Because the filename is UTF-8 encoded, the file extension is not recognized!

Because the filename is UTF-8 encoded, the file extension is not recognized!


Ah, thanks for the clarification. I have not seen this before. It appears that the encoding is there to handle a "ä" character in the filename.


I'm wondering if attempts to open it fail because Pegasus Mail is trying to write it to a temporary file but can't due to that encoded file name.


How do you know that Pegasus Mail fails to recognize the filename?


What is displayed in the "File name" column in the Attachment tab?


[quote="pid:58864, uid:2277"]Because the filename is UTF-8 encoded, the file extension is not recognized![/quote] Ah, thanks for the clarification. I have not seen this before. It appears that the encoding is there to handle a "ä" character in the filename. I'm wondering if attempts to open it fail because Pegasus Mail is trying to write it to a temporary file but can't due to that encoded file name. How do you know that Pegasus Mail fails to recognize the filename? What is displayed in the "File name" column in the Attachment tab?

A test would be.
With Pegasus closed
open the correct CNM file and change the %C3%A4 to just a single regular "a".
Save the CNM.
Then open Pegasus and see it it opens the PDF attachment.
If so, it is the UTF encoded symbol.
If it still doesn't open, it is the octet-streaming mime.


A test would be. With Pegasus closed open the correct CNM file and change the %C3%A4 to just a single regular "a". Save the CNM. Then open Pegasus and see it it opens the PDF attachment. If so, it is the UTF encoded symbol. If it still doesn't open, it is the octet-streaming mime.

mikes@guam.net

Even if I change the name to Gebaude.pdf, the name isn't recognized. The following attachments always appears:
69df5db188d1d


The error is likely due to the incorrect identifier: filename*=UTF-8''. This is the standard for HTTP (RFC 5987 / 6266). For email, you should use filename="=?UTF-8?Q?...?=". Unfortunately, there is apparently software that does not adhere to this.
Since Outlook and Thunderbird recognize the attachment correctly, this identifier will continue to be used in the future.
It would therefore be good if this recognition were also implemented in Pegasus.


Even if I change the name to Gebaude.pdf, the name isn't recognized. The following attachments always appears: ![69df5db188d1d](serve/attachment&path=69df5db188d1d) The error is likely due to the incorrect identifier: filename*=UTF-8''. This is the standard for HTTP (RFC 5987 / 6266). For email, you should use filename="=?UTF-8?Q?...?=". Unfortunately, there is apparently software that does not adhere to this. Since Outlook and Thunderbird recognize the attachment correctly, this identifier will continue to be used in the future. It would therefore be good if this recognition were also implemented in Pegasus.

Question? Since you have been able to see the attachment?


  1. Is the attachment / email something that could be shared as is for testing??Most of my emails with issues have just been Spam, or messages from Ebay or Amazon that have wierd tracking lines.If you could bounce it to my mikes (at) guam.net account, I'd be interested in trying to figure something out.

  2. If it isn't something that could be shared as is, could you have preson that sent it to you, created a similar email that would contain a similar pdf that is generic.


Seems that the issue is the octet-stream tag that is the problem.


Would be very interesting to find a solution.
Updating one for the attacment files, or even a process to change the tag to the correct pdf one in the CNM file.


Question? Since you have been able to see the attachment? 1. Is the attachment / email something that could be shared as is for testing?? Most of my emails with issues have just been Spam, or messages from Ebay or Amazon that have wierd tracking lines. If you could bounce it to my mikes (at) guam.net account, I'd be interested in trying to figure something out. 2. If it isn't something that could be shared as is, could you have preson that sent it to you, created a similar email that would contain a similar pdf that is generic. Seems that the issue is the octet-stream tag that is the problem. Would be very interesting to find a solution. Updating one for the attacment files, or even a process to change the tag to the correct pdf one in the CNM file.

mikes@guam.net

12
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft