TheFox / smtpd

SMTP server (library) for receiving emails, written in pure PHP.
https://fox21.at
MIT License
121 stars 30 forks source link

Potential candidate to replace `Zend\Mail\Message`/`Zend\Mime\Message` #20

Open groovenectar opened 2 years ago

groovenectar commented 2 years ago

https://github.com/jchook/mime-php

So potentially here: https://github.com/TheFox/smtpd/blob/master/src/Client.php#L473

Instead of $mail = \Zend\Mail\Message::fromString($this->mail); or $mail = \Zend\Mime\Message::createFromMessage($this->mail);, it could be:

$mail = (new \Virtu\Mime\Textual\Parser)->parseMessageString($this->mail);

This would then expose each message part after parsing

groovenectar commented 2 years ago

I gave this a try and it works -- also decodes base64-encoded message parts :)