Before it used 1 and -1, which does not match other parts of Dovecot.
if (address_r != NULL)
*address_r = p_new(pool, struct smtp_address, 1);
- return 1;
+ return 0;
}
i_zero(&aparser);
if (address_r != NULL)
*address_r = smtp_address_clone(pool, &aparser.address);
- return 1;
+ return 0;
}
int smtp_address_parse_path_full(pool_t pool, const char *path,
}
if (address_r != NULL)
*address_r = p_new(pool, struct smtp_address, 1);
- return 1;
+ return 0;
}
i_zero(&aparser);
if (address_r != NULL)
*address_r = smtp_address_clone(pool, &aparser.address);
- return 1;
+ return 0;
}
int smtp_address_parse_path(pool_t pool, const char *path,
if (address_r != NULL)
*address_r = smtp_address_clone(pool, &aparser.address);
- return 1;
+ return 0;
}
void smtp_address_detail_parse(pool_t pool, const char *delimiters,
*/
-/* Parse the RFC 5321 address from the provided mailbox string. Returns 1 when
+/* Parse the RFC 5321 address from the provided mailbox string. Returns 0 when
the address was parsed successfully and -1 upon error. The address is
returned in address_r. When address_r is NULL, the provided string will be
verified for validity as a mailbox only. */
enum smtp_address_parse_flags flags,
struct smtp_address **address_r,
const char **error_r) ATTR_NULL(4, 5);
-/* Parse the RFC 5321 address from the provided path string. Returns 1 when
+/* Parse the RFC 5321 address from the provided path string. Returns 0 when
the address was parsed successfully and -1 upon error. The address is
returned in address_r. When address_r is NULL, the provided string will be
verified for validity as a path only. The endp_r parameter is used to
struct smtp_address **address_r,
const char **error_r, const char **endp_r)
ATTR_NULL(4, 5, 6);
-/* Parse the RFC 5321 address from the provided path string. Returns 1 when
+/* Parse the RFC 5321 address from the provided path string. Returns 0 when
the address was parsed successfully and -1 upon error. The address is
returned in address_r. When address_r is NULL, the provided string will be
verified for validity as a path only. */
string is not strictly parsed as an RFC 5321 mailbox; it allows a more
lenient syntax. If the address obtained from splitting the string at the last
`@' can be encoded back into a valid RFC 5321 mailbox string, parsing the
- username will succeeded. Returns 1 when the address was parsed successfully
+ username will succeeded. Returns 0 when the address was parsed successfully
and -1 upon error. The address is returned in address_r. When address_r is
NULL, the provided string will be verified for validity as a username only.
*/
test_begin(t_strdup_printf("smtp mailbox valid [%d]", i));
test_out_reason(t_strdup_printf("parse(\"%s\")", test->input),
- ret > 0, error);
+ ret == 0, error);
- if (ret > 0) {
+ if (!test_has_failed()) {
if (address->localpart == NULL ||
test->address.localpart == NULL) {
test_out(t_strdup_printf("address->localpart = %s",
test_begin(t_strdup_printf("smtp path valid [%d]", i));
test_out_reason(t_strdup_printf("parse(\"%s\")", test->input),
- ret > 0, error);
+ ret == 0, error);
- if (ret > 0) {
+ if (!test_has_failed()) {
if (smtp_address_isnull(address) ||
smtp_address_isnull(&test->address)) {
test_out("address = <>",
test_begin(t_strdup_printf("smtp username valid [%d]", i));
test_out_reason(t_strdup_printf("parse(\"%s\")", test->input),
- ret > 0, error);
+ ret == 0, error);
- if (ret > 0) {
+ if (!test_has_failed()) {
if (smtp_address_isnull(address) ||
smtp_address_isnull(&test->address)) {
test_out("address = <>",
SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART |
SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL,
&address, &error);
- test_out_reason("address parse", ret > 0, error);
+ test_out_reason("address parse", ret == 0, error);
if (!test_has_failed()) {
smtp_address_detail_parse_temp(test->delimiters,