IMAP connection problem and POP3 processing

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
badfiles
Posts: 8
Joined: 02 Dec 2016, 20:47

IMAP connection problem and POP3 processing

Post 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?
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post 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.
badfiles
Posts: 8
Joined: 02 Dec 2016, 20:47

Re: IMAP connection problem and POP3 processing

Post 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.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post by SL-Gundam »

What is your mailbox configuration in EmailReporting?
badfiles
Posts: 8
Joined: 02 Dec 2016, 20:47

Re: IMAP connection problem and POP3 processing

Post 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,
),
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post by SL-Gundam »

Can you access the mailbox in question using a normal mail client through IMAP using the same settings?
badfiles
Posts: 8
Joined: 02 Dec 2016, 20:47

Re: IMAP connection problem and POP3 processing

Post 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.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post 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
badfiles
Posts: 8
Joined: 02 Dec 2016, 20:47

Re: IMAP connection problem and POP3 processing

Post 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=""]
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post 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
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post 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
badfiles
Posts: 8
Joined: 02 Dec 2016, 20:47

Re: IMAP connection problem and POP3 processing

Post 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.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: IMAP connection problem and POP3 processing

Post 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
Post Reply