Skip to content

Instantly share code, notes, and snippets.

@totten

totten/000.md Secret

Created November 7, 2020 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totten/05de1aaf6948513792a40fb6f1eafb26 to your computer and use it in GitHub Desktop.
Save totten/05de1aaf6948513792a40fb6f1eafb26 to your computer and use it in GitHub Desktop.
Hack to have zeta dump IMAP I/O to console

Apply the patch, then run the IMAP test on CLI:

cv api4 MailSettings.testConnection +w id=3
--- vendor/zetacomponents/mail/src/transports/transport_connection.php.orig 2020-11-06 21:22:43.000000000 -0800
+++ vendor/zetacomponents/mail/src/transports/transport_connection.php.new 2020-11-06 21:22:07.000000000 -0800
@@ -194,6 +194,7 @@
{
if ( is_resource( $this->connection ) )
{
+ fwrite(STDERR, '>> ' . $data . self::CRLF);
if ( fwrite( $this->connection, $data . self::CRLF,
strlen( $data ) + strlen( self::CRLF ) ) === false )
{
@@ -235,6 +236,7 @@
$data .= $line;
}
+ fwrite(STDERR, '<< ' . $data . self::CRLF);
if ( $trim == false )
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment