Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMAP Failure: 1 BAD Unknown command p111mb294215025wrb at ./dmarcts-report-parser.pl line 234. #45

Closed
rytvish opened this issue Dec 9, 2017 · 3 comments

Comments

@rytvish
Copy link

rytvish commented Dec 9, 2017

root@ip-172-31-41-213:~/dmarcts-report-parser# ./dmarcts-report-parser.pl -d -i
use tls with verify servercert.
connection to imap.gmail.com:993 with Ssl => 1, User => myemail@gmail.com, Ignoresizeerrors => 1
Started at Sat Dec 9 15:18:09 2017
Using Mail::IMAPClient version 3.38 on perl 5.022001
Connecting with IO::Socket::SSL PeerAddr imap.gmail.com:993 PeerPort 993 Proto tcp Timeout 600 Debug 1
Connected to imap.gmail.com:993
Read: * OK Gimap ready for requests from 34.21.56.21 p111mb294215025wrb
Sending: 1 STARTTLS
Sent 12 bytes
Read: 1 BAD Unknown command p111mb294215025wrb
ERROR: 1 BAD Unknown command p111mb294215025wrb at /usr/share/perl5/Mail/IMAPClient.pm line 1365.
Mail::IMAPClient::ANON("1 BAD Unknown command p111mb294215025wrb\x{d}\x{a}") called at /usr/share/perl5/Mail/IMAPClient.pm line 1401
Mail::IMAPClient::_get_response(Mail::IMAPClient=HASH(0x20f81b0), 1, undef) called at /usr/share/perl5/Mail/IMAPClient.pm line 1327
Mail::IMAPClient::_imap_command_do(Mail::IMAPClient=HASH(0x20f81b0), "STARTTLS") called at /usr/share/perl5/Mail/IMAPClient.pm line 1226
Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x20f81b0), "STARTTLS") called at /usr/share/perl5/Mail/IMAPClient.pm line 436
Mail::IMAPClient::starttls(Mail::IMAPClient=HASH(0x20f81b0)) called at /usr/share/perl5/Mail/IMAPClient.pm line 413
Mail::IMAPClient::Socket(Mail::IMAPClient=HASH(0x20f81b0), IO::Socket::SSL=GLOB(0x20f8678)) called at /usr/share/perl5/Mail/IMAPClient.pm line 366
Mail::IMAPClient::connect(Mail::IMAPClient=HASH(0x20f81b0)) called at /usr/share/perl5/Mail/IMAPClient.pm line 314
Mail::IMAPClient::new("Mail::IMAPClient", "Server", "imap.gmail.com:993", "Ssl", 1, "Starttls", ARRAY(0x20f8240), "User", "myemail@gmail.com", ...) called at ./dmarcts-report-parser.pl line 234
ERROR: 1 BAD Unknown command p111mb294215025wrb at /usr/share/perl5/Mail/IMAPClient.pm line 1275.
Mail::IMAPClient::_imap_command(Mail::IMAPClient=HASH(0x20f81b0), "STARTTLS") called at /usr/share/perl5/Mail/IMAPClient.pm line 436
Mail::IMAPClient::starttls(Mail::IMAPClient=HASH(0x20f81b0)) called at /usr/share/perl5/Mail/IMAPClient.pm line 413
Mail::IMAPClient::Socket(Mail::IMAPClient=HASH(0x20f81b0), IO::Socket::SSL=GLOB(0x20f8678)) called at /usr/share/perl5/Mail/IMAPClient.pm line 366
Mail::IMAPClient::connect(Mail::IMAPClient=HASH(0x20f81b0)) called at /usr/share/perl5/Mail/IMAPClient.pm line 314
Mail::IMAPClient::new("Mail::IMAPClient", "Server", "imap.gmail.com:993", "Ssl", 1, "Starttls", ARRAY(0x20f8240), "User", "myemail@gmail.com", ...) called at ./dmarcts-report-parser.pl line 234
IMAP Failure: 1 BAD Unknown command p111mb294215025wrb at ./dmarcts-report-parser.pl line 234.

@rytvish
Copy link
Author

rytvish commented Dec 9, 2017

Hi,
The script is working fine for local filesystem but somehow i am unable to use it with an IMAP gmail.
Any help would be highly apprecitated.

$debug = 0;
$delete_reports = 0;

$dbname = 'dmarc';
$dbuser = 'dmarc';
$dbpass = 'fs53gD';
$dbhost = ''; # Set the hostname if we can't connect to the local socket.

$imapserver = 'imap.gmail.com:993';
$imapuser = 'myemail@gmail.com';
$imappass = 'mypass';
$imapssl = '1'; # If set to 1, remember to change server port to 993.
$imaptls = '1'; # Enabled as the default and best-practice.
$tlsverify = '1'; # Enable verify server cert as the default and best-practice.
$imapignoreerror = '1'; # set it to 1 if you see an "ERROR: message_string()
# expected 119613 bytes but received 81873 you may
# need the IgnoreSizeErrors option" because of malfunction
# imap server as MS Exchange 2007, ...
$imapreadfolder = 'Inbox';

@lwt-pressy
Copy link
Contributor

lwt-pressy commented Dec 9, 2017

try disabling tls ($imaptls = '0'; ), you cant use tls with ssl (port 993).

@rytvish
Copy link
Author

rytvish commented Dec 9, 2017

Many thanks @lwt-pressy for your help........
It's rocking now!!!!!!!!!!!!!! 👍 :)

@rytvish rytvish closed this as completed Dec 9, 2017
@techsneeze techsneeze mentioned this issue Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants