Skip to main content

TIdMessagePriority

TIdMessagePriority = (mpHighest, mpHigh, mpNormal, mpLow, mpLowest)

Example

procedure MarkUrgent(Message: TIdMessage);
begin
Message.Priority := mpHigh;
end;

Usage

TIdMessagePriority represents five mail-priority levels whose ordinals map directly to generated X-Priority values 1 through 5.

Members

ValueOrdinalMeaning
mpHighest0Generates Priority: urgent, X-Priority: 1, Importance: high.
mpHigh1Generates Priority: urgent, X-Priority: 2, Importance: high.
mpNormal2Normal/default; generated priority headers are removed.
mpLow3Generates Priority: non-urgent, X-Priority: 4, Importance: low.
mpLowest4Generates Priority: non-urgent, X-Priority: 5, Importance: low.

Behavior and boundaries

  • Priority is advisory metadata. It does not guarantee queue order, delivery time, notification behavior or recipient presentation.
  • Header parsing checks X-Priority, then Priority, Importance, and X-MSMail-Priority.
  • Text containing urgent/high collapses to mpHighest; text containing non-urgent/low collapses to mpLowest. Numeric 1..5 preserves all five levels; invalid numbers become normal.
  • Receive precedence is X-Priority, Priority, Importance, then X-MSMail-Priority; a malformed higher-precedence value can mask a meaningful lower-precedence one.
  • Intermediate High/Low round-trip only while numeric X-Priority survives. Text-only round trips collapse them to Highest/Lowest.
  • Generation owns the normal header list, but ExtraHeaders is appended later and can reintroduce duplicate or contradictory priority fields.
  • Because non-urgent contains urgent, the parser checks non-urgent first. Preserve that order in any compatible parser.
  • The generated scalar property is independent of Velox TvxLogStatusType and IMAP mfFlagged.

Additional Technical Info

TIdMessagePriority controls optional Priority, X-Priority and Importance headers generated by TIdMessage. The declaration runs from highest to lowest, so a smaller ordinal means a higher priority.

mpNormal is the default. Header generation deliberately removes all three priority headers for normal mail to reduce unnecessary/spam-sensitive metadata.

Related Code Library entries

External references

Created 2026-07-15