Giter VIP home page Giter VIP logo

zend-mime's People

Contributors

akrabat avatar bakura10 avatar blanchonvincent avatar dasprid avatar davidwindell avatar evandotpro avatar ezimuel avatar freeaqingme avatar jonathanmaron avatar keradus avatar kokspflanze avatar koopzington avatar maks3w avatar marc-mabe avatar michalbundyra avatar mikaelkael avatar mpinkston avatar mwillbanks avatar ocramius avatar padraic avatar prolic avatar ralphschindler avatar samsonasik avatar sgehrig avatar thinkscape avatar thomasweidner avatar vahid-sohrabloo avatar veewee avatar wdalmut avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zend-mime's Issues

Mime::encodeQuotedPrintableHeader breaks Zend_Mail's parsing if encoding is needed and there are multiple recipients

The following code illustrates the weirdness:

<?php

require_once __DIR__.'/vendor/autoload.php';
use Zend\Mime\Mime;

$str = '=?iso-8859-1?Q?Jorgen?= <[email protected]>,=?iso-8859-1?Q?Schmorgen?= <[email protected]>';
$header = iconv_mime_decode($str);

$encoded = Mime::encodeQuotedPrintableHeader($header, 'UTF-8', 78, "\r\n");
echo $encoded;

The output:

=?UTF-8?Q?Jorgen=20<[email protected]>,Schmorgen=20<[email protected]>?=

This is a problem now that zend-mail explodes the whole encoded string on a comma to due to this:
zendframework/zend-mail#44
Which results in the prefix and suffix being split up, breaking the parsing of the header.

The RFCs don't seem to be clear about whether the header field separator is allowed in the middle of a quoted-printable string, but do say that it should only be used if necessary for a given token.

A logical bug occurs while splitting header field

According to https://tools.ietf.org/html/rfc5322, the following email address example is completely ok:

"Some Name" <[email protected]>

But when you pass this value to Zend\Mime\Decoder::splitHeaderField(); it returns a wrong value because of a logical bug in the code (Line #181, the condition is not correct for all cases):

Expected results

"Some Name" <[email protected]>

Actual results

"Some Name" <[email protected]

So, in the actual result, the last character is missing.


I would like to create a merge request with valid tests if you think this should be fixed.

Cant install zend-mail, because zend-mime depends on zend-stdlib: ~2.5

I have installed zend-stdlib 3.0.
Running composer require zendframework/zend-mail I get

Using version ^2.6 for zendframework/zend-mail
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install zendframework/zend-mail 2.6.1
    - Conclusion: remove zendframework/zend-stdlib 3.0.0
    - Installation request for zendframework/zend-mail ^2.6 -> satisfiable by zendframework/zend-mail[2.6.0, 2.6.1].
    - Conclusion: don't install zendframework/zend-stdlib 3.0.0
    - zendframework/zend-mail 2.6.0 requires zendframework/zend-mime ^2.5 -> satisfiable by zendframework/zend-mime[2.5.0, 2.5.1].
    - zendframework/zend-mime 2.5.0 requires zendframework/zend-stdlib ~2.5.0 -> satisfiable by zendframework/zend-stdlib[2.5.0, 2.5.1, 2.5.2].
    - zendframework/zend-mime 2.5.1 requires zendframework/zend-stdlib ~2.5 -> satisfiable by zendframework/zend-stdlib[2.5.0, 2.5.1, 2.5.2, 2.6.0, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6].
    - Can only install one of: zendframework/zend-stdlib[2.5.0, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.5.1, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.5.2, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.6.0, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.0, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.1, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.2, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.3, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.4, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.5, 3.0.0].
    - Can only install one of: zendframework/zend-stdlib[2.7.6, 3.0.0].
    - Installation request for zendframework/zend-stdlib == 3.0.0.0 -> satisfiable by zendframework/zend-stdlib[3.0.0].

Attachments can not be seperated from mail body correctly

I try to get Attachments from a message but i allways get error:

2016-12-30T15:46:09+00:00 CRIT (2): Something went wrong: Line "Received: (qmail 5233 invoked from network); 30 Dec 2016 16:46:09 +0100
X-Fcrdns: Yes
Received: from xxxxxxxxx.adsl.highway.telekom.at (HELO [xxx.xxx.xxx.xxx]) (xxx.xxx.xxx.xxx)
(smtp-auth username [email protected], mechanism plain)
by server.de (qpsmtpd/0.92) with (ECDHE-RSA-AES256-SHA encrypted) ESMTPSA; Fri, 30 Dec 2016 16:46:09 +0100
To: [email protected]
From: sssssd ddddn [email protected]
Subject: testmail
Organization: ddddddddddddddddddd
Message-ID: 5114d274-dde3-2ca5-6c9d-3bd59f59065a@ddddddddd
Date: Fri, 30 Dec 2016 16:46:04 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.1
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="------------3FE86778A6885A966DF16AC3"
X-User-Auth: Auth by [email protected] through xxx.xxx.xxx.xxx" does not match header format!

It's identical to zendframework/zendframework#2606 which is closed.

$rawMsg = preg_replace('~\R~u', "\r\n", $rawMsg);

seems to be a quickfix, the mail can then be parsed, but the filenames cannot be read and are empty on the attachment object.

This is my sourcecode to split the message which comes from stdin.

        $rawMsg = preg_replace('~\R~u', "\r\n", $rawMsg);
        $message = new \Zend\Mail\Message();
        $headers = null;
        $content = null;

        \Zend\Mime\Decode::splitMessage($rawMsg, $headers, $content, \Zend\Mail\Headers::EOL);     
        $boundary = $headers->get('contenttype')->getParameter('boundary');
        $mimeMsg = \Zend\Mime\Message::createFromMessage($content, $boundary);
        $message->setHeaders($headers);
        $message->setBody($mimeMsg);
        $attachmentsDesc=$mimeMsg->getParts();
        $fileManager=new FileManager();
        
        foreach($attachmentsDesc as $attachment)
        {
            $this->log->debug($attachment->type);  // this property  holds content type, line break AND name 
            $this->log->debug($attachment->filename); // this is empty
       //     $fileData=$fileManager->storeStreamToInbox(base64_decode($attachment->getContent()), $attachment->filename);
            
            $this->log->debug("file created");
        }

70+ periods in a single line causes an infinite loop in Mime::encodeQuotedPrintable

Passing a string, which contains at least of 70 period-characters (but not in the first line), to Mime::encodeQuotedPrintable ends in an infinite loop.

This behaviour was introcued by 2b72be3.

Code to reproduce the issue

$line = "test\n".str_repeat('.', 70);

$result = \Zend\Mime\Mime::encodeQuotedPrintable(
        $line
);

var_dump($result);

Expected results

No infinite loop.

Actual results

Infinite loop.

Random spaces or broken characters in html mails with a lot of content

Hello,

we encountered an issue when sending multipart emails (html and text) with a lot of content.
There either random spaces inside the source code of the mail or broken characters because of invalid character entities.

Since things are working fine when we use the swiftmailer, we could get an idea where the error could be.

According to the RFC 2045 (search for "76"), you are doing a a hard line break instead of a soft line break after 76 characters (see Zend\Mime\Part and search for 76).
Swiftmailer is handling this 76 character limitation totally differently.
Since this is not an easy topic my thoughts are no having any kind of offense inside. My Intension is to put you into the right direction.

How can you reproduce this issue?
Send a multipart email with a lot of content in html and text.

Best regards,
Stev

[Update]
It would be cool if you could put the link to the RFC 2045 as close to the code as possible.
It took me a while to get the sense behind this "76" number when I had a look into the code.

What about this way?

    'line-length'      => 76, //@link** http://www.faqs.org/rfcs/rfc2045.html

Or put the "76" as constant on top and add the link as comment?

MimePart is inefficient when handling in-memory data

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7471
User: @ddxor
Created On: 2015-04-30T07:55:22Z
Updated At: 2015-11-06T21:30:58Z
Body
MimePart requires that I pass it a type of resource as part of the object construct.

In my scenario I have just generated a PDF which I want to attach to an e-mail. Using MimePart I have to first write that PDF to disk, get a resource for it, pass that to MimePart which will then read it back from disk again.

This is wasteful IO. I should be able to pass MimePart a string and encoding type directly.


Comment

User: @Ocramius
Created On: 2015-04-30T07:58:52Z
Updated At: 2015-04-30T07:58:52Z
Body
You can create in-memory resources...
On Apr 30, 2015 08:55, "James Anslow" [email protected] wrote:

MimePart requires that I pass it a type of resource as part of the object
construct.

In my scenario I have just generated a PDF which I want to attach to an
e-mail. Using MimePart I have to first write that PDF to disk, get a
resource for it, pass that to MimePart which will then read it back from
disk again.

This is wasteful IO. I should be able to pass MimePart a string and
encoding type directly.

โ€”
Reply to this email directly or view it on GitHub
zendframework/zendframework#7471.


Comment

User: @ddxor
Created On: 2015-04-30T08:52:14Z
Updated At: 2015-04-30T08:52:14Z
Body
MimePart already does what I want it to internally, just not as an option during construct. Even if I construct an in-memory resource I am still having to modify memory and waste resources doing so.


MTOM messages with binary message-parts mallformed after splitMime

After the splitMime function the content of a message containing a messagepart in binary (using with MTOM xop:Include) will get malformed. In my case a PDF becomes pretty much unreadable (still valid PDF but all images and markup are broken)

I'm pretty sure it's this line causing the problem
https://github.com/zendframework/zend-mime/blob/master/src/Decode.php#L30

It discards any \r character in the entire message, changing the content of the binary attachment and breaking it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.