What Regex Does Postmark Use?
Here are the regex validations we use on our backend to validate:
addresses: Domain: ^((\.)?[a-zA-Z0-9\-])+$
Mailbox: ^[a-z0-9\.!#\$%&'`\*\+\-\/=\^_\{\}\|~]+$
NOTE: When validating an email, we also apply another rule. Based on RFC5322, we do not allow leading*, trailing* and consecutive dots in the local part of the mail address.
-
For leading and trailing dots, we seem to allow them when sending via API, but not SMTP. That's an inconsistency on our end, so that's probably not worth mentioning.
See: https://secure.helpscout.net/conversation/1324417836/413006/