mailto: is non-hierarchical — the // authority component never applies.
The bug was in rspamd_mailto_parse setting RSPAMD_URL_FLAG_MISSINGSLASHES
when // was absent, causing rspamd_url_parse_text to
inject :// into the stored string.
Note: bare email addresses detected via the @ pattern (user@example.net
in text, no scheme prefix) still go through a different path where
"mailto://" is injected as a literal prefix — that's a separate issue
and out of scope here.
penalty += 0.3f;
}
- if (url.protocol == PROTOCOL_MAILTO || url.protocol == PROTOCOL_FTP) {
+ if (url.protocol == PROTOCOL_MAILTO) {
+ penalty += 0.15f;
+ }
+ else if (url.protocol == PROTOCOL_FTP) {
penalty += 0.05f;
}
p++;
}
else {
- *flags |= RSPAMD_URL_FLAG_MISSINGSLASHES;
+ /* mailto: is non-hierarchical (RFC 6068); // is not required */
st = parse_slash_slash;
}
break;