reorganise and bugfix finding and deletion of matching messages