Thunderbird & Chrome : Erreur Assertion ‘GDK_IS_WAYLAND_WINDOW (window)’

En passant

Je viens de voir une nouvelle erreur au lancement de Thunderbird à cause de GDK :

[GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection.
[Parent 7820, Main Thread] WARNING: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167
(thunderbird-beta:7820): Gdk-CRITICAL **: 08:52:03.518: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
[Parent 7820, Main Thread] WARNING: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167
(thunderbird-beta:7820): Gdk-CRITICAL **: 08:52:03.677: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
[Parent 7820, Main Thread] WARNING: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167
(thunderbird-beta:7820): Gdk-CRITICAL **: 08:52:03.794: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
[Parent 7820, Main Thread] WARNING: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167
(thunderbird-beta:7820): Gdk-CRITICAL **: 08:52:04.091: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
[Parent 7820, Main Thread] WARNING: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167
(thunderbird-beta:7820): Gdk-CRITICAL **: 08:52:04.190: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed

Visiblement l’erreur est liée en GDK et j’ai la même sous Chrome :

# google-chrome --ozone-platform-hint=auto --enable-crashpad --flag-switches-begin --flag-switches-end
[10471:10471:0926/085428.037184:ERROR:browser_main_loop.cc(268)] Gdk: gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed
[10527:10527:0926/085428.297558:ERROR:gpu_init.cc(440)] Passthrough is not supported, GL is egl, ANGLE is 
[10527:10527:0926/085428.304771:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[10471:10471:0926/085428.496052:ERROR:cursor_loader.cc(116)] Failed to load a platform cursor of type kNull

J’ai fait une mise à jours de chrome mais sans succès :

$ google-chrome --version
Google Chrome 99.0.4844.84
$ google-chrome --version
Google Chrome 105.0.5195.125

Le problème est donc par ici :

# dpkg -l "*gtk*" | grep ii
ii  appmenu-gtk-module-common          0.7.6-2                         all          Common files for GtkMenuShell D-Bus exporter
ii  appmenu-gtk2-module:amd64          0.7.6-2                         amd64        GtkMenuShell D-Bus exporter (GTK+2.0)
ii  appmenu-gtk3-module:amd64          0.7.6-2                         amd64        GtkMenuShell D-Bus exporter (GTK+3.0)
ii  apport-gtk                         2.20.11-0ubuntu82.1             all          GTK+ frontend for the apport crash report system
ii  blackbird-gtk-theme                0.4+20171213-3                  all          dark GTK+ theme from the Shimmer Project
ii  bluebird-gtk-theme                 1.3-1ubuntu1                    all          blue GTK+ theme from the Shimmer Project
ii  freeciv-client-gtk3                2.6.6-1                         amd64        Civilization turn based strategy game (GTK 3 client)
ii  gir1.2-gtk-2.0:amd64               2.24.33-2ubuntu2                amd64        GTK graphical user interface library -- gir bindings
ii  gir1.2-gtk-3.0:amd64               3.24.33-1ubuntu2                amd64        GTK graphical user interface library -- gir bindings
ii  gir1.2-gtk-4.0:amd64               4.6.6+ds-0ubuntu1               amd64        GTK graphical user interface library -- gir bindings
ii  gir1.2-gtkchamplain-0.12:amd64     0.12.20-1build1                 amd64        Gtk+ widget to display maps (GObject introspection)
ii  gir1.2-gtkclutter-1.0:amd64        1.8.4-4build2                   amd64        GObject introspection data for the GTK+ Clutter library
ii  gir1.2-gtksource-4:amd64           4.8.3-1                         amd64        gir files for the GTK+ syntax highlighting widget
ii  gir1.2-javascriptcoregtk-4.0:amd64 2.36.7-0ubuntu0.22.04.1         amd64        JavaScript engine library from WebKitGTK - GObject introspection data
ii  greybird-gtk-theme                 3.23.1-0ubuntu1                 all          grey GTK+ theme from the Shimmer Project
ii  gstreamer1.0-gtk3:amd64            1.20.3-0ubuntu1                 amd64        GStreamer plugin for GTK+3
ii  gtk-update-icon-cache              3.24.33-1ubuntu2                amd64        icon theme caching utility
ii  gtk2-engines-murrine:amd64         0.98.2-3build2                  amd64        cairo-based gtk+-2.0 theme engine
ii  gtk2-engines-pixbuf:amd64          2.24.33-2ubuntu2                amd64        pixbuf-based theme for GTK 2
ii  ibus-gtk:amd64                     1.5.26-4                        amd64        Intelligent Input Bus - GTK2 support
ii  ibus-gtk3:amd64                    1.5.26-4                        amd64        Intelligent Input Bus - GTK3 support
ii  ibus-gtk4:amd64                    1.5.26-4                        amd64        Intelligent Input Bus - GTK4 support
ii  libappmenu-gtk2-parser0:amd64      0.7.6-2                         amd64        GtkMenuShell to GMenuModel parser (GTK+2.0)
ii  libappmenu-gtk3-parser0:amd64      0.7.6-2                         amd64        GtkMenuShell to GMenuModel parser (GTK+3.0)
ii  libcanberra-gtk-common-dev         0.30-10ubuntu1                  all          simple interface for playing event sounds (GTK+ shared development files)
ii  libcanberra-gtk-dev:amd64          0.30-10ubuntu1                  amd64        simple interface for playing event sounds (GTK+ 2 development files)
ii  libcanberra-gtk0:amd64             0.30-10ubuntu1                  amd64        GTK+ helper for playing widget event sounds with libcanberra
ii  libcanberra-gtk3-0:amd64           0.30-10ubuntu1                  amd64        GTK+ 3.0 helper for playing widget event sounds with libcanberra
ii  libcanberra-gtk3-dev:amd64         0.30-10ubuntu1                  amd64        simple interface for playing event sounds (GTK+ 3 development files)
ii  libcanberra-gtk3-module:amd64      0.30-10ubuntu1                  amd64        translates GTK3 widgets signals to event sounds
ii  libchamplain-gtk-0.12-0:amd64      0.12.20-1build1                 amd64        Gtk+ widget to display maps
ii  libcheese-gtk25:amd64              41.1-1build1                    amd64        tool to take pictures and videos from your webcam - widgets
ii  libclutter-gtk-1.0-0:amd64         1.8.4-4build2                   amd64        Open GL based interactive canvas library GTK+ widget
ii  libcolord-gtk1:amd64               0.3.0-1                         amd64        GTK+ convenience library for interacting with colord
ii  libdbusmenu-gtk3-4:amd64           16.04.1+18.10.20180917-0ubuntu8 amd64        library for passing menus over DBus - GTK+ version
ii  libgarcon-gtk3-1-0:amd64           4.16.1-1                        amd64        menu library for Xfce (GTK3 library)
ii  libgtk-3-0:amd64                   3.24.33-1ubuntu2                amd64        GTK graphical user interface library
ii  libgtk-3-bin                       3.24.33-1ubuntu2                amd64        programs for the GTK graphical user interface library
ii  libgtk-3-common                    3.24.33-1ubuntu2                all          common files for the GTK graphical user interface library
ii  libgtk-3-dev:amd64                 3.24.33-1ubuntu2                amd64        development files for the GTK library
ii  libgtk-4-1:amd64                   4.6.6+ds-0ubuntu1               amd64        GTK graphical user interface library
ii  libgtk-4-bin                       4.6.6+ds-0ubuntu1               amd64        programs for the GTK graphical user interface library
ii  libgtk-4-common                    4.6.6+ds-0ubuntu1               all          common files for the GTK graphical user interface library
ii  libgtk-vnc-2.0-0:amd64             1.3.0-1ubuntu1                  amd64        VNC viewer widget for GTK+3 (runtime libraries)
ii  libgtk2.0-0:amd64                  2.24.33-2ubuntu2                amd64        GTK graphical user interface library - old version
ii  libgtk2.0-bin                      2.24.33-2ubuntu2                amd64        programs for the GTK graphical user interface library
ii  libgtk2.0-common                   2.24.33-2ubuntu2                all          common files for the GTK graphical user interface library
ii  libgtk2.0-dev:amd64                2.24.33-2ubuntu2                amd64        development files for the GTK library
ii  libgtk3-perl                       0.038-1                         all          Perl bindings for the GTK+ graphical user interface library
ii  libgtkd-3-0:amd64                  3.10.0-1ubuntu1                 amd64        GTK+ graphical user interface library - D bindings
ii  libgtkglext1:amd64                 1.2.0-11                        amd64        OpenGL Extension to GTK+ (shared libraries)
ii  libgtkmm-3.0-1v5:amd64             3.24.5-1build1                  amd64        C++ wrappers for GTK+ (shared libraries)
ii  libgtksourceview-4-0:amd64         4.8.3-1                         amd64        shared libraries for the GTK+ syntax highlighting widget
ii  libgtksourceview-4-common          4.8.3-1                         all          common files for the GTK+ syntax highlighting widget
ii  libgtkspell0:amd64                 2.0.16-1.3                      amd64        spell-checking addon for GTK's TextView widget
ii  libjavascriptcoregtk-4.0-18:amd64  2.36.7-0ubuntu0.22.04.1         amd64        JavaScript engine library from WebKitGTK
ii  libreoffice-gtk3                   1:7.3.6-0ubuntu0.22.04.1        amd64        office productivity suite -- GTK+ 3 integration
ii  libspice-client-gtk-3.0-5:amd64    0.39-3ubuntu1                   amd64        GTK3 widget for SPICE clients (runtime library)
ii  libunity-gtk2-parser0:amd64        0.0.0+18.04.20171202-0ubuntu3   amd64        GtkMenuShell to GMenuModel parser
ii  libunity-gtk3-parser0:amd64        0.0.0+18.04.20171202-0ubuntu3   amd64        GtkMenuShell to GMenuModel parser
ii  libwebkit2gtk-4.0-37:amd64         2.36.7-0ubuntu0.22.04.1         amd64        Web content engine library for GTK
ii  libwmf-0.2-7-gtk                   0.2.12-5ubuntu1                 amd64        Windows metafile conversion GTK pixbuf plugin
ii  libwmf0.2-7-gtk:amd64              0.2.12-5ubuntu1                 amd64        Windows metafile conversion GTK pixbuf plugin - transitional package
ii  libwxgtk3.0-gtk3-0v5:amd64         3.0.5.1+dfsg-4                  amd64        wxWidgets Cross-platform C++ GUI toolkit (GTK 3 runtime)
ii  libzlui-gtk                        0.12.10dfsg2-6                  amd64        GTK+ interface module for ZLibrary
ii  python3-aptdaemon.gtk3widgets      1.1.1+bzr982-0ubuntu39          all          Python 3 GTK+ 3 widgets to run an aptdaemon client
ii  qt5-gtk-platformtheme:amd64        5.15.3+dfsg-2ubuntu0.2          amd64        Qt 5 GTK+ 3 platform theme
ii  software-properties-gtk            0.99.22.3                       all          manage the repositories that you install software from (gtk)
ii  transmission-gtk                   3.00-2ubuntu2                   amd64        lightweight BitTorrent client (GTK+ interface)
ii  ubuntu-release-upgrader-gtk        1:22.04.14                      all          manage release upgrades
ii  unity-gtk-module-common            0.0.0+18.04.20171202-0ubuntu3   all          Common files for GtkMenuShell D-Bus exporter
ii  xdg-desktop-portal-gtk             1.14.0-1build1                  amd64        GTK+/GNOME portal backend for xdg-desktop-portal
ii  xdg-user-dirs-gtk                  0.10-3build2                    amd64        tool to manage well known user directories (Gtk extension)
ii  yaru-theme-gtk                     22.04.4                         all          Yaru GTK theme from the Ubuntu Community

A suivre.

Thunderbird sous Linux : Refaire les index pour la recherche des emails.

La recherche sous ThunderBird ne fonctionne plus, il faut donc refaire les index.

# locate global-messages-db.sqlite | xargs du -h
1,2M	/home/XXXXX/.thunderbird/0ywo1rhk.default-beta/global-messages-db.sqlite
1,2M	/home/XXXXX/.thunderbird/b15soes8.default-release-1/global-messages-db.sqlite
1,2M	/home/XXXXX/.thunderbird/dqmb6p3g.default/global-messages-db.sqlite
1,2M	/home/XXXXX/.thunderbird/ea15798n.default-release/global-messages-db.sqlite
1,2M	/home/XXXXX/.thunderbird/g5f2xgbj.default-beta-1/global-messages-db.sqlite
1,2M	/home/XXXXX/.thunderbird/yk1r4599.farias/global-messages-db.sqlite
1,3G	/home/XXXXX/snap/thunderbird/common/.thunderbird/YYYYY.default/global-messages-db.sqlite

XXXXX => user.
YYYYY => profile.

Ce qui est pénible c’est que thunderbird fait énormément de profil (à chaque gros update) ensuite pour trouver le bon fichier, je prends celui qui est > 1,2M.

Je stoppe thunderbird, je supprime le fichier (global-messages-db.sqlite) et je relance thunderbird qui refait le fichier index.

Voila.

Migration d’un fichier PST (Outlook) vers Thunderbird Linux

J’ai suivi le tutorial : https://www.flawlessrhetoric.com/Using-libpst-to-convert-PST-to-MBOX,-and-understanding-Thunderbird%27s-folder-structure

J’ai donc fait :

$ readpst -u backup.pst
$ mv Outlook\ Data\ File/ out
$ find out -type d | tac | grep -v '^out$' | xargs -d '\n' -I{} mv {} {}.sbd
$ find out -name mbox -type f | xargs -d '\n' -I{} echo '"{}" "{}"' | sed -e 's/\.sbd\/mbox"$/"/' | xargs -L 1 mv
$ find out -empty -type d | xargs -d '\n' rmdir
rmdir: missing operand
Try 'rmdir --help' for more information.
$ find out -type d | egrep '*.sbd' | sed 's/.\{4\}$//' | xargs -d '\n' touch
$ du -sh *
4,1G	backup.pst
3,3G	out

je ne suis pas sur et certain d’avoir tout mes emails …vu que j’utilise snap le chemin est :
/home/login/snap/thunderbird/common/.thunderbird/ID.default/Mail/Local Folders/

Avec login : mon user et ID le id de thunderbird.

A suivre.

Thunderbird mbox to ( Influxdb, Postgresql, mysql ) to Grafana in Python

J’ai amélorié ( voir : https://www.cyber-neurones.org/2020/03/thunderbird-mbox-to-influxdb-and-postgresql-to-grafana-in-python/ ) le programme afin d’injecter sur MySQL ( MariaDB en vérité ). Le plus facile a manipuler sur Grafana c’est MariaDB.

Pour se connecter de Grafana à MariaDB :

Les requêtes SQL pour Grafana :

Par jours :

SELECT
UNIX_TIMESTAMP(date) AS time_sec,
domain as ‘metric’,
count(domain) as value
FROM thunderbird
WHERE
$__timeFilter(date)
GROUP BY DAY(date),MONTH(date),YEAR(date)
ORDER BY date

Par mois :

SELECT
UNIX_TIMESTAMP(date) AS time_sec,
domain as ‘metric’,
count(domain) as value
FROM thunderbird
WHERE
$__timeFilter(date)
GROUP BY MONTH(date),YEAR(date)
ORDER BY date

Par années :

SELECT
UNIX_TIMESTAMP(date) AS time_sec,
domain as ‘metric’,
count(domain) as value
FROM thunderbird
WHERE
$__timeFilter(date)
GROUP BY YEAR(date)
ORDER BY date

Les sources du programme :

( Source sur : https://github.com/farias06/Python/blob/master/parse_email_v2.py )

#! /usr/bin/env python3
# ~*~ utf-8 ~*~

# Readme :
# ARIAS FREDERIC 
# 
# influx user create -n arias -p arias -o cyberneurones-org 
#

import mailbox
import bs4
import glob
import os
import time
import codecs
import sys

#
#
from influxdb import InfluxDBClient
import re
from datetime import datetime

#
#
from email.utils import parsedate_to_datetime

#
#
import logging

#
#  pip3 install psycopg2
import psycopg2

#  pip3 install mysql-connector-python-rf
#  pip3 install mysql

# MariaDB [mysql]> create database thunderbird;
# Query OK, 1 row affected (0.00 sec)

# MariaDB [(none)]> CREATE USER 'arias'@'localhost' IDENTIFIED BY 'arias';
# Query OK, 0 rows affected (0.00 sec)

# MariaDB [(none)]> GRANT USAGE ON *.* TO 'arias'@'localhost' IDENTIFIED BY 'arias';
# Query OK, 0 rows affected (0.00 sec)

# MariaDB [(none)]>  GRANT ALL privileges ON thunderbird.* TO 'arias'@'localhost';
# Query OK, 0 rows affected (0.00 sec)

# MariaDB [(none)]> FLUSH PRIVILEGES;
# Query OK, 0 rows affected (0.00 sec)

import mysql.connector as mariadb

#########################

logger = logging.Logger('catch_all')

#########################

global nb_folder
nb_folder = 0;
global nb_email
nb_email = 0;
global nb_error
nb_error = 0;
global id_email
id_email = 0;

global flag_influxdb
flag_influxdb = False

global flag_postgresql
flag_postgresql = False

global flag_mysql
flag_mysql = True

global name_Table
name_DB = 'thunderbird'
name_Table = 'thunderbird'
my_login = 'arias'
my_password = 'arias'
my_host = '127.0.0.1'
Login = 'arias';
Folder = 'zy3zk9ms.default';

global client
if (flag_influxdb == True):
   client = InfluxDBClient(host=my_host, port=8086, username=my_login, password=my_password)
   client.drop_database(name_Table)
   client.create_database(name_Table)
   client.switch_database(name_Table)

global client2
if (flag_postgresql == True):
   client2 = psycopg2.connect("dbname="+name_DB+" user="+my_login+" password='"+my_password+"'")
   cursor2 = client2.cursor()
   sqlCreateTable = "create table "+name_Table+" (id bigint UNIQUE, mail varchar(128), name varchar(128), domain varchar (128), date timestamp);"
   cursor2.execute(sqlCreateTable)
   sqlCreateTable = "delete from "+name_Table;
   cursor2.execute(sqlCreateTable)
   client2.commit()

global client3
if (flag_mysql == True):
   client3 = mariadb.connect(user=my_login, password=my_password, database=name_DB)
   cursor3 = client3.cursor()
   #sqlCreateTable = "create table "+name_Table+" (id bigint UNIQUE, mail varchar(128), name varchar(128), domain varchar (128), date datetime);"
   #cursor3.execute(sqlCreateTable)
   sqlCreateTable = "delete from "+name_Table;
   cursor3.execute(sqlCreateTable)
   client3.commit()

#########################

def get_html_text(html):
    try:
        return bs4.BeautifulSoup(html, 'lxml').body.get_text(' ', strip=True)
    except AttributeError: # message contents empty
        return None

class GmailMboxMessage():
    def __init__(self, email_data):
        if not isinstance(email_data, mailbox.mboxMessage):
            raise TypeError('Variable must be type mailbox.mboxMessage')
        self.email_data = email_data

    def parse_email(self):
        global client
        global client2
        global id_email
        global name_Table
        global cursor2
        global cursor3
        global flag_influxdb
        global flag_postgresql
        global flag_mysql
        email_date = self.email_data['Date']
        email_from = self.email_data['From']
        email_to = self.email_data['To']
        email_subject = self.email_data['Subject']
        if email_date is not None and email_from is not None:
            mail = re.search(r'[\w\.\-_]+@[\w\.\-_]+', email_from)
            if mail is not None:
                mailstr = mail.group(0)
            if mail is not None:    
                domain = re.search("@[\w\.\-_]+", email_from).group(0)
                domain = domain.replace('@', '')
                domain = domain.replace('>', '')
            if mail is not None:
                user = re.search("[\w\.i\-_]+@", email_from).group(0)
                user = user.replace('@', '')
                user = user.replace('<', '')
            local_time_str = datetime.fromtimestamp(parsedate_to_datetime(email_date).timestamp()).strftime('%Y-%m-%dT%H:%M:%S.%f%z')
            local_time_str2 = datetime.fromtimestamp(parsedate_to_datetime(email_date).timestamp()).strftime('%Y-%m-%d %H:%M:%S')
            timestamp = round(parsedate_to_datetime(email_date).timestamp() * 1000);
            if mail is not None:
                data = [{'measurement': 'thunderbirds', 'tags': { 'fullemail': 1, 'from': email_from, 'mail': mailstr, 'domain': domain, 'user': user}, 'id' : id_email, 'time': timestamp, 'date':local_time_str, 'fields': {"value": 1}}]
                sql = "INSERT INTO "+name_Table+" (mail, domain, name, id, date) VALUES ('" +mailstr+ "','" + domain+"','" +user+"','"+str(id_email)+"',TIMESTAMP '"+local_time_str2+"')";
                sql2 = "INSERT INTO "+name_Table+" (mail, domain, name, id, date) VALUES ('" +mailstr+ "','" + domain+"','" +user+"','"+str(id_email)+"','"+local_time_str2+"')";
                #print (sql2)
                if (flag_postgresql == True):
                   cursor2.execute(sql);
                   client2.commit();
                if (flag_mysql == True):
                   cursor3.execute(sql2);
                   client3.commit();
            else :
               data = [{'measurement': 'thunderbirds', 'tags': { 'fullemail': 0, 'from': email_from }, 'id' : id_email, 'time': timestamp, 'date':local_time_str, 'fields': {"value": 1}}] 
            #print (data);
            if (flag_influxdb == True):
               client.write_points(data, time_precision='ms')
            id_email = id_email+1

def mbox_reader(stream):
    data = stream.read()
    text = data.decode(encoding="utf-8")
    return mailbox.mboxMessage(text)

######################### End of library, example of use below

print("\nUsing glob.iglob()") 
for filename in glob.iglob('/home/'+Login+'/snap/thunderbird/common/.thunderbird/'+Folder+'/Mail/Local Folders/**/*', recursive=True): 
    print(filename);
    filename2, file_extension = os.path.splitext(filename);
    print(file_extension + " " + str(len(file_extension)));
    isFile = os.path.isfile(filename)
    if (file_extension != ".msf") and (file_extension != ".sbd") and isFile is True:
        mbox_obj = mailbox.mbox(filename);
        num_entries = len(mbox_obj)
        nb_folder = nb_folder + 1;
        try :
           for idx, email_obj in enumerate(mbox_obj):
               email_data = GmailMboxMessage(email_obj)
               email_data.parse_email()
               nb_email = nb_email + 1;
               print('Parsing email {0} of {1}'.format(idx, num_entries))
        except StopIteration:
           continue
        except Exception as e: 
           logger.error('Failed : '+ str(e))
           nb_error = nb_error+1;
           continue

print('The number of folder :'+str(nb_folder));    
print('The number of email :'+str(nb_email));
print('The number of error : '+str(nb_error));
print('The number in database : '+str(id_email));