SMTP message identifier restrictions?

Are there restrictions on the length and / or format of the SMTP message identifier? I.E .: How long can they be, and only certain characters are allowed? (I plan to use only ASCII, but I'm afraid there might even be ASCII characters that are not allowed.)

RFC822 defines this, but are there any updated RFCs or general aspects of the real world (for example, common bugs in email software) that should be considered?

+7
smtp
source share
2 answers

Updated RFC - RFC2822.

As with valid characters, basically this

::alpha::|::digit::|[!#$%&'*+-/=?^_`{}|~.] 

(You can also quote literals).

It must contain @, separating the "local part" and the "domain part". It MUST be globally unique.

+4
source share

If you are looking for an example, you can look at the email.utils.make_msgid code Python library function.

0
source share

All Articles