I debuged it. function Boolean FindUserInMailbox(string name,var string mailboxcode,var LongInt mailboxnr) does not like some names and stucks in the eternal loop:
2017-06-07 11:47:03 GATE FindUserInMailbox: name="GOOGLE® CORPORATION"< mailboxcode= mailboxnr=-1
2017-06-07 11:47:03 GATE FindUserInMailbox: name="GOOGLE® CORPORATION"< mailboxcode= mailboxnr=-1
2017-06-07 11:47:03 GATE FindUserInMailbox: name="GOOGLE® CORPORATION"< mailboxcode= mailboxnr=-1
I guess it does not like registered trademark symbol in this case