{"result":{"depiction_url":null,"edges":{"observes":{"objects":[{"created":"2026-09-09T13:47:42Z","object_id":{"id":1520,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_email_status","title":"observe_email_status\/2","uri":"https:\/\/zotonic.com\/id\/1520"},"seq":1},{"created":"2026-09-09T13:47:42Z","object_id":{"id":1816,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_email_failed","title":"observe_email_failed\/2","uri":"https:\/\/zotonic.com\/id\/1816"},"seq":2},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2022,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_email_received","title":"observe_email_received\/2","uri":"https:\/\/zotonic.com\/id\/2022"},"seq":3},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2105,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_email_bounced","title":"observe_email_bounced\/2","uri":"https:\/\/zotonic.com\/id\/2105"},"seq":4},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2108,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_email_sent","title":"observe_email_sent\/2","uri":"https:\/\/zotonic.com\/id\/2108"},"seq":5},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2292,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_email_send_encoded","title":"observe_email_send_encoded\/2","uri":"https:\/\/zotonic.com\/id\/2292"},"seq":6}],"predicate":{"id":2550,"is_a":["meta","predicate"],"name":"observes","title":{"_type":"trans","tr":{"en":"Observes"}},"uri":"https:\/\/zotonic.com\/id\/observes"}},"references":{"objects":[{"created":"2020-05-30T05:48:21Z","object_id":{"id":1527,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_sites","title":{"_type":"trans","tr":{"en":"Create your first site"}},"uri":"https:\/\/zotonic.com\/id\/1527"},"seq":1000000},{"created":"2020-05-30T05:48:21Z","object_id":{"id":1279,"is_a":["text","documentation"],"name":"doc_glossary","title":"Glossary","uri":"https:\/\/zotonic.com\/id\/1279"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"relation":{"objects":[{"created":"2020-05-30T05:48:21Z","object_id":{"id":2086,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_email_receive","title":"mod_email_receive","uri":"https:\/\/zotonic.com\/id\/2086"},"seq":1000000},{"created":"2020-05-30T05:48:21Z","object_id":{"id":1552,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_email","title":{"_type":"trans","tr":{"en":"Configure outbound email and verify delivery"}},"uri":"https:\/\/zotonic.com\/id\/1552"},"seq":1000000}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-09-09T13:47:42Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2566,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_operator","title":"Operator","uri":"https:\/\/zotonic.com\/id\/2566"},"seq":2},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2595,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_email_delivery","title":"Email delivery","uri":"https:\/\/zotonic.com\/id\/2595"},"seq":3},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2596,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_email_receiving","title":"Email receiving","uri":"https:\/\/zotonic.com\/id\/2596"},"seq":4},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2599,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_api_and_integration","title":"API and integration","uri":"https:\/\/zotonic.com\/id\/2599"},"seq":5},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2635,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_module","title":"Module","uri":"https:\/\/zotonic.com\/id\/2635"},"seq":6},{"created":"2026-09-09T13:47:42Z","object_id":{"id":2654,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_send_and_receive","title":"Send and receive","uri":"https:\/\/zotonic.com\/id\/2654"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2087,"is_a":["text","documentation","reference","module"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2087"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_module_mod_email_relay","page_url":{"en":"https:\/\/zotonic.com\/docs\/2087\/mod_email_relay","x-default":"https:\/\/zotonic.com\/docs\/2087\/mod_email_relay"},"preview_url":null,"resource":{"version":3383,"pivot_location_lat":null,"title":"mod_email_relay","is_authoritative":true,"body":"<p>This module supports relaying email between Zotonic servers.<\/p>\n<p>With <code>is_email_relay<\/code> enabled, this server forwards outbound email payloads to another Zotonic relay server at\n<code>email_relay_url<\/code>. The two servers authenticate requests using shared secrets:\n<code>email_relay_send_secret<\/code> for sending relay requests and <code>email_relay_receive_secret<\/code> for receiving relay requests.\nThe relay server sends delivery status updates back through webhook reports.<\/p>\n<p>The optional <code>is_user_relay<\/code> mode relays inbound messages for local <code>username@hostname<\/code> addresses directly to user\nmailbox addresses from identity\/resource data. This user-relay mode is experimental and should not be relied on for\nproduction mail flow.<\/p>\n<h2>Accepted Events<\/h2>\n<p>This module handles the following notifier callbacks:<\/p>\n<ul><li><code>observe_email_bounced<\/code>: If the bounced email is a relayed email, then forward a delivery report using <code>z_db:q<\/code>.<\/li><li><code>observe_email_failed<\/code>: If the failed email is a relayed email, then forward a delivery report using <code>z_string:sanitize_utf8<\/code>.<\/li><li><code>observe_email_received<\/code>: Check if the recipient is a known user, if so redirect the received e-mail as-is to that user using <code>m_config:get_boolean<\/code>.<\/li><li><code>observe_email_send_encoded<\/code>: Relay an email via another Zotonic server using <code>m_config:get_boolean<\/code>.<\/li><li><code>observe_email_sent<\/code>: If the sent email is a relayed email, then forward a delivery report using <code>z_db:q<\/code>.<\/li><li><code>observe_email_status<\/code>: Forward blocking\/unblocking of email addresses to the relaying Zotonic server using <code>m_config:get_boolean<\/code>.<\/li><li><code>observe_tick_24h<\/code>: Run daily cleanup of relay queues and stale relay status records.<\/li><\/ul>","slug":"mod_email_relay","doc_module_config":[{"default":"false","description":"Enable email relay via other Zotonic servers.","has_default":true,"key":"is_email_relay","module":"mod_email_relay","type":"boolean"},{"default":"[]","description":"The Zotonic server URL to relay emails to.","has_default":true,"key":"email_relay_url","module":"mod_email_relay","type":"string"},{"default":"[]","description":"The secret used to authenticate sending emails to the relay server. This is a shared secret between this server and the relay server and must be set manually on both servers. This must be kept secret.","has_default":true,"key":"email_relay_send_secret","module":"mod_email_relay","type":"string"},{"default":"[]","description":"The secret used to authenticate receiving emails from the sending server. This is a shared secret between this server and the sending server and must be set manually on both servers. This must be kept secret.","has_default":true,"key":"email_relay_receive_secret","module":"mod_email_relay","type":"string"},{"default":"false","description":"[EXPERIMENTAL - DO NOT USE] Relay received emails for a user directly to known users.","has_default":true,"key":"is_user_relay","module":"mod_email_relay","type":"boolean"}],"is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"f4a13931de2901f175894a9495ad613d4190707bcfd214f408257a64a5542ea1","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":320,"is_a":["meta","category"],"name":"module","title":"Modules","uri":"https:\/\/test.zotonic.com\/id\/320"},"doc_source_path":"apps\/zotonic_mod_email_relay\/src\/mod_email_relay.erl","publication_start":"2023-01-30T19:24:01Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_email_relay\/src\/mod_email_relay.erl","pivot_location_lng":null,"doc_source_kind":"module","name":"doc_module_mod_email_relay","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:58Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_email_relay","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"28493fb676b2d92727e68d4fba20d89c56cf8ead\n","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-15T20:07:19Z","title_slug":"mod_email_relay"},"uri":"https:\/\/zotonic.com\/id\/2087","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2087"}},"status":"ok"}