Expand description
RFC 5545 (iCalendar) + RFC 5546 (iTIP) parser, serializer, and typed semantics — hand-rolled, zero I/O.
Built for Rust MTAs that need to read an iCalendar invite off the wire
(typically a text/calendar MIME part) and emit a REPLY back. The
parser is byte-by-byte with no parser-combinator dependencies — the same
style as mailrs-smtp-proto and mailrs-imap-proto — keeping the
dependency footprint small and the error surface predictable.
§Quick start
use mailrs_ical::{parse_invite, Method};
let ics = b"BEGIN:VCALENDAR\r\nVERSION:2.0\r\nMETHOD:REQUEST\r\n\
PRODID:-//Example//Cal//EN\r\nBEGIN:VEVENT\r\n\
UID:abc\r\nDTSTAMP:20260101T000000Z\r\n\
DTSTART:20260102T100000Z\r\nSUMMARY:Lunch\r\n\
END:VEVENT\r\nEND:VCALENDAR\r\n";
let invite = parse_invite(ics).unwrap();
assert_eq!(invite.method, Method::Request);
assert_eq!(invite.uid, "abc");
assert_eq!(invite.summary, "Lunch");§Module layout
parse— RFC 5545 §3.1 text → raw AST (line folding, property tree, BEGIN/END nesting).semantics— AST →ParsedInvite(typed METHOD / ATTENDEE / ORGANIZER / SEQUENCE / RRULE / …).vtimezone— Inline VTIMEZONE handling withchrono-tzIANA fallback.serialize—ParsedInvite→ RFC 5545 text (for iTIPREPLY).
Top-level entry point parse_invite takes raw text/calendar bytes and
returns a fully-typed ParsedInvite.
§What this crate does NOT do
- No MIME parsing — extract the
text/calendarpart upstream (e.g. withmail-parser). - No SMTP. See
mailrs-smtp-proto/mailrs-smtp-client. - No calendar storage or CalDAV. This is the wire-format layer only.
Modules§
- parse
- RFC 5545 §3.1 text → AST.
- semantics
- AST → typed
ParsedInvite. - serialize
ParsedInvite→ RFC 5545 text.- vtimezone
- Inline VTIMEZONE handling with chrono-tz fallback.
Structs§
- Attendee
- One ATTENDEE row from a VEVENT.
- Parsed
Invite - Fully-typed iTIP invite, the boundary between this module and the rest of the server (MRS-3..MRS-9 all consume this).
- Person
- ORGANIZER or any other CAL-ADDRESS-shaped property.
- RawComponent
- Generic raw component captured by the AST parser before semantic typing.
- RawProperty
- Single iCalendar property with its value + parameters.
- VTimezone
- VTIMEZONE component (RFC 5545 §3.6.5).
Enums§
- CalDate
Time - Calendar date-time tri-state (RFC 5545 §3.3.5).
- Event
Status - STATUS property values for a VEVENT (RFC 5545 §3.8.1.11).
- Ical
Error - Errors returned by
parse_invite. - Method
- iTIP method (RFC 5546 §1.4 + §3).
- Part
Stat - PARTSTAT parameter (RFC 5545 §3.2.12).
- Role
- ROLE parameter (RFC 5545 §3.2.16).
Functions§
- parse_
invite - Top-level entry: raw
text/calendarbytes → fully-typed invite.