Coder Social home page Coder Social logo

php-mail-client / client Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 18.0 215 KB

Full featured PHP mail client. Create, edit, delete, move and set flags to messages with ease! Driver for IMAP4 included.

Home Page: https://packagist.org/packages/php-mail-client/client

License: MIT License

PHP 100.00%

client's People

Contributors

czpechy avatar greeny avatar markatom avatar martinpecha avatar sasule 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

client's Issues

Imap move/copy does not work when mailbox prefixed with server name

When I try to move a mail to mailbox named Test, an exception is thrown:

Cannot copy mail to mailbox 'Test': [TRYCREATE] UID COPY Invalid mailbox name

My mailbox is hosted on wedos.cz. I was further investigating why is this happening and I figured out that if the mailbox name is not prefixed with a server name (e.g. {foo.bar.net:993/imap/ssl}), it works.

The problematic line of code is here https://github.com/greeny/MailLibrary/blob/master/MailLibrary/Drivers/ImapDriver.php#L396

I do not know if the server name is required or if it could be omitted. Maybe some configuration option/switch removing the server name should be added.

PHP Depreacted errors on PHP 8.2

There is many warnings after update on PHP 8.2

PHP Deprecated: Return type of greeny\MailLibrary\Selection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:174
PHP Deprecated: Return type of greeny\MailLibrary\Selection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:185
PHP Deprecated: Return type of greeny\MailLibrary\Selection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:200
PHP Deprecated: Return type of greeny\MailLibrary\Selection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:209
PHP Deprecated: Return type of greeny\MailLibrary\Selection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:219
PHP Deprecated: Return type of greeny\MailLibrary\Selection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:229
PHP Deprecated: Return type of greeny\MailLibrary\Selection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:234
PHP Deprecated: Return type of greeny\MailLibrary\Selection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:242
PHP Deprecated: Return type of greeny\MailLibrary\Selection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:250
PHP Deprecated: Return type of greeny\MailLibrary\Selection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/php-mail-client/client/MailLibrary/Selection.php:255

SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) + SCRAM-SHA3-512(-PLUS) supports

Dear @php-mail-client team,

Can you add supports of :

  • SCRAM-SHA-1
  • SCRAM-SHA-1-PLUS
  • SCRAM-SHA-256
  • SCRAM-SHA-256-PLUS
  • SCRAM-SHA-512
  • SCRAM-SHA-512-PLUS
  • SCRAM-SHA3-512
  • SCRAM-SHA3-512-PLUS

You can add too:

  • SCRAM-SHA-224
  • SCRAM-SHA-224-PLUS
  • SCRAM-SHA-384
  • SCRAM-SHA-384-PLUS

"When using the SASL SCRAM mechanism, the SCRAM-SHA-256-PLUS variant SHOULD be preferred over the SCRAM-SHA-256 variant, and SHA-256 variants [RFC7677] SHOULD be preferred over SHA-1 variants [RFC5802]".

SCRAM-SHA-1(-PLUS):

SCRAM-SHA-256(-PLUS):

SCRAM-SHA-512(-PLUS):

SCRAM-SHA3-512(-PLUS):

-PLUS variants:

IMAP:

LDAP:

  • RFC5803: Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted: Challenge Response Authentication Mechanism (SCRAM) Secrets: https://tools.ietf.org/html/rfc5803

HTTP:

2FA:

IANA:

Linked to:

Error: PHP Request Shutdown: Mailbox name is not valid mUTF-7 (0.001 + 0.047 + 0.047 secs). (errflg=2)

Hello together.

Whether somebody got this problem and I'm new to imap E-Mail clients please give me a hint what wrong.

After $this->mailbox = $this->iMapConnection->getMailbox($mailboxName);

and work with this array: $selection = $this->mailbox->getMails();
and finished with response I'll get this errors:

PHP Request Shutdown: Mailbox name is not valid mUTF-7 (0.001 + 0.031 + 0.030 secs). (errflg=2)
PHP Request Shutdown: IMAP protocol error: No mailbox selected (0.000 + 0.000 secs). (errflg=2)
PHP Request Shutdown: No mailbox selected (0.000 + 0.000 secs). (errflg=2)

Working with php8.3

Many thanks for any help or hint...

Michael

ImapDriver: Parsing subject in headers

Some clients splitting subject to parts by 35chars.
You have in imapdriver check splitting by space but i have tab "\t"

Fix is in 234 line in ImapDriver.php

if(mb_substr($line, 0, 1, 'UTF-8') === " " || mb_substr($line, 0, 1, 'UTF-8') === "	") {

Roadmap for version 4.X

  • use Nette coding style
  • rename namespace to greeny\MailClient PhpMailClient
  • remove occurences of $this->mailboxes || $this->initialize() and similar, replace with standart if
  • merge #13 and #14 or use parts from them
  • write unit tests
  • test different mail providers for differences in server communication
  • replace Contact and ContactList with some external service, like ContactParser
  • make ContactParser independent on imap_* functions
  • remove Selection::mailIndexes (use native ArrayIterator)
  • try refactor Mail to split from Connection (Doctrine-like access)
  • SocketDriver

O365/Exchange US-ASCII encoding problem.

Hello,

Thank you for your library, it saved me hours of work...
I'm using it to connect to O365 server and expirienced encoding problem
Unknown: [BADCHARSET (US-ASCII)] The specified charset is not supported. (errflg=2)

I got this working by removing UTF-8 charset parameter from ImapDriver::getMailIds() line 185

Regards,

ImapStructure: Missing index 5 (image) type in $typeTable for attachments

Missing image type in typeTable array, but constant with image exists
http://502.cz/scr/20170602145705796.png

	protected static $typeTable = array(
		self::TYPE_TEXT => 'text',
		self::TYPE_MULTIPART => 'multipart',
		self::TYPE_MESSAGE => 'message',
		self::TYPE_APPLICATION => 'application',
		self::TYPE_AUDIO => 'audio',
		self::TYPE_VIDEO => 'video',
		self::TYPE_OTHER => 'other',
	);

to

	protected static $typeTable = array(
		self::TYPE_TEXT => 'text',
		self::TYPE_MULTIPART => 'multipart',
		self::TYPE_MESSAGE => 'message',
		self::TYPE_APPLICATION => 'application',
		self::TYPE_AUDIO => 'audio',
		self::TYPE_IMAGE => 'image',
		self::TYPE_VIDEO => 'video',
		self::TYPE_OTHER => 'other',
	);

Uncaught Error: Class 'greeny\MailLibrary\Contact' not found in

Hello,

the application can`t find greeny\MailLibrary\Contact in the folders.
i just inserted

use greeny\MailLibrary\Drivers\ImapDriver;
use greeny\MailLibrary\Connection;
use greeny\MailLibrary\Mail;
use greeny\MailLibrary\Mailbox;
use greeny\MailLibrary\Contact;
use greeny\MailLibrary\ContactList;

at the start.
To echo everything out, testwise - i wrote this little test for:

$driver = new ImapDriver('[email protected]', 'awgahiwiNI"N82ng', 'mailserver.de', 993, TRUE);
$connection = new Connection($driver);
$connection->getMailboxes();

$mailbox = $connection->getMailbox('INBOX.Trash');
$selection = $mailbox->getMails();

$selection->limit(5);

foreach($selection as $mail) 
{
	?>
	<div style="width: 500px; height: 100px; overflow-y: scroll; margin-bottom: 20px;">
		<?php echo $mail->xRequestFrom; ?>
	</div>
	<?php
}

SSL self-signed

Cannot connect to IMAP server: Certificate failure for server.cz: Self-signed certificate or untrusted authority: C=US, S=NY, L=New York, O=Courier Mail Server, OU=Automatically-generated IMAP SSL key, CN=server.cz, E=[email protected]

settings on imapdriver constructor - port 143 , ssl FALSE.
If this set to true

greeny\MailLibrary\DriverException
Cannot connect to IMAP server: TLS/SSL failure for server.cz: Invalid token, probably not an SSL server

fix for ssl false option:

ImapDriver.php:64
added /novalidate-cert
$ssl = $ssl ? '/ssl' : '/novalidate-cert';

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.