Skip to content
Cette page a été générée et traduite avec l'aide de l'IA. Si vous remarquez des inexactitudes, n'hésitez pas à contribuer. Modifier sur GitHub

Email

Connecter PRX a n'importe quel fournisseur email en utilisant IMAP pour la reception et SMTP pour l'envoi, with IDLE push support for en temps reel delivery.

Prerequis

  • An email account with IMAP and SMTP access enabled
  • IMAP/SMTP server hostnames and ports
  • Email credentials (username and password or app-specific password)

Quick Setup

1. Enable IMAP Access

For most email fournisseurs:

  • Gmail: Enable IMAP in Gmail Settings > Forwarding and POP/IMAP, then generate an App Password
  • Outlook: IMAP est active par defaut; use an app password if 2FA is active
  • Self-hosted: Ensure your mail server has IMAP enabled

2. Configure

toml
[channels_config.email]
imap_host = "imap.gmail.com"
imap_port = 993
smtp_host = "smtp.gmail.com"
smtp_port = 465
username = "[email protected]"
password = "your-app-password"
from_address = "[email protected]"
allowed_senders = ["[email protected]"]

3. Verify

bash
prx channel doctor email

Configuration Reference

ChampTypeDefautDescription
imap_hostStringrequiredIMAP server hostname (e.g., "imap.gmail.com")
imap_portu16993IMAP server port (993 for TLS)
imap_folderString"INBOX"IMAP folder to poll for new messages
smtp_hostStringrequiredSMTP server hostname (e.g., "smtp.gmail.com")
smtp_portu16465SMTP server port (465 for implicit TLS, 587 for STARTTLS)
smtp_tlsbooltrueUse TLS for SMTP connections
usernameStringrequiredEmail username for IMAP/SMTP authentication
passwordStringrequiredEmail password or app-specific password
from_addressStringrequiredFrom address for outgoing emails
idle_timeout_secsu641740IDLE timeout in seconds before reconnecting (par defaut : 29 minutes per RFC 2177)
allowed_senders[String][]Allowed sender addresses or domains. Empty = deny all. "*" = allow all
default_subjectString"PRX Message"Defaut subject line for outgoing emails

Fonctionnalites

  • IMAP IDLE -- en temps reel push notifications for new emails (RFC 2177), no polling delay
  • TLS encryption -- connections to IMAP and SMTP servers are encrypted via TLS
  • MIME parsing -- handles multipart emails, extracts text content and attachments
  • Domain-level filtering -- allow entire domains (e.g., "@company.com") in the sender allowlist
  • Automatic reconnection -- re-establishes IDLE connection after the 29-minute timeout
  • Reply threading -- responds vers le original email thread with proper In-Reply-To headers

Limiteations

  • Only processes emails in the configured IMAP folder (par defaut : INBOX)
  • HTML emails are processed as plain text (HTML tags sont supprimees)
  • Large attachments ne peut pas be fully processed en fonction de memory constraints
  • Some email fournisseurs require app-specific passwords when 2FA est active
  • IDLE support depend de the IMAP server; most modern servers support it

Depannage

Cannot connect to IMAP server

  • Verify imap_host and imap_port are correct for your fournisseur
  • Ensure IMAP access est active in your email account settings
  • Si vous utilisez Gmail, generez un mot de passe d'application (regular passwords sont bloques with 2FA)
  • Verifiez que TLS n'est pas bloque par un pare-feu

Emails are not detected

  • Verify the imap_folder is correct (par defaut : "INBOX")
  • Verifiez que the sender's address or domain is in allowed_senders
  • Certains fournisseurs peuvent avoir un delai avant que les emails n'apparaissent dans IMAP

Replies are not sent

  • Verify smtp_host, smtp_port, and smtp_tls settings match your fournisseur
  • Check SMTP authentication credentials (same username/password as IMAP, or separate SMTP credentials)
  • Review server logs for SMTP rejection reasons (e.g., SPF/DKIM failures)

Released under the Apache-2.0 License.