Only smtp.logic given credentials

smtp credentials are optional if postfix is properly configured to work without them. In that scenario, smtp.login is no longer needed, and will in fact raise an exception if called. Avoid the invocation when no credentials are supplied on the assumption the email will still be routed properly.