]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-address - Add smtp_address_is_broken().
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 13 Sep 2019 20:31:37 +0000 (22:31 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 4 Oct 2019 17:13:42 +0000 (19:13 +0200)
src/lib-smtp/smtp-address.h

index f5e391d99ff9fea3217159b7446aacb0da3788f5..3d20d2a3905bfc5bbde736614e16445c47935ba8 100644 (file)
@@ -196,4 +196,12 @@ smtp_address_isnull(const struct smtp_address *address)
                *address->localpart == '\0');
 }
 
+static inline bool ATTR_NULL(1) ATTR_PURE
+smtp_address_is_broken(const struct smtp_address *address)
+{
+       return (address != NULL &&
+               (address->localpart == NULL || *address->localpart == '\0') &&
+               (address->raw != NULL && *address->raw != '\0'));
+}
+
 #endif