User Tools

Site Tools


extensions:ticket-from-email

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
extensions:ticket-from-email [2019/04/23 11:59]
vdumas
extensions:ticket-from-email [2020/07/02 09:59] (current)
Line 4: Line 4:
 description_wiki : Scan several mailboxes to create or update tickets. description_wiki : Scan several mailboxes to create or update tickets.
 index_hidden ​    : yes index_hidden ​    : yes
-version ​         : 3.0.17 +version ​         : 3.1.1 
-release_dt ​      : 2019-03-19+release_dt ​      : 2019-11-22
 itop-version-min : 2.3.0 itop-version-min : 2.3.0
 +download_hidden ​ : http://​www.combodo.com/​itop-extensions/​combodo-mail-to-ticket-automation-3.1.1-520.zip
 code             : combodo-mail-to-ticket-automation code             : combodo-mail-to-ticket-automation
 state            : stable state            : stable
Line 12: Line 13:
 alias-code_hidden : ticket-from-email alias-code_hidden : ticket-from-email
 alternate-name ​  : Ticket Creation from eMails alternate-name ​  : Ticket Creation from eMails
-module-lists_hidden : combodo-email-synchro/​3.1.3, itop-standard-email-synchro/​3.0.15+module-lists_hidden : combodo-email-synchro/​3.2.1, itop-standard-email-synchro/​3.1.1
 diffusion ​       : iTop Hub diffusion ​       : iTop Hub
 ---- ----
  
-<note warning>​**Compatibility issue**: for iTop version lower than 2.4.0, there is a [[installation#​itop_before_240|special installation/​upgrade process]].</​note>​ 
- 
-<note warning>​For iTop versions older than 2.3.0 use a previous version of this component</​note>​ 
 <​related_components>​Other versions of this component:</​related_components>​ <​related_components>​Other versions of this component:</​related_components>​
 +
 +
 +
 +
 +
 +
  
 ===== Summary ===== ===== Summary =====
Line 57: Line 61:
  
 ^  Release Date  ^  Version ​ ^  Comments ​ ^ ^  Release Date  ^  Version ​ ^  Comments ​ ^
 +|  2019-11-22 ​ |  3.1.1  | * Compatibility with iTop 2.7 \\                 * Fix bad encoded non breaking space by outlook \\ * Update DE translations \\ * ID for incoming email are checked from reference |
 +|  2019-05-21 ​ |  3.1.0  | * Contacts in To/cc with the same email as current mailbox are not added to the ticket anymore \\                 * Handle signed emails with an "​enveloped format"​ \\                 * Store eml for all the messages |
 |  2019-03-19 ​ |  3.0.17 ​ | Dictionnaries internal updates | |  2019-03-19 ​ |  3.0.17 ​ | Dictionnaries internal updates |
 |  2019-03-13 ​ |  3.0.16 ​ | * Store eml for message in error \\ * Error log attached to the corresponding message | |  2019-03-13 ​ |  3.0.16 ​ | * Store eml for message in error \\ * Error log attached to the corresponding message |
Line 90: Line 96:
 |  2013-07-22 ​ |  2.2  | "​Legacy"​ version supporting only one mailbox (configured from the iTop configuration file). The documentation for this version is available here: [[ticket_creation_from_emails|Ticket Creation from eMails (legacy)]]| |  2013-07-22 ​ |  2.2  | "​Legacy"​ version supporting only one mailbox (configured from the iTop configuration file). The documentation for this version is available here: [[ticket_creation_from_emails|Ticket Creation from eMails (legacy)]]|
  
- 
- 
-===== Limitations ===== 
- 
-  * Each mail inbox configured corresponds to one type of Ticket (i.e. User Requests or Incidents, but not both). 
-  * Connecting to a POP3 mailbox via the php IMAP extension does **not** work. You **must** use the POP3 configuration via PEAR::​NetSocket for such a case. 
-  * There is no validation that the target class of the Mail Inbox is an existing class in iTop. (i.e. don't try to create incidents if the Incident Management module is not installed). 
-  * The support of inline images works only if the preferred order for email parts is configured as "​text/​html,​text/​plain"​ (i.e. HTML first), which is now the default for all new installations. 
-<note important>​When processing an email considered as an update to a ticket, the extensions tries to extract the "new part" of the message (excluding the content from previous messages). However, depending on the format of the reply (which itself depends on the email client software used) it may not be possible to extract this information in a reliable manner. In such a case the whole text of the email will be used. Unfortunately,​ the widely used MS Outlook is an example of such client software where the replies cannot reliably be identified. Refer to the configuration parameter ''​html-tags-to-remove''​ for explanations about how to adjust this behavior.</​note>​ 
  
 ===== Requirements ===== ===== Requirements =====
Line 104: Line 101:
   * A connection to a POP3 or IMAP server with a valid mailbox.   * A connection to a POP3 or IMAP server with a valid mailbox.
   * [[latest:​admin:​cron|cron.php]] must be running to enable the processing of incoming eMails.   * [[latest:​admin:​cron|cron.php]] must be running to enable the processing of incoming eMails.
-  * For resizing big images, [[http://​php.net/​manual/​en/​book.image.php|PHP GD]] must be installed. +  ​* For the debug trace, [[https://​www.php.net/​manual/​en/​book.mbstring.php|PHP MBString]] must be installed. 
-  ​* ​+  ​* For resizing big images, [[https://​php.net/​manual/​en/​book.image.php|PHP GD]] must be installed. 
 <note important>​On Ubuntu 16.04 the prerequisites can be installed using the ''​php-pear'',​ ''​php-net-socket''​ and ''​php-imap''​ packages: <note important>​On Ubuntu 16.04 the prerequisites can be installed using the ''​php-pear'',​ ''​php-net-socket''​ and ''​php-imap''​ packages:
 <​code>​ <​code>​
Line 135: Line 133:
 </​note>​ </​note>​
  
 +====== Usage ======
 ===== Data Mapping ===== ===== Data Mapping =====
  
Line 178: Line 177:
 | Login | The name of the mail account used for connecting to the mailbox | test@mycompany.com | | Login | The name of the mail account used for connecting to the mailbox | test@mycompany.com |
 | Password | The password for the above mentioned account | | | Password | The password for the above mentioned account | |
-| Protocol | The protocol to connect to the mail server: either POP3 or IMAP. | POP3 |+| Protocol | The protocol to connect to the mail server: either POP3 or IMAP. \\ If you need to use IMAP with SSL or TLS, refer to the imap_options configuration parameter below. | POP3 |
 | Port | The TCP port to connect to the server. The standard values are 110 (secured: 995) for POP3 and 143 (secured: 993) for IMAP | 110 | | Port | The TCP port to connect to the server. The standard values are 110 (secured: 995) for POP3 and 143 (secured: 993) for IMAP | 110 |
 | Mailbox (for IMAP) | The IMAP mailbox (folder) to scan for incoming messages. If omitted the default (root) mailbox will be scanned. This option is ignored when using the POP3 protocol. | INBOX.Folder.Subfolder | | Mailbox (for IMAP) | The IMAP mailbox (folder) to scan for incoming messages. If omitted the default (root) mailbox will be scanned. This option is ignored when using the POP3 protocol. | INBOX.Folder.Subfolder |
Line 227: Line 226:
 <note important>​The parameters listed below apply to **all** the Mail Inboxes</​note>​ <note important>​The parameters listed below apply to **all** the Mail Inboxes</​note>​
  
-<​note ​warning>Starting with Mail to ticket automation **version 2.6.6**, the recommended value for the configuration parameter ''​body_parts_order''​ is ''​text/​html,​text/​plain''​. Indeed in order to properly import the images embedded inside an HTML email, the HTML version of the email must be processed instead of the plain text version.</​note>​+<​note>​The recommended value for the configuration parameter ''​body_parts_order''​ is ''​text/​html,​text/​plain''​. Indeed in order to properly import the images embedded inside an HTML email, the HTML version of the email must be processed instead of the plain text version.</​note>​
  
 <code php> <code php>
-  ​'​combodo-email-synchro'​ => array ( +   '​combodo-email-synchro'​ => array ( 
-         ​'​debug'​ => false, +      '​debug'​ => false, 
-         ​'​periodicity'​ => 30, +      '​periodicity'​ => 30, 
-         ​'​body_parts_order'​ => '​text/​html,​text/​plain',​ +      '​body_parts_order'​ => '​text/​html,​text/​plain',​ 
-         ​'​pop3_auth_option'​ => '​USER',​ +      '​pop3_auth_option'​ => '​USER',​ 
-         ​'​imap_options'​ => array ( +      '​imap_options'​ => array ( 
-                  0 => '​imap',​ +            0 => '​imap',​ 
-            ), +      ), 
-         ​'​exclude_attachment_types'​ => array ( +      '​exclude_attachment_types'​ => array ( 
-                  0 => '​application/​exe',​ +            0 => '​application/​exe',​ 
-            ), +      ), 
-         ​'​maximum_email_size'​ => '​10M',​ +      '​maximum_email_size'​ => '​10M',​ 
-         ​'​introductory-patterns'​ => array ( +      '​recommended_max_allowed_packet'​ => 10485760, 
-                  0 => '/^le .+ a écrit :​$/​i',​ +      ​'​introductory-patterns'​ => array ( 
-                  1 => '/^on .+ wrote:​$/​i',​ +            0 => '/^le .+ a écrit :​$/​i',​ 
-                  2 => '​|^[0-9]{4}/​[0-9]{1,​2}/​[0-9]{1,​2} .+:​$|',​ +            1 => '/^on .+ wrote:​$/​i',​ 
-            ), +            2 => '​|^[0-9]{4}/​[0-9]{1,​2}/​[0-9]{1,​2} .+:​$|',​ 
-         ​'​multiline-delimiter-patterns'​ => array ( +      ), 
-                  0 => '/​\\RFrom:​ .+\\RSent: .+\\R/​m',​ +      '​multiline-delimiter-patterns'​ => array ( 
-                  1 => '/​\\R_+\\R/​m',​ +            0 => '/​\\RFrom:​ .+\\RSent: .+\\R/​m',​ 
-                  2 => '/​\\RDe : .+\\R\\R?​Envoyé : /m', +            1 => '/​\\R_+\\R/​m',​ 
-                  3 => '/​\\RDe : .+\\RDate d\'​envoi : .+\\R/​m',​ +            2 => '/​\\RDe : .+\\R\\R?​Envoyé : /m', 
-                  4 => '/​\\R-----Message d\'​origine-----\\R/​m',​ +            3 => '/​\\RDe : .+\\RDate d\'​envoi : .+\\R/​m',​ 
-                  5 => '/​\\RExpéditeur:​ .+\\RDate:/​m',​ +            4 => '/​\\R-----Message d\'​origine-----\\R/​m',​ 
-                  6 => '/​\\RDe : .+\\RDate : /m', +            5 => '/​\\RExpéditeur:​ .+\\RDate:/​m',​ 
-                  7 => '/​\\TO:​.+\\RCC:/​m',​ +            6 => '/​\\RDe : .+\\RDate : /m', 
-            ), +            7 => '/​\\TO:​.+\\RCC:/​m',​ 
-         ​'​big_files_dir'​ => '',​ +      ), 
-         ​'​use_message_id_as_uid'​ => false, // Don't change this unless you know what you are doing! +      '​delimiter-patterns'​ => array ( 
-         ​'​images_minimum_size'​ => '​100x20',​ +            ​'/​^>​.*$/'​ => false, ​ // "​false"​ remove only the line, "​true"​ remove the rest of the message 
-  '​images_maximum_size'​ => '',​ +      ​), 
-         ​'​undesired-subject-patterns'​ => array ( +      '​big_files_dir'​ => '',​ 
-                  0 => '/^Out Of Office/​i',​ +      '​use_message_id_as_uid'​ => false, // Don't change this unless you know what you are doing! 
-                  1 => '/​^Automatic answer$/​i',​ +      '​images_minimum_size'​ => '​100x20',​ 
-                  2 => '/​^Réponse automatique:/',​ +      '​images_maximum_size'​ => '',​ 
-            ), +      '​undesired-subject-patterns'​ => array ( 
-         ​'​undesired-purge-delay'​ => 7, +            0 => '/^Out Of Office/​i',​ 
-    ),+            1 => '/​^Automatic answer$/​i',​ 
 +            2 => '/​^Réponse automatique:/',​ 
 +      ), 
 +      '​undesired-purge-delay'​ => 7, 
 +      '​html-tags-to-remove'​ => array( 
 +           '​blockquote'​ => array(),  
 +           // No class specified, remove any blockquote tag 
 +           '​div'​ => array('​gmail_quote',​ '​moz-cite-prefix'​),​ 
 +           '​pre'​ => array('​moz-signature'​),​ 
 +      ); 
 + 
 +   ),
 </​code>​ </​code>​
  
Line 273: Line 283:
 | debug | Set to true to turn on debug output | false | | debug | Set to true to turn on debug output | false |
 | periodicity | Interval (in seconds) at which to check for incoming messages | 30 | | periodicity | Interval (in seconds) at which to check for incoming messages | 30 |
-| body_parts_order | Comma separated, ordered, list of MIME types, determining the preferred part of the message to retrieve for populating the ''​description''​ or ''​public_log''​ of the Ticket. ​**Note: new since 2.6.6** ​In order to import as inline images the images embedded in HTML, the HTML part of the email must be processed in priority over the text part. Therefore the recommended configuration is ''​text/​html,​text/​plain''​. | text/​html,​text/​plain |+| body_parts_order | Comma separated, ordered, list of MIME types, determining the preferred part of the message to retrieve for populating the ''​description''​ or ''​public_log''​ of the Ticket. In order to import as inline images the images embedded in HTML, the HTML part of the email must be processed in priority over the text part. Therefore the recommended configuration is ''​text/​html,​text/​plain''​. | text/​html,​text/​plain |
 | pop3_auth_options | POP3 authentication options. Possible values are: '​CRAM-MD5',​ '​APOP'​ , '​PLAIN'​ , '​LOGIN',​ '​USER'​ | USER | | pop3_auth_options | POP3 authentication options. Possible values are: '​CRAM-MD5',​ '​APOP'​ , '​PLAIN'​ , '​LOGIN',​ '​USER'​ | USER |
-| imap_options | Additional IMAP options. Possible values are listed here: [[http://​www.php.net/​manual/​en/​function.imap-open.php|IMAP flags]]. **Warning**:​ Do NOT use the ''​pop3''​ flag to connect to a POP3 mailbox using the PHP IMAP extension. Due to a limitation of the IMAP extension this will not work! If you want to connect to a POP3 server, use the POP3 protocol instead. | array('​imap', '​novalidate-cert') |+| imap_options | Additional IMAP options. Possible values are listed here: [[http://​www.php.net/​manual/​en/​function.imap-open.php|IMAP flags]]. ​\\ For example to use SSL you could specify : ''​array(0 => '​imap',​ 2 => '​ssl'​)''​ \\ **Warning**:​ Do NOT use the ''​pop3''​ flag to connect to a POP3 mailbox using the PHP IMAP extension. Due to a limitation of the IMAP extension this will not work! If you want to connect to a POP3 server, use the POP3 protocol instead. | array('​imap'​) |
 | exclude_attachment_types | Array of MIME types to exclude when retrieving attachments | array('​application/​attachment'​) | | exclude_attachment_types | Array of MIME types to exclude when retrieving attachments | array('​application/​attachment'​) |
-| html-tags-to-remove | ** new in 3.0.0 ** Used for computing the "new part" of HTML messages by removing the specified tags. The syntax is an array of ''​tag_name''​ <​nowiki>​=></​nowiki>​ array of CSS class names. | +| html-tags-to-remove | ** new in 3.0.0 ** Used for computing the "new part" of HTML messages by removing the specified tags. The syntax is an array of ''​tag_name''​ <​nowiki>​=></​nowiki>​ array of CSS class names. | //see above// ​
-  array( +
-   '​blockquote'​ => array(),  +
-   // No class specified, remove any blockquote tag +
-   '​div'​ => array('​gmail_quote',​ '​moz-cite-prefix'​),​ +
-   '​pre'​ => array('​moz-signature'​),​ +
-  ); +
-+
 | maximum_email_size | If an incoming email is bigger than the specified size, the message will saved to the ''​big_files_dir''​ if it is configured and deleted from the inbox. A notification message will be sent to the administrator as for other "​errors"​ happening when processing the mail inbox. The size can be specified using the '​short'​ notation: 100K, 3M, 2G... If set to zero, no limit will be enforced... ​ with the risk of a PHP crash if there is not enough memory to decode an incoming email. | 10M | | maximum_email_size | If an incoming email is bigger than the specified size, the message will saved to the ''​big_files_dir''​ if it is configured and deleted from the inbox. A notification message will be sent to the administrator as for other "​errors"​ happening when processing the mail inbox. The size can be specified using the '​short'​ notation: 100K, 3M, 2G... If set to zero, no limit will be enforced... ​ with the risk of a PHP crash if there is not enough memory to decode an incoming email. | 10M |
-| introductory-patterns | **only for plain text emails** When computing the "new part" of a message, lines matching this pattern and preceding what looks like an "old part" of the message, are removed. Adapt this list to your localization… and favorite email client dialect. The pattern specified here must follow the [[http://​www.php.net/​manual/​en/​reference.pcre.pattern.syntax.php|PCRE]] syntax. | <​code>​array ( +| introductory-patterns | **only for plain text emails** When computing the "new part" of a message, lines matching this pattern and preceding what looks like an "old part" of the message, are removed. Adapt this list to your localization… and favorite email client dialect. The pattern specified here must follow the [[http://​www.php.net/​manual/​en/​reference.pcre.pattern.syntax.php|PCRE]] syntax. | //see above// | 
-  0 => '/^le .+ a écrit :$/i', +| multiline-delimiter-patterns | **only for plain text emails** and **only for mail for ticket update** Multi-line regular expression patterns used for computing the "new part" of a message. each of theses patterns determine the beginning of the "old part" of a message, when a message is a "​Reply"​ to another message. Everything that matches this pattern (and all the text that follows this match) will be removed for the "new part". All patterns are tested successively. The pattern that provides a match closer to the beginning of the text will be used. Adapt this list to your localization and to the dialect of your favorite email clients... ​Patterns ​must follow the [[http://​www.php.net/​manual/​en/​reference.pcre.pattern.syntax.php|PCRE]] syntax.| //see above// | 
-  1 => '/^on .+ wrote:$/i', +| delimiter-patterns | **only for plain text emails** and **only for mail for ticket update** this regular expression patterns are used for detecting the lines beginning "old part" of a message, in case none of the multiline-delimiter-patterns did matchPatterns must follow the [[http://www.php.net/manual/en/reference.pcre.pattern.syntax.php|PCRE]] syntax. | //see above// |
-  2 => '​|^[0-9]{4}/​[0-9]{1,​2}/​[0-9]{1,​2} .+:​$|',​  +
-)</​code> ​+
-| multiline-delimiter-patterns | **only for plain text emails** Multi-line regular expression patterns used for computing the "new part" of a message. each of theses patterns determine the beginning of the "old part" of a message, when a message is a "​Reply"​ to another message. Everything that matches this pattern (and all the text that follows this match) will be removed for the "new part". All patterns are tested successively. The pattern that provides a match closer to the beginning of the text will be used. Adapt this list to your localization and to the dialect of your favorite email clients... ​The pattern specified here must follow the [[http://​www.php.net/​manual/​en/​reference.pcre.pattern.syntax.php|PCRE]] syntax.| ​<code php>​array ( +
-  0 => '/\\RFrom: .+\\RSent: .+\\R/m', +
-  1 => '/\\R_+\\R/m', +
-  2 => '/​\\RDe : .+\\R\\R?​Envoyé ​: /m', +
-  3 => '/\\RDe : .+\\RDate d\'​envoi : .+\\R/m', +
-  4 => '/\\R-----Message d\'​origine-----\\R/m', +
-  5 => '/​\\RExpéditeur: ​.+\\RDate:/​m',​ +
-  6 => '/​\\RDe : .+\\RDate : /m', +
-  7 => '/\\TO:​.+\\RCC:​/m', +
-)</code> ​|+
 | big_files_dir | The path to a directory where to store emails bigger than ''​maximum_email_size''​. If this directory is not configured, the emails are simply deleted before notifying the administrator. |  | | big_files_dir | The path to a directory where to store emails bigger than ''​maximum_email_size''​. If this directory is not configured, the emails are simply deleted before notifying the administrator. |  |
 | use_message_id_as_uid | Boolean. For IMAP connections only. Whether or not to use the identifier from the message (MessageID) instead of the Mailbox'​ unique identifier (UID) to uniquely identify the already processed messages. This can be useful to workaround problems when the UID of the messages on the server changes between sessions (like with Gmail). If you toggle this value, make sure that you first empty the mailbox (and stop the cron job), since all messages present in the mailbox when the setting is changed will be considered as new and processed again. | false | | use_message_id_as_uid | Boolean. For IMAP connections only. Whether or not to use the identifier from the message (MessageID) instead of the Mailbox'​ unique identifier (UID) to uniquely identify the already processed messages. This can be useful to workaround problems when the UID of the messages on the server changes between sessions (like with Gmail). If you toggle this value, make sure that you first empty the mailbox (and stop the cron job), since all messages present in the mailbox when the setting is changed will be considered as new and processed again. | false |
-| images_minimum_size | **new in 2.6.6** ​Minimum dimensions for importing images. Images smaller than the given dimensions will be ignored and not imported as attachments. The dimensions are expressed as a string //​width//''​x''//​height//​ (where //width// and //height// are integer numbers, in pixels). | 100x20 | +| images_minimum_size | Minimum dimensions for importing images. Images smaller than the given dimensions will be ignored and not imported as attachments. The dimensions are expressed as a string //​width//''​x''//​height//​ (where //width// and //height// are integer numbers, in pixels). | 100x20 | 
-| images_maximum_size | **new in 2.6.6** ​Images bigger than these dimensions (for example ''​1000x1000''​) will be resized to fit in the given dimensions. The dimensions are expressed as a string //​width//''​x''//​height//​ (where //width// and //height// are integer numbers, in pixels). **Note** this feature is available only if PHP GD is installed. If no dimensions are given, the images are never resized. | |+| images_maximum_size | Images bigger than these dimensions (for example ''​1000x1000''​) will be resized to fit in the given dimensions. The dimensions are expressed as a string //​width//''​x''//​height//​ (where //width// and //height// are integer numbers, in pixels). **Note** this feature is available only if PHP GD is installed. If no dimensions are given, the images are never resized. | |
 | undesired-subject-patterns | An array of regular expression patterns (as PHP text strings) that will be used to test the subject of the incoming email. If any of these pattern matches, the email will be considered as "​undesirable"​ and rejected (the same processing as for any other error case will then be applied). The patterns specified here must follow the [[http://​www.php.net/​manual/​en/​reference.pcre.pattern.syntax.php|PCRE]] syntax. | array() | | undesired-subject-patterns | An array of regular expression patterns (as PHP text strings) that will be used to test the subject of the incoming email. If any of these pattern matches, the email will be considered as "​undesirable"​ and rejected (the same processing as for any other error case will then be applied). The patterns specified here must follow the [[http://​www.php.net/​manual/​en/​reference.pcre.pattern.syntax.php|PCRE]] syntax. | array() |
 | undesired-purge-delay | Delay in days to remove automatically the undesired messages (0 means that the messages are removed immediately) | 7 | | undesired-purge-delay | Delay in days to remove automatically the undesired messages (0 means that the messages are removed immediately) | 7 |
 +| recommended_max_allowed_packet | Display a warning on the '​Mailbox Content'​ screen if the database parameter '​max_allowed_packet'​ is less than the one configured | 10*1024*1024 |
 +
 <note important>​When specifying PCRE patterns inside the configuration file, make sure that you double the backslash characters, since backslashes must be escaped inside PHP litteral text strings.</​note>​ <note important>​When specifying PCRE patterns inside the configuration file, make sure that you double the backslash characters, since backslashes must be escaped inside PHP litteral text strings.</​note>​
  
Line 320: Line 313:
  
 ^  Parameter ​ ^  Meaning ​ ^  Default Value  ^ ^  Parameter ​ ^  Meaning ​ ^  Default Value  ^
-| ticket_log| An associative array (hash) defining, for each class of Ticket, the code of the attribute to set when updating a ticket from an incoming message. You don't need to change this value unless you modified the Data Model. | <​code>​array ( +| ticket_log| An associative array (hash) defining, for each class of Ticket, the code of the attribute to set when updating a ticket from an incoming message. You don't need to change this value unless you modified the Data Model. | //see above// ​|
-  '​ticket_log'​ => array ( +
-    '​UserRequest'​ => '​public_log',​ +
-    '​Incident'​ => '​public_log',​ +
-  ), +
-)</code>|+
  
-====== Checking the connection ​======+====== Troubleshooting ====== 
 + 
 +===== Limitations ===== 
 + 
 +  * Each mail inbox configured corresponds to one type of Ticket (i.e. User Requests or Incidents, but not both). 
 +  * Connecting to a POP3 mailbox via the php IMAP extension does **not** work. You **must** use the POP3 configuration via PEAR::​NetSocket for such a case. 
 +  * There is no validation that the target class of the Mail Inbox is an existing class in iTop. (i.e. don't try to create incidents if the Incident Management module is not installed). 
 +  * The support of inline images works only if the preferred order for email parts is configured as "​text/​html,​text/​plain"​ (i.e. HTML first), which is now the default for all new installations. 
 +<note important>​When processing an email considered as an update to a ticket, the extensions tries to extract the "new part" of the message (excluding the content from previous messages). However, depending on the format of the reply (which itself depends on the email client software used) it may not be possible to extract this information in a reliable manner. In such a case the whole text of the email will be used. Unfortunately,​ the widely used MS Outlook is an example of such client software where the replies cannot reliably be identified. Refer to the configuration parameter ''​html-tags-to-remove''​ for explanations about how to adjust this behavior.</​note>​ 
 + 
 + 
 +===== Checking the connection =====
  
 Once the Mail Inbox object has been created, you can use the tab "​Mailbox Content"​ in the details of the object to check that the application can properly connect to the mail server and retrieve messages from it. Once the Mail Inbox object has been created, you can use the tab "​Mailbox Content"​ in the details of the object to check that the application can properly connect to the mail server and retrieve messages from it.
  
-{{ :​extensions:​email-synchro-mailbox-content.png?​nolink&​600 |Mailbox Content tab}}+{{ :​extensions:​standard_mail_inbox.png?​nolink&​600 |Mailbox Content tab}}
  
 <note tip>To deeply inspect the content of the mailbox it is always better to use a real mail client application. The view provided in this tab is just use to help troubleshooting connection problems.</​note>​ <note tip>To deeply inspect the content of the mailbox it is always better to use a real mail client application. The view provided in this tab is just use to help troubleshooting connection problems.</​note>​
Line 339: Line 338:
   * "Reset Status":​ for messages which are either flagged as "​Error"​ or "​Already processed",​ this status will be reset and the email will considered again as "​New"​ and thus candidate for processing the next time cron.php runs.   * "Reset Status":​ for messages which are either flagged as "​Error"​ or "​Already processed",​ this status will be reset and the email will considered again as "​New"​ and thus candidate for processing the next time cron.php runs.
   * "​Delete eMail":​ deletes the message(s) from the mailbox. No confirmation will be asked !!   * "​Delete eMail":​ deletes the message(s) from the mailbox. No confirmation will be asked !!
 +  * "​Ignore eMail":​ mark new messages as "​ignored"​ to avoid processing them.
  
-====== Debugging ====== 
  
-**New in 3.0.16**: Access to the eml used and to the message specific logs when the message triggers an error is now possible ​without activating the debug mode.+ 
 +===== Debugging ===== 
 + 
 +**New in 3.0.15**: Access to the eml used and to the message specific logs without activating the debug mode for every processed message.
  
  
Line 360: Line 362:
  
 <note warning>​__Known issue until 3.0.17 included__: When activating debug trace, logging trace may truncate an UTF8 character which breaks MySQL insertion and stop current email processing. Because of this, don't use this mode as a permanent mode, but only for temporary debug.</​note>​ <note warning>​__Known issue until 3.0.17 included__: When activating debug trace, logging trace may truncate an UTF8 character which breaks MySQL insertion and stop current email processing. Because of this, don't use this mode as a permanent mode, but only for temporary debug.</​note>​
 +
 +
 +===== Questions & Answers =====
 +
 +**Question: Mails are no more processed?​** \\
 +Answer: ​
 +  - It might be due to a email message with a too big attachment, which can end-up crashing the database. In that case, to quickly process the following emails, open the Mail Inbox in iTop, tab: Mailbox Content; identify the faulty email, probably the oldest "​new"​ message and check it and press the ''​Ignore''​ button.
 +  - To limit the above situation, check coherence between ''​allowed_max_packet'',​ ''​recommended_max_allowed_packet''​ and ''​maximum_email_size''​ parameters.
 +  - It might be due to the cron.php not running
 +
 +
 +**Question: a particular mail is in error, why?** \\
 +Answer: There can be multiple reasons, which leads to flagging a mail in error. When browsing the ''​Mailbox Content''​ tab on the ''​Incoming eMail Inboxes''​ the error message should explain you the reason. Attachment too big, mail in an unkown format (encrypted for eg.),...
 +
 +
extensions/ticket-from-email.1556013553.txt.gz · Last modified: 2019/04/23 11:59 (external edit)

";