Menu

Ticket Creations from eMails (itop 1.2.1??)

TheBigOne
2012-04-03
2012-12-19
  • TheBigOne

    TheBigOne - 2012-04-03

    Hi
    I try to install the email package but all I get during the installation wizard process is a white page at the step (Next:Sample data selection).

    I tried to set error_reporting to E_ALL and display_errors On but I still get the white page.

    If I delete the folders "combodo-email-synchro" and "itop-simple-email-syncro" the wizard completes successfully.
    Deselect the eMail module from the wizard is also not working.

    Did anyone used this module successfull with iTop 1.2.1 ?
    There must be a typo but I don`t know how to find it without any error messages :)

     
  • Erwan Taloc

    Erwan Taloc - 2012-04-03

    Hi Johndoe2011

    did you well install net-socket package?
    The symptom you have is classical when this php package is not install
    If yes, don't forget to restart you web server before restarting iTop set up

    Hope this helps

    Erwan

     
  • TheBigOne

    TheBigOne - 2012-04-04

    Hi Erwan,

    yes I installed the package but I assume the path is not correct. I was just a bit confused because of the missing error messages in the logs or on the page itself. I added the error reporting into the php.ini and to every page of the setup files and nothing :)

    But thanks for the hint, I`ll go first into this direction for now.

    /Stefan

     
  • TheBigOne

    TheBigOne - 2012-04-04

    Confirmed.
    The Path to Net/Socket.php was not correct in modules/combodo-email-synchro/POP3.php
    Changing the path solved the main problem.

    Maybe a check during setup would be helpful. I still have to find out why the fatal error of the "require" did not came up with a message.

    But anyway. Thanks a lot for the hint.

    /Stefan

     
  • Denis

    Denis - 2012-04-04

    The problem comes from the PEAR classes that were written for PHP4 and generate so many warnings that the error reporting has to be desactivated to use them !

    The solution is probably to forget about PEAR and rewrite the module using the newer PHP/IMAP extension.

    - Denis

     
  • TheBigOne

    TheBigOne - 2012-04-04

    Hi Denis,

    I thought about it but there are 1200 lines in the pop3.php and at least 550 lines are used in model.email-synchro.php to get the email headers and body.
    But as far as I can see it`s just the pop3.php which needs a rewrite for imap.
    The problem is really the time. I don`t get the time in our company to work on it.

    I wrote a class for imap connection in another programm, but this was just for reading the mailbox to check for new mails to send an sms alert and some other small methods.

    If someone has time I could help with some code.

     
  • Patrick

    Patrick - 2012-08-06

    Hey,

    I have installed the new module, and I am facing two major differences from the previous versions:

    1) the email remains in the mailbox, so it gets polled every 2 seconds.
    2) the ticket is created as a request, and not as an Incident. I have tried to add the finalclass => Incident to config file but that did not make any difference.

    Is there some way to extend this?

     
  • Patrick

    Patrick - 2012-08-06

    to clarify 1): After close/delete of the request, the email should be deleted as well.. Instead of this, the email is not deleted but treated as a new ticket, so after 2 seconds a new ticket is created with the same data from the email…

     
  • Patrick

    Patrick - 2012-08-07

    I fixed the model to create an incident instead of a request, but still stuck with the delete issue. I have tried several different email accounts, with several different servers, using imap or pop3, but none of it would delete the message.
    Finally I have set up an extra gmail account, which is polled via pop3, with the setting that every message, read by POP3, should be archived. This is working as a preliminary workaround, but I would very much like to have the initial idea fixed (delete the message when the ticket closes or gets deleted).
    I presume the reason why the email is not deleted the first time, is because it can track on updates to that mail. This is something I really need, so I hope to get this working at some point.

     
  • Denis

    Denis - 2012-08-17

    Hi  musicmannetje

    The emails are supposed to be deleted when the corresponding ticket is either closed or no longer exist.

    There are two possibilities of failure: 1) the processing does not try to delete the messages or 2) marking messages as "deleted" in the mailbox does not actually delete them.

    If you set the "debug" flag in the configuration file for the module, do you see a trace in the standard output stating that the message is being deleted ? If so, then it means than imap_delete() (combined with imap_close with the CL_EXPUNGE flag) fails for some reason.

    If there is no such trace in the ouput, then it means that the conditions to delete an incoming mails were not met… or that there is a bug in the algorithm.

    Hope this helps,

    - Denis

     
  • Sulev

    Sulev - 2012-08-27

    Hi everyone,
    I have the same problem as musicmannetje: The ticket is recreated aftter deleting or closing(mail not deletad).
    The log file states that the mail is being deleted.
    Has there been any progress with the problem?
    Regards,
    Sulev

     
  • Sulev

    Sulev - 2012-08-28

    Hi Denis,
    OK. I created a php page to see if it deletes using the UID, it wokrs. So i changed "DeleteMessage" function in "model.email-synchro" a bit:

    public function DeleteMessage($index)
        {
            $aOverviewsTest = imap_fetch_overview($this->rImapConn, $index, FT_UID);
            $oOverviewTEST = array_pop($aOverviewsTEST);
            echo("IMAPEmailSource: Deleting the message $index");
            $ret = imap_delete($this->rImapConn, $oOverviewTEST, FT_UID);
            imap_expunge($this->rImapConn);
            return $ret;
        }
    

    However, this does not seem to change a thing. So i suspect that i'm doing something wrong here.

     
  • Sulev

    Sulev - 2012-08-28

    Im using microsoft exchange mailserver.

     
  • Sulev

    Sulev - 2012-08-28

    $ret = imap_delete($this->rImapConn, $oOverviewTEST->uid, FT_UID);

    i noticed that i forgot "->uid", however that still doesn't fix the problem.

     
  • Denis

    Denis - 2012-08-28

    Hi sulev0009,

    It seems that some servers may expect a "range" instead of a single number. Did you try:

    $ret = imap_delete($this->rImapConn, $oOverviewTEST->uid.':'.$oOverviewTEST->uid, FT_UID);
    
     
  • Sulev

    Sulev - 2012-08-30

    The php page that i created worked with just the uid so i thought i wouldn't need to try anything else, but i did do a little testing with the "range" option. I got it to work with:

     $aOverviewsTest = imap_fetch_overview($this->rImapConn, 1+$index, FT_UID);
    

    (i added 1+ in front of $index)
    I wondered if the code with just uid would work as well with that change. It does. So i tried the original model.email-synchro.php code and added "1+" in there and it also works.
    By it works i mean that it deletes a single email form the mailbox, however if there are more emails there it deletes the email (the email corresponding to the deleted ticket) and for some reason creates a duplicate ticket of the next email.
    Example:
    in mailbox                 in itop
    email1         -->        ticket1
    email2         -->        ticket2
    if i delete ticket one the result is:
    in mailvox                  in itop
    email2        -->         ticket2
                                        ticket2
    It is a bit odder with 3 emails: By deleting the first ticket(ticket1) it creates another ticket2. By deleting the original ticket2 it deletes the email3 with it. Deleting the the other ticket2(only ticket2 left) will delete email2.
    If i delete ticket2 first(ticket1 has not been deleted) it creates another ticket3.
    Deleting the last ticket(ticket3 in this case) first it works as it shoud(pobably because it can't make a duplication because there are no emails after email3).
    Till now i have been testing with a single email.
    I descided to try the original code(without "1+") with multple emails. Apparently it cant delete the first email when deleting the corresponding ticket. It will delete the first email when ticket2(created from email2) is deleted. Ticket1 stays in itop and ticket2 will be created again. Ticket1 can now be deleted without it being recreated but email 2 cannot be deleted.
    If the problem is with the $index then why does "1+" create that odd bug(creating duplicate tickets)?
    I have run out of ideas for now. I will look in to it some more another day.
    Regards,
    Sulev

     
  • Sulev

    Sulev - 2012-09-04

    It seems that exchange resets the UIDs every time imap session closes.
    Example: if i have mails with UIDs 1, 2, 3 and i delete the mail with the UID 2 i have mails in my mailbox with UIDs 1 and 3.
    However after it closes the session  the UID-s will be reset to 1 and 2. So my theory is that itop recognizes the mail, which previously had the UID 3, as a new email (because it now has the UID 2). Gmail does not reset the UIDs and everything seems to be working perfectly with the gmail box. I can't be sure because i do not know itop links an email to the ticket. Can someone confirm this?
    Thanks in advance,
    Sulev

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.