Sorry to say, but in the mean time we got the first crash of the script on the server as well. Maybe it is less prone to failure as the communication is faster on the same machine? Anyway, even if the culprit would be a firewall or SSL problems, the script would always fail. However, it does it only occasionally.
This is an example of failures of today (grepped ‘MAPI error’ from unit journalctl output):
Jun 26 00:14:58 server04.exampledomain.net testscript[19187]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 00:42:28 server04.exampledomain.net testscript[19337]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 00:42:58 server04.exampledomain.net testscript[19445]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 00:50:28 server04.exampledomain.net testscript[19455]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 01:09:58 server04.exampledomain.net testscript[19495]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 01:33:58 server04.exampledomain.net testscript[19592]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 01:56:58 server04.exampledomain.net testscript[19692]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 01:59:59 server04.exampledomain.net testscript[19784]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 02:41:29 server04.exampledomain.net testscript[19805]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 02:44:29 server04.exampledomain.net testscript[19982]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 02:49:29 server04.exampledomain.net testscript[19996]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 03:47:30 server04.exampledomain.net testscript[20016]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:00:00 server04.exampledomain.net testscript[21506]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:36:00 server04.exampledomain.net testscript[21568]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:37:30 server04.exampledomain.net testscript[21742]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:44:30 server04.exampledomain.net testscript[21749]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:45:30 server04.exampledomain.net testscript[21788]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:49:30 server04.exampledomain.net testscript[21799]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:55:00 server04.exampledomain.net testscript[21814]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 04:56:31 server04.exampledomain.net testscript[21843]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 05:05:30 server04.exampledomain.net testscript[21862]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 05:13:30 server04.exampledomain.net testscript[21924]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 05:33:00 server04.exampledomain.net testscript[21968]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 05:35:30 server04.exampledomain.net testscript[22048]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 05:40:00 server04.exampledomain.net testscript[22062]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 05:51:00 server04.exampledomain.net testscript[22088]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:03:01 server04.exampledomain.net testscript[22138]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:05:00 server04.exampledomain.net testscript[22213]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:07:30 server04.exampledomain.net testscript[22224]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:23:01 server04.exampledomain.net testscript[22237]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:30:00 server04.exampledomain.net testscript[22308]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:33:30 server04.exampledomain.net testscript[22347]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:35:01 server04.exampledomain.net testscript[22362]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:36:01 server04.exampledomain.net testscript[22372]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:37:00 server04.exampledomain.net testscript[22381]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:43:00 server04.exampledomain.net testscript[22391]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:48:31 server04.exampledomain.net testscript[22430]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 06:51:01 server04.exampledomain.net testscript[22450]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 07:38:01 server04.exampledomain.net testscript[22606]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 07:45:01 server04.exampledomain.net testscript[22676]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 07:45:30 server04.exampledomain.net testscript[22716]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 07:47:00 server04.exampledomain.net testscript[22725]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
Jun 26 07:55:01 server04.exampledomain.net testscript[22734]: MAPI.Struct.MAPIErrorNetworkError: MAPI error 80040115 (MAPI_E_NETWORK_ERROR)
As the ICS loop is running every second, there are not too many failures, but each of them is killing the script.
The Test script we use:
#!/usr/bin/python
import kopano
import sys
import time
import logging
logger = logging.getLogger('TEST')
format="[%(filename)-10s:%(lineno)-5s - %(funcName)35s] - %(message)s"
level = logging.DEBUG
logger.setLevel(level)
formatter = logging.Formatter(format)
sh = logging.StreamHandler()
sh.setLevel(level)
sh.setFormatter(formatter)
logger.addHandler(sh)
logger.info('Start TEST')
# Delete all command line arguments: Trick to circumvent the parser of Kopano modules
sys.argv = [sys.argv[0]]
# Kopano Server, User and Password
kopano_server = 'http://xxxx:236/kopano'
kopano_user = 'xxx'
kopano_password = 'xxx'
kopano_folder = 'Inbox'
# Set up importer class for
class Importer:
def update(self, item, flags):
if ( flags != 0 ):
logger.debug('New Mail: ' + item.entryid + ' ' + item.subject)
if __name__ == '__main__':
# Login to Kopano Server
# Change this to kopano.server starting from Kopano 8.8 on
server = kopano.Server(server_socket=kopano_server, auth_user=kopano_user, auth_pass=kopano_password)
# Open store of user and inbox folder
store = server.user(kopano_user).store
folder = store.folder(kopano_folder)
# Get current state from folder
folder_state = folder.state
logger.debug('Retrieved new state from folder: ' + folder_state)
# Check folder each second
x = 1
while ( x == 1 ):
# Get new state of folder, process files since last state during this process
new_state = folder.sync(Importer(), folder_state)
# Set new state if necessary
if new_state != folder_state:
logger.debug('Retrieved new state from folder: ' + new_state)
folder_state = new_state
time.sleep(1)
sys.exit(0)