Page 1 of 1

IMAP connection problem and POP3 processing

Posted: Dec 05, 2016 5:45 pm
by badfiles
I tried to set up an IMAP mailbox, but I got this error
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]

Then I switched it to POP3 and everything went fine, but
if I configure it to delete processed e-mails, it actually deletes all e-mails (as I do not let it create new bugs)
if I configure it not to do so, it does not set processed e-mails as 'read', and processes all e-mails, no matter if they are read or not.

I use latest git master version of both core and plugin.

How do I fight that?

Re: IMAP connection problem and POP3 processing

Posted: Dec 06, 2016 11:39 am
by SL-Gundam
EmailReporting will always process any emails in a given folder/mailbox. An ignored email is a processed email.
The general idea is that EmailReporting monitors the mail account from which MantisBT sends emails and imports any emails that come back on said mail account

As for IMAP and the read email issue. What IMAP/POP3 server are you using?
With what mailbox configuration?

For POP3 only unread emails should be processed. Processed emails should be marked as read if they are not deleted. Will have to investigate this as.

Re: IMAP connection problem and POP3 processing

Posted: Dec 06, 2016 3:08 pm
by badfiles
Thank you for your answer.
I could not find the code marking processed e-mails as 'read'.
I marked the sole e-mail as read with other mail client, and it got processed again.

I use Dovecot.
Mail config is localhost, default port, no encryption, plain text auth.
Dovecot shows successful login in its log, then after a while the said error appears.

Re: IMAP connection problem and POP3 processing

Posted: Dec 06, 2016 5:20 pm
by SL-Gundam
What is your mailbox configuration in EmailReporting?

Re: IMAP connection problem and POP3 processing

Posted: Dec 07, 2016 2:23 am
by badfiles
array (
'enabled' => 1,
'description' => 'test',
'mailbox_type' => 'IMAP',
'hostname' => 'localhost',
'port' => '',
'encryption' => 'None',
'ssl_cert_verify' => 0,
'erp_username' => '******',
'erp_password' => '*****',
'auth_method' => 'PLAIN',
'project_id' => 1,
'global_category_id' => 2,
'imap_basefolder' => '',
'imap_createfolderstructure' => 0,
),

Re: IMAP connection problem and POP3 processing

Posted: Dec 07, 2016 3:41 pm
by SL-Gundam
Can you access the mailbox in question using a normal mail client through IMAP using the same settings?

Re: IMAP connection problem and POP3 processing

Posted: Dec 07, 2016 6:15 pm
by badfiles
Of course I can. Even EmailReporting can. As I have told you, there are successful login records in dovecot log.
Just switching it to POP3 works for me, but I want to test IMAP.

Re: IMAP connection problem and POP3 processing

Posted: Dec 07, 2016 6:45 pm
by SL-Gundam
I'm asking because there are a lot of IMAP commands in play and not every IMAP servers supports them all (i'm looking at you MS Exchange)

EmailReporting runs into an error somewhere and i don't have dovecot IMAP server to test on. So i'm completely dependend on your input

Please provide the complete error. In general if an error occurs it will consist of three lines. It should look something like the thing below

Code: Select all

Mailbox:
Location:
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]
The location should tell us which pear command failed

Re: IMAP connection problem and POP3 processing

Posted: Dec 08, 2016 4:12 am
by badfiles
Operation NOT successful

Description: test
Mailbox type: IMAP
Hostname: localhost
TCP port (optional): 143
Connection encryption: None
Verify SSL certificate: 0
Username: *****@*****.***
Password: ******
Authentication method: PLAIN
Basefolder (optional):

[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]

Re: IMAP connection problem and POP3 processing

Posted: Dec 08, 2016 11:59 am
by SL-Gundam
Error handling in test mode does not seem to show the location of the pear error.
I've modified the code to enhance this but it will have to wait for verification of another change before i can commit it

Please run scripts/bug_report_mail.php
It should show the error in earlier mentioned format

Re: IMAP connection problem and POP3 processing

Posted: Dec 09, 2016 6:17 pm
by SL-Gundam
The change for the error handling during the testing of the mailbox has been improved
https://github.com/mantisbt-plugins/Ema ... 0e66e07766

Please let me know what the location is where the error occurs

Re: IMAP connection problem and POP3 processing

Posted: Dec 12, 2016 2:59 am
by badfiles
Thank you, after understanding where the problem was I successfully connected with IMAP.

What about this part?
>Then I switched it to POP3 and everything went fine, but
>if I configure it to delete processed e-mails, it actually deletes all e-mails (as I do not let it create new bugs)
>if I configure it not to do so, it does not set processed e-mails as 'read', and processes all e-mails, no matter if they are read or not.

Re: IMAP connection problem and POP3 processing

Posted: Dec 12, 2016 2:20 pm
by SL-Gundam
Just for future reference and maybe other people running into the same issue. What was your problem and the solution?

As for the POP3 issue. It was answered a couple posts ago
SL-Gundam wrote:EmailReporting will always process any emails in a given folder/mailbox. An ignored email is a processed email.
The general idea is that EmailReporting monitors the mail account from which MantisBT sends emails and imports any emails that come back on said mail account

...

For POP3 only unread emails should be processed. Processed emails should be marked as read if they are not deleted. Will have to investigate this as.
I will have test on dovecot to see what the cause of that issue