added mail deliverytype handling