fix OutOfBoundsException when using mail or sendmail transport