Comments (4)
I have found out that this problem also depends on the mail client. The original email source looks like this:
Content-Disposition:` attachment; filename="
Filename_debug_customer_date_20160322_114204.csv"
While the file is correctly displayed in thunderbird, Outlook shows the file as "_Filename_debug_customer_date_20160322_114204.csv".
The file contains simple csv text data, the filename is set exactly as above, but without newline or spaces in front.
Following another example of with an empty file attached:
Short name (works perfectly fine):
Content-Type: application/x-empty
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foobar.csv"
Long name (adds a new line and two white spaces or tab):
Content-Type: application/x-empty
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="
foobar_foobar_foobar_foobar_foobar_foobar_foobar_foobar_.csv"
from mail.
@xsuchy09 Thanks for the analysis and solution.
from mail.
What contains the $file
when you add it by addAttachment()
? The name is sanitized here.
from mail.
I can confirm this bug. For example PDF software is opening PDF file as attachment with %09
at the beginning of the filename - because of tab which is added in MimePart:append
called from MimePart:encodeHeader
which is called from MimePart:getEncodedHeader
. When file is saving Ubuntu save it with -
at the beginning. Attachment is added like:
Content-Disposition: attachment; filename="
invoice-7lQYGxp6er2Dpb28ZdDvPOoML.pdf"
Solution is to add it like:
Content-Disposition: attachment; filename=
"invoice-7lQYGxp6er2Dpb28ZdDvPOoML.pdf"
or don't fold header lines which is not specified in RFC. It is just good use case for terminal clients ofc.
More info in czech language:
https://forum.nette.org/cs/31371-email-prilozeny-soubor-a-podivne-09-pred-nazvem-souboru#p208896
from mail.
Related Issues (20)
- Custom File Name HOT 2
- SMTP server did not accept STARTTLS with error: 503 5.5.2 Send hello first HOT 12
- Spam report: BASE64_LENGTH_79_INF HOT 1
- $mail-addTo($email) can array? HOT 1
- SMTP login with blank password
- UTF8 in attachment filename is not encoded HOT 11
- Envelope address passed to sendmail HOT 3
- Backtrack limit was exhausted with base64 encoded image HOT 2
- Message serializator HOT 2
- Only variables should be passed by reference HOT 1
- Undefined variable $response in EHLO exception in SmtpMailer
- Type error in Message->getPriority()
- imgName(1).jpg on embedded
- Support self-signed certificates HOT 2
- To: undisclosed-recipients HOT 2
- SendmailMailer: Impossible to set commandArgs HOT 1
- IMAP wrapper rewrite request HOT 1
- [Documentation] HOT 1
- Unable to send email using SendmailMailer in v4.0.2 HOT 6
- Embed file are not catched
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mail.