Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long filenames are not supported #31

Closed
dxdc opened this issue Oct 9, 2016 · 3 comments · Fixed by #51
Closed

Long filenames are not supported #31

dxdc opened this issue Oct 9, 2016 · 3 comments · Fixed by #51

Comments

@dxdc
Copy link
Contributor

dxdc commented Oct 9, 2016

Long filenames are allowed per RFC 2231.

For example:

Content-Disposition: attachment;
    filename*0="Blank App to Rent _ Application to Rent Screening Fee #1 - 4 03.";
    filename*1=pdf
Content-Type: application/pdf;
    name*0="Blank App to Rent _ Application to Rent Screening Fee #1 - 4 03.";
    name*1=pdf
Content-Transfer-Encoding: base64

However, these extended filenames are not properly returned via the Email::MIME module (or, appropriate submodule). These extended filenames can also become more complex, since character encoding, etc. can be specified as part of the filename. See RFC 2231 for more details (https://tools.ietf.org/html/rfc2231).

There is another module which appears to handle this properly:
http://cpansearch.perl.org/src/MURATAYA/MIME-EcoEncode-0.95/lib/MIME/EcoEncode/Param.pm

@pali
Copy link
Contributor

pali commented May 3, 2017

This pull request rjbs/Email-MIME-ContentType#5 adds support for RFC 2231 (Character Set and Parameter Continuations). Email::MIME::ContentType is used just for parsing structures.

@pali
Copy link
Contributor

pali commented Aug 6, 2017

Pull request rjbs/Email-MIME-ContentType#5 was merged and released in Email::MIME::ContentType version 1.020.

So after updating that module, Email::MIME would correctly parse long file names.

But creating new email with long file names via Email::MIME is not supported yet.

pali added a commit to pali/Email-MIME that referenced this issue Sep 5, 2017
…mail::MIME::ContentType

New version of Email::MIME::ContentType would have functions for composing
Content-Type and Content-Disposition headers.

As a bonus they support Unicode strings encoded to UTF-8 according to
RFC 2231. Therefore Email::MIME can set Unicode file name for the
attachment.

Some tests were slightly modified as attributes do not have to be always
quoted and Email::MIME::ContentType do it only if needed.

Fixes rjbs#18
Fixes rjbs#31
@pali
Copy link
Contributor

pali commented Sep 5, 2017

Patches for creating long file names are there: rjbs/Email-MIME-ContentType#11 #51

pali added a commit to pali/Email-MIME that referenced this issue Sep 16, 2017
…mail::MIME::ContentType

New version of Email::MIME::ContentType would have functions for composing
Content-Type and Content-Disposition headers.

As a bonus they support Unicode strings encoded to UTF-8 according to
RFC 2231. Therefore Email::MIME can set Unicode file name for the
attachment.

Some tests were slightly modified as attributes do not have to be always
quoted and Email::MIME::ContentType do it only if needed.

Fixes rjbs#18
Fixes rjbs#31
@rjbs rjbs closed this as completed in #51 May 9, 2020
rjbs pushed a commit that referenced this issue May 9, 2020
…mail::MIME::ContentType

New version of Email::MIME::ContentType would have functions for composing
Content-Type and Content-Disposition headers.

As a bonus they support Unicode strings encoded to UTF-8 according to
RFC 2231. Therefore Email::MIME can set Unicode file name for the
attachment.

Some tests were slightly modified as attributes do not have to be always
quoted and Email::MIME::ContentType do it only if needed.

Fixes #18
Fixes #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants