Fix possible smtp crash