This commit is contained in:
2025-05-23 08:17:34 +00:00
parent 7344bf0f70
commit 53f5e30b23
3 changed files with 45 additions and 11 deletions

View File

@ -145,10 +145,10 @@ export const SMTP_PATTERNS = {
// Match parameter format: "PARAM=VALUE"
PARAM: /\s+([A-Za-z0-9][A-Za-z0-9\-]*)(?:=([^\s]+))?/g,
// Match email address format - made much more permissive
// This only does very basic format validation to avoid rejecting valid addresses
// According to RFC 5321, we should accept a wide variety of sender formats
EMAIL: /^[^\s@]+(@[^\s@]+\.[^\s@]+)?$/,
// Match email address format - basic validation
// This pattern rejects common invalid formats while being permissive for edge cases
// Checks: no spaces, has @, has domain with dot, no double dots, proper domain format
EMAIL: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
// Match end of DATA marker: \r\n.\r\n or just .\r\n at the start of a line (to handle various client implementations)
END_DATA: /(\r\n\.\r\n$)|(\n\.\r\n$)|(\r\n\.\n$)|(\n\.\n$)|^\.(\r\n|\n)$/,