Skip to main content

Module gmail_push

Module gmail_push 

Expand description

Gmail Pub/Sub push notification channel.

Structs§

GmailMessage
Full message returned by GET /gmail/v1/users/me/messages/{id}.
GmailNotification
The decoded payload inside PubSubMessage.data.
GmailPushChannel
GmailPushConfig
HistoryRecord
A single history record containing messages added to the mailbox.
HistoryResponse
Response from GET /gmail/v1/users/me/history.
MessageAdded
Wrapper for a newly added message reference.
MessageBody
Message body with optional base64-encoded data.
MessageHeader
A single email header (name/value pair).
MessagePart
A MIME part of a multipart message.
MessagePayload
Message payload with headers and parts.
MessageRef
Minimal message reference returned by the history API.
PubSubEnvelope
The outer JSON envelope that Google Pub/Sub POSTs to the push endpoint.
PubSubMessage
A single Pub/Sub message inside the envelope.
WatchResponse
Response from POST /gmail/v1/users/me/watch.

Functions§

extract_body_text
Extract the plain-text body from a Gmail message. Walks MIME parts looking for text/plain; falls back to text/html with basic tag stripping; finally falls back to the snippet.
extract_email_from_header
Extract the plain email address from a From header value like "Name <email@example.com>".
extract_header
Extract a header value from a Gmail message by name.
parse_notification
Parse and decode the Gmail notification from a Pub/Sub message.
sanitize_header_value
Sanitize a string for use in an RFC 2822 header value. Removes CR and LF characters to prevent header injection attacks.