nnimap: fix boundary detection