3

I am using MailKit as SMTP client to send emails.

I see there are two properties XMessagePriority and MessagePriority

what is the difference between these two and does one override the other?

jstedfast
  • 35,744
  • 5
  • 97
  • 110
Saher Ahwal
  • 9,015
  • 32
  • 84
  • 152

1 Answers1

13

One of the things you'll discover in the world of email is that there are legacy bits and pieces here and there.

This is one of those.

The original "email" specification did not specify a header for designating the priority of a message, so some mail clients began using a non-standard header called X-Priority (non-standard headers always start with X-). (Note: Microsoft products began using X-MSMail-Priority instead. There's some info about it here: https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcmail/2bb19f1b-b35e-4966-b1cb-1afd044e83ab)

Later, many X.400 message properties were mapped to message headers, including a Priority header but the values were not the same as the ones used in the X-Priority header.

Once a piece of software begins doing something and users like/demand the feature, other software begins to adopt that way of doing something in order to compete. Then, once a real standard is defined, if it isn't identical the the way it was already being done, there are now 2 ways of doing the same thing and software must do both.

You might be thinking, "but doesn't that mean software has to implement both? And if they implement both, why not drop the old way?"

Because old software still exists out there that can only handle the old way of doing things, so in order to be compatible with that older software that may exist, the legacy way of doing things persists.

(And by "mail software", that includes more than mail clients like Outlook or official mail server software like Exchange - it also includes automated shell scripts that admins wrote decades ago that are probably still running because no one has ever bothered to update them if they even know that anything should be updated).

does one override the other?

Yes. No. It all depends on the implementation of the receiving mail software.

jstedfast
  • 35,744
  • 5
  • 97
  • 110