Menu

Seeking assistance with iTop's Mail-to-Ticket extension

2022-12-14
2023-01-17
  • James Smith

    James Smith - 2022-12-14

    Hello All,

    I have been working with iTop for a few months and I have made some good progress with getting certain things figured out. My recent hurdle is that I am not able to get the Mail-to-Ticket extension to take the emails and turn them into tickets. It is finding the emails, but that is all it is doing.

    Here is what I currently have:

    iTop version: 3.0.0-8663
    Mail-to-Ticket version: Mail to ticket automation 3.5.2
    Inbox type: Standard Mail Inbox

    NOTES:
    - This setup is to test the Mail-to-Ticket extension. I have a different instance setup that I have created additional groups to add devices to and have setup the SMTP stuff for notifications. All that stuff seems to work fine.
    - Installing the extension seems to fail when creating the email_replica table. I have to manually run the SQL script for creating the table and I have to add "ROW_FORMAT=DYNAMIC" to the end of it, then I can install the extension.

    SQL Script:

    CREATE TABLE email_replica(
    id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    ticket_id INT(11) DEFAULT 0,
    uidl VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '',
    INDEX uidl(uidl(95)),
    mailbox_path VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '',
    message_id VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '',
    message_text TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
    references TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
    thread_index TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
    message_date DATETIME,
    last_seen DATETIME,
    status ENUM('error', 'ignored', 'ok', 'undesired') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ok',
    error_message TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
    error_trace LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
    contents_data LONGBLOB,
    contents_mimetype VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
    contents_filename VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
    ) ENGINE = INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC


    Mailbox Configuration:
    Mail Server: outlook.office365.com
    Login: <email_address>@hotmail.com
    Password: associated password
    Protocol: IMAP
    Port: 993
    Mailbox (for IMAP): itop_incidents
    Active: Yes
    Debug trace: Yes</email_address>

    Behavior of Incoming eMails:
    Behavior: Create or Update Tickets
    After processing the eMail: Keep it on the mail server
    Ticket Class: Incident

    Emails in Error:
    Behavior in case of error: Keep the message in the mailbox

    Unknown Callers:
    Behavior in case of Unknown Caller: Create a new Person

    NOTE: If field is not listed above, I left it blank on the configuration. (Reference image itop_001)


    General Configuration :

    <?php

    /*
    *
    * Configuration file, generated by the iTop configuration wizard
    *
    * The file is used in MetaModel::LoadConfig() which does all the necessary initialization job
    *
    /
    $MySettings = array(

    // access_message: Message displayed to the users when there is any access restriction
    // default: 'iTop is temporarily frozen, please wait... (the admin team)'
    'access_message' => 'iTop is temporarily frozen, please wait... (the admin team)',

    // access_mode: Access mode: ACCESS_READONLY = 0, ACCESS_ADMIN_WRITE = 2, ACCESS_FULL = 3
    // default: 3
    'access_mode' => 3,

    // activity_panel.entry_form_opened_by_default: Whether or not the new entry form will be automatically opened when viewing an object.
    // default: false
    'activity_panel.entry_form_opened_by_default' => false,

    // activity_panel.show_author_name_below_entries: Whether or not to show the author friendlyname next to the date on the last entry.
    // default: false
    'activity_panel.show_author_name_below_entries' => false,

    'allowed_login_types' => 'form|external|basic',

    // apc_cache.enabled: If set, the APC cache is allowed (the PHP extension must also be active)
    // default: true
    'apc_cache.enabled' => true,

    // apc_cache.query_ttl: Time to live set in APC for the prepared queries (seconds - 0 means no timeout)
    // default: 3600
    'apc_cache.query_ttl' => 3600,

    // app_root_url: Root URL used for navigating within the application, or from an email to the application (you can put $SERVER_NAME$ as a placeholder for the server's name)
    // default: ''
    'app_root_url' => 'http://172.29.90.51/itop_dev_300_demo/',

    // behind_reverse_proxy: If true, then proxies custom header (X-Forwarded-*) are taken into account. Use only if the webserver is not publicly accessible (reachable only by the reverse proxy)
    // default: false
    'behind_reverse_proxy' => false,

    // cron_max_execution_time: Duration (seconds) of the page cron.php, must be shorter than php setting max_execution_time and shorter than the web server response timeout
    // default: 600
    'cron_max_execution_time' => 600,

    // csv_file_default_charset: Character set used by default for downloading and uploading data as a CSV file. Warning: it is case sensitive (uppercase is preferable).
    // default: 'ISO-8859-1'
    'csv_file_default_charset' => 'ISO-8859-1',

    'csv_import_charsets' => array (
    ),

    // csv_import_history_display: Display the history tab in the import wizard
    // default: false
    'csv_import_history_display' => false,

    // date_and_time_format: Format for date and time display (per language)
    // default: array (
    // 'default' =>
    // array (
    // 'date' => 'Y-m-d',
    // 'time' => 'H:i:s',
    // 'date_time' => '$date $time',
    // ),
    // )
    'date_and_time_format' => array('default' => array('date' => 'Y-m-d', 'time' => 'H:i:s', 'date_time' => '$date $time')),

    'db_host' => 'localhost',

    'db_name' => 'pas_dev_300_demo',

    'db_pwd' => '',

    'db_subname' => '',

    'db_user' => 'root',

    // deadline_format: The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$
    // default: '$difference$'
    'deadline_format' => '$difference$',

    'default_language' => 'EN US',

    // email_asynchronous: If set, the emails are sent off line, which requires cron.php to be activated. Exception: some features like the email test utility will force the serialized mode
    // default: false
    'email_asynchronous' => false,

    // email_default_sender_address: Default address provided in the email from header field.
    // default: ''
    'email_default_sender_address' => '',

    // email_default_sender_label: Default label provided in the email from header field.
    // default: ''
    'email_default_sender_label' => '',

    // email_transport: Mean to send emails: PHPMail (uses the function mail()) or SMTP (implements the client protocol)
    // default: 'PHPMail'
    'email_transport' => 'PHPMail',

    // email_validation_pattern: Regular expression to validate/detect the format of an eMail address
    // default: '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,}'
    'email_validation_pattern' => '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,}',

    'encryption_key' => 'dee5b6f41c517bc2f22cefb8f6b7017ce5897eb82f4975843074691a59fa0082',

    'encryption_library' => 'OpenSSL',

    'ext_auth_variable' => '$_SERVER[\'REMOTE_USER\']',

    'fast_reload_interval' => '60',

    // graphviz_path: Path to the Graphviz "dot" executable for graphing objects lifecycle
    // default: '/usr/bin/dot'
    'graphviz_path' => 'C:\Program Files\Graphviz\bin\dot.exe',

    // high_cardinality_classes: List of classes with high cardinality (Force manual submit of search)
    // default: array (
    // )
    'high_cardinality_classes' => array(),

    // inline_image_max_display_width: The maximum width (in pixels) when displaying images inside an HTML formatted attribute. Images will be displayed using this this maximum width.
    // default: '250'
    'inline_image_max_display_width' => '250',

    // inline_image_max_storage_width: The maximum width (in pixels) when uploading images to be used inside an HTML formatted attribute. Images larger than the given size will be downsampled before storing them in the database.
    // default: '1600'
    'inline_image_max_storage_width' => '1600',

    // link_set_attribute_qualifier: Link set from string: attribute qualifier (encloses both the attcode and the value)
    // default: '\''
    'link_set_attribute_qualifier' => '\'',

    // link_set_attribute_separator: Link set from string: attribute separator
    // default: ';'
    'link_set_attribute_separator' => ';',

    // link_set_item_separator: Link set from string: line separator
    // default: '|'
    'link_set_item_separator' => '|',

    // link_set_value_separator: Link set from string: value separator (between the attcode and the value itself
    // default: ':'
    'link_set_value_separator' => ':',

    'log_global' => true,

    'log_issue' => true,

    'log_notification' => true,

    'log_web_service' => true,

    'max_display_limit' => '30',

    // max_linkset_output: Maximum number of items shown when getting a list of related items in an email, using the form $this->some_list$. 0 means no limit.
    // default: 100
    'max_linkset_output' => 100,

    // mentions.allowed_classes: Classes which can be mentioned through the autocomplete in the caselogs. Key of the array must be a single character that will trigger the autocomplete, value must be a DM class (eg. "@" => "Person", "?" => "FAQ")
    // default: array (
    // '@' => 'Person',
    // )
    'mentions.allowed_classes' => array('@' => 'Person'),

    'min_display_limit' => '20',

    // online_help: Hyperlink to the online-help web page
    // default: 'http://www.combodo.com/itop-help'
    'online_help' => 'http://www.combodo.com/itop-help',

    // optimize_requests_for_join_count: Optimize request joins to minimize the count (default is true, try to set it to false in case of performance issues)
    // default: true
    'optimize_requests_for_join_count' => true,

    'password_hash_algo' => 1,

    // php_path: Path to the php executable in CLI mode
    // default: 'php'
    'php_path' => 'php',

    // search_manual_submit: Force manual submit of search all requests
    // default: false
    'search_manual_submit' => false,

    'secure_connection_required' => false,

    // session_name: The name of the cookie used to store the PHP session id
    // default: 'iTop'
    'session_name' => 'iTop',

    // shortcut_actions: Actions that are available as direct buttons next to the "Actions" menu
    // default: 'UI:Menu:Modify,UI:Menu:New'
    'shortcut_actions' => 'UI:Menu:Modify,UI:Menu:New',

    // source_dir: Source directory for the datamodel files. (which gets compiled to env-production).
    // default: ''
    'source_dir' => 'datamodels/2.x/',

    'standard_reload_interval' => '300',

    // synchro_trace: Synchronization details: none, display, save (includes 'display')
    // default: 'none'
    'synchro_trace' => 'none',

    // tag_set_item_separator: Tag set from string: tag label separator
    // default: '|'
    'tag_set_item_separator' => '|',

    // timezone: Timezone (reference: http://php.net/manual/en/timezones.php). If empty, it will be left unchanged and MUST be explicitly configured in PHP
    // default: 'Europe/Paris'
    'timezone' => 'Europe/Paris',

    // tracking_level_linked_set_default: Default tracking level if not explicitly set at the attribute level, for AttributeLinkedSet (defaults to NONE in case of a fresh install, LIST otherwise - this to preserve backward compatibility while upgrading from a version older than 2.0.3 - see TRAC #936)
    // default: 1
    'tracking_level_linked_set_default' => 0,

    // url_validation_pattern: Regular expression to validate/detect the format of an URL (URL attributes and Wiki formatting for Text attributes)
    // default: '(https?|ftp)\://([a-zA-Z0-9+!*(),;?&=\$_.-]+(\:[a-zA-Z0-9+!*(),;?&=\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\:[0-9]{2,5})?(/([a-zA-Z0-9%+\$_-]\.?)+)/?(\?[a-zA-Z+&\$_.-][a-zA-Z0-9;:[\]@&%=+/\$_.-])?(#[a-zA-Z_.-][a-zA-Z0-9+\$_.-])?'
    'url_validation_pattern' => '(https?|ftp)\://([a-zA-Z0-9+!*(),;?&=\$_.-]+(\:[a-zA-Z0-9+!*(),;?&=\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\:[0-9]{2,5})?(/([a-zA-Z0-9%+\$_-]\.?)+)
    /?(\?[a-zA-Z+&\$_.-][a-zA-Z0-9;:[\]@&%=+/\$_.-])?(#[a-zA-Z_.-][a-zA-Z0-9+\$_.-])?',
    );

    /*
    *
    * Modules specific settings
    *
    /
    $MyModuleSettings = array(
    'authent-cas' => array (
    'cas_debug' => false,
    'cas_host' => '',
    'cas_port' => '',
    'cas_context' => '',
    'cas_version' => '',
    ),
    'authent-ldap' => array (
    'host' => 'localhost',
    'port' => 389,
    'default_user' => '',
    'default_pwd' => '',
    'base_dn' => 'dc=yourcompany,dc=com',
    'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))',
    'options' => array (
    17 => 3,
    8 => 0,
    ),
    'start_tls' => false,
    'debug' => false,
    'servers' => array (
    ),
    ),
    'itop-attachments' => array (
    'allowed_classes' => array (
    0 => 'Ticket',
    ),
    'position' => 'relations',
    'preview_max_width' => 290,
    'icon_preview_max_size' => 500000,
    ),
    'itop-backup' => array (
    'mysql_bindir' => '',
    'week_days' => 'monday, tuesday, wednesday, thursday, friday',
    'time' => '23:30',
    'retention_count' => 5,
    'enabled' => true,
    'itop_backup_incident' => '',
    ),
    'combodo-email-synchro' => array (
    'notify_errors_to' => '',
    'notify_errors_from' => '',
    'debug' => false,
    'periodicity' => 30,
    'retention_period' => 1,
    'body_parts_order' => 'text/html,text/plain',
    'pop3_auth_option' => 'USER',
    'imap_options' => array (
    0 => 'imap',
    1 => 'ssl',
    ),
    'maximum_email_size' => '10M',
    'big_files_dir' => '',
    'exclude_attachment_types' => array (
    0 => 'application/exe',
    ),
    'introductory-patterns' => array (
    0 => '/^le .+ a écrit :$/i',
    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',
    1 => '/\R_+\R/m',
    2 => '/\RDe : .+\R\R?Envoyé : /m',
    3 => '/\RDe : .+\RDate d\'envoi : .+\R/m',
    4 => '/\R-----Message d\'origine-----\R/m',
    ),
    'use_message_id_as_uid' => false,
    'images_minimum_size' => '100x20',
    'images_maximum_size' => '',
    'recommended_max_allowed_packet' => 10485760,
    ),
    'itop-standard-email-synchro' => array (
    'inline_image_max_width' => '500',
    'ticket_log' => array (
    'UserRequest' => 'public_log',
    'Incident' => 'public_log',
    ),
    ),
    );

    /*
    *
    * Data model modules to be loaded. Names are specified as relative paths
    *
    /
    $MyModules = array(
    'addons' => array('user rights' => 'addons/userrights/userrightsprofile.class.inc.php'),
    );
    ?>


    There is clearly something that I am missing. I just have not been able to figure it out and was hoping for some assistance. Thank you.

     

    Last edit: James Smith 2022-12-14
  • James Smith

    James Smith - 2022-12-15

    UPDATE: I saw a post about how the iTop Mail-to-Ticket extension will no longer work with Office365 unless you upgrade your Mail-to-Ticket to version 3.6.0 and utilize OAuth2.
    Reference https://sourceforge.net/p/itop/discussion/922361/thread/08b8e2bfd7/

    In response to this, I went ahead and tried using my GMail account and I am have the same issue with it not creating tickets even though it is pulling the emails.

     
    • Jeffrey Bostoen

      Jeffrey Bostoen - 2023-01-06

      So you do see the emails in iTop? Sure it's not just your cron job which isn't running then?

       
      • James Smith

        James Smith - 2023-01-06

        The emails do show up. I thought the cron job was running. That said, I tried running cron manually to see if it would generate the tickets, but to no avail. This is also assuming that I did that correctly. If I am understanding your question correctly, since I am seeing the emails, that would suggest that the extension is doing its job and cron could be my issue. I will revisit cron and see what I can come up with. Thank you.

         
        • Jeffrey Bostoen

          Jeffrey Bostoen - 2023-01-08

          Indeed. If it sees the items in your mailbox, at least the mailbox configuration itself is correct.

          If it doesn't work then, it's either stuff like default values in the ticket generation (you should see this kind of error when enabling the debug trace in the mailbox config); or the cron simply not executing properly.

           
          • James Smith

            James Smith - 2023-01-17

            So as it would turn out, the issue was the CRON job. Even though I had scheduled it to run, it wasn't doing anything because I had not edited the cron.cmd file to do anything. One of those small things that makes a big difference. Now, onto the next step! Thank you Jeffrey.

             
  • James Smith

    James Smith - 2023-01-06

    I'm hoping someone can help me with this issue. I appreciate any assistance.

     

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.