Forum

Comment fonctionne ...
 
Notifications
Clear all

Comment fonctionne l'automate de récupération d'email afin de mettre à jour les tickets

18 Posts
2 Users
0 Reactions
59.4 K Views
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 
[#1561]

Bonjour,

J'ai essayé de configurer la fonction IMAP
L'accès semble fonctionner car pas d'erreur dans le fichier Log, j'ai juste une ligne qui me dit que la boîte mail est vide, alors qu'il y a bien un email dedans
J'ai fait une réponse à un ticket créé, en ajoutant 2 lignes vides à la fin de la réponse

Pouvez-vous m'aider, est-ce que quelqu'un l'utilise?

D'avance merci

M


 
Posted : 10 Jan 2014 17H45
(@babynus)
Posts: 14952
Member Admin
 

PLEASE POST IN ENGLISH

___

Check the mailbox name.
Syntax is something like {server:port/imap/sll}INBOX
First part, between {} is the connection string (may be correct}, but if INBOX does not exist it is concidered as empty.


 
Posted : 10 Jan 2014 21H33
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

Hello Babynus,

Sorry for not having written it in English, but i saw some answers from you in French, that's why i did... 🙁

The INBOX mailbox exist, i tested it through a telnet on 143 with text command

But in the log file, i continue to have "mailbox is empty"

Thanks in advance


 
Posted : 13 Jan 2014 14H59
(@babynus)
Posts: 14952
Member Admin
 

Please check status of messages.
If all messages are "seen", mailbox is considered empty.
(only "unseen" messages are treated, and then set to "seen")


 
Posted : 13 Jan 2014 16H07
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

Thanks for your quick reply,

The message stay on "unread" even if in the log it says that the mailbox is empty

One question: How the system will manage email that are not related to an existing ticket ? It will be placed as read?

PS: The mailbox i have setup is on an Exchange server, can it be a reason?
I tried to modify the connection string by deleting the /notls I have at the end, (in this case I have an error in the log). So I'm sure (99 %) that the connection on the mailbox is good when I have the log "mailbox is empty)

Thanks for your support


 
Posted : 13 Jan 2014 16H41
(@babynus)
Posts: 14952
Member Admin
 

How the system will manage email that are not related to an existing ticket ? It will be placed as read?

All mails read are marked as read, even if not recognized as ProjeQtOr mail

The mailbox i have setup is on an Exchange server, can it be a reason?

I don't really thonk so.

I tried to modify the connection string by deleting the /notls I have at the end, (in this case I have an error in the log). So I'm sure (99 %) that the connection on the mailbox is good when I have the log "mailbox is empty)

For sure your connection string is correct, but this not assumes de mailbox name is correct : I think that with an Exchange server, it must fit the directpry name of the mailbox.
This is possibly the source of your issue : connection is OK to the account, but name of mailbox is incorrect, and may be language dependant (in french, it may be "Boîte de réception", and not "inbox")


 
Posted : 13 Jan 2014 18H38
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

Hi again

Here a print screen after trying IMAP commands...
We see that's INBOX is the good one...

Really strange


 
Posted : 13 Jan 2014 20H52
(@babynus)
Posts: 14952
Member Admin
 

Seems correct.

Are your emails in /INBOX or /INBOX/Test ?


 
Posted : 13 Jan 2014 21H42
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

Hello,

I tried to place them in both, but they arrive in th INBOX one


 
Posted : 14 Jan 2014 11H26
(@babynus)
Posts: 14952
Member Admin
 

Could you try to change filter ot search mails.
In /model/CRON.php, line 482 :

		$mailsIds = $mailbox->searchMailBox('UNSEEN UNDELETED');

Try to change filter to 'UNSEEN' or 'ALL'.

Important, to take changes into accound, be sure to stop and retart the CRON in the administration screen.


 
Posted : 14 Jan 2014 12H01
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

I tried with "UNSEEN", same story, in the log I have a line that mailbox is empty

I tried with 'ALL' last line in the log is that the cron has bee started, but no more line that the mailbox is empty 🙁
But nothing is updated in the ticket

I did the stop and start of the cron

I don't know how to interprete these results

Thanks for your help

M


 
Posted : 14 Jan 2014 13H04
(@babynus)
Posts: 14952
Member Admin
 

So, next step is, with filter "ALL", to add some debugging lines.

First, set $debugLevel=3; in your parameters.php file

Then, add debugging lines. For instance, line 492 :

$body=$mail->textPlain;
debugLog($body);

You'll then be able to see which messages are retrieved, and maybe understand why they are not correctly treated.


 
Posted : 14 Jan 2014 13H42
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

In $body there is nothing
but in $bodyHtml there is something...


 
Posted : 14 Jan 2014 14H39
(@babynus)
Posts: 14952
Member Admin
 

In $body there is nothing
but in $bodyHtml there is something...

That's <hy your messages are not treated : only $body is parsed.

Does what is in $bodyHtml correspond to your message to be treated ?


 
Posted : 14 Jan 2014 15H21
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

Yes!

I tried to add $body =$bodyHtml, but did not succeed. 🙁
Seems that the HTML code is not clean like plain text


 
Posted : 14 Jan 2014 16H34
(@babynus)
Posts: 14952
Member Admin
 

Yes, it's a bit more complex.

Here is just a try for a fix : unzip joint file (with folder) into /external.
Then make a small change in /model/Cron.php, from line 492, this way :

		$body=$mail->textPlain;
		$bodyHtml=$mail->textHtml;
		if (! $body and $bodyHtml) {
			include_once '../external/html2text/html2text.php';
			$body=convert_html_to_text($bodyHtml);
		}

Start / stop the Cron so that changes are taken into accound and try again.


 
Posted : 14 Jan 2014 16H54
 Bled
(@martin)
Posts: 18
Active Member
Topic starter
 

First, I would like to thank you for your involvement!

I have another type of error now 🙁

2014-01-14 16:03:22 ===== TRACE ===== Cron started at 14/01/2014 16:03:22
2014-01-14 16:03:23 ** ERROR ** ERROR **
2014-01-14 16:03:23
** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23
** ERROR ** cause = DOMDocument::loadHTML(): Namespace prefix o is not defined in Entity, line: 52
2014-01-14 16:03:23
** ERROR ** ERROR **
2014-01-14 16:03:23 ** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23 ** ERROR ** cause = DOMDocument::loadHTML(): Tag o:p invalid in Entity, line: 52
2014-01-14 16:03:23 ** ERROR ** ERROR **
2014-01-14 16:03:23
** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23
** ERROR ** cause = DOMDocument::loadHTML(): Namespace prefix o is not defined in Entity, line: 53
2014-01-14 16:03:23
** ERROR ** ERROR **
2014-01-14 16:03:23 ** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23 ** ERROR ** cause = DOMDocument::loadHTML(): Tag o:p invalid in Entity, line: 53
2014-01-14 16:03:23 ** ERROR ** ERROR **
2014-01-14 16:03:23
** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23
** ERROR ** cause = DOMDocument::loadHTML(): Namespace prefix o is not defined in Entity, line: 60
2014-01-14 16:03:23
** ERROR ** ERROR **
2014-01-14 16:03:23 ** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23 ** ERROR ** cause = DOMDocument::loadHTML(): Tag o:p invalid in Entity, line: 60
2014-01-14 16:03:23 ** ERROR ** ERROR **
2014-01-14 16:03:23
** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23
** ERROR ** cause = DOMDocument::loadHTML(): Namespace prefix o is not defined in Entity, line: 63
2014-01-14 16:03:23
** ERROR ** ERROR **
2014-01-14 16:03:23 ** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23 ** ERROR ** cause = DOMDocument::loadHTML(): Tag o:p invalid in Entity, line: 63
2014-01-14 16:03:23 ** ERROR ** ERROR **
2014-01-14 16:03:23
** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23
** ERROR ** cause = DOMDocument::loadHTML(): Namespace prefix o is not defined in Entity, line: 68
2014-01-14 16:03:23
** ERROR ** ERROR **
2014-01-14 16:03:23 ** ERROR ** on file '/var/www/html/projectorria/external/html2text/html2text.php' at line (30)
2014-01-14 16:03:23 ** ERROR ** cause = DOMDocument::loadHTML(): Tag o:p invalid in Entity, line: 68


 
Posted : 14 Jan 2014 20H12
(@babynus)
Posts: 14952
Member Admin
 

It seems your htmlBody is not a well formed HTML document.

Could you post (or send to me) an example of what you retrieve as $bodyHtml ?


 
Posted : 14 Jan 2014 21H05
Share:

Scroll to Top