-
Notifications
You must be signed in to change notification settings - Fork 0
Trigger Inbound Rules
Greg Svoboda edited this page Mar 4, 2026
·
1 revision
Inbound rule triggers allow you to block or filter inbound messages by sender address or domain. These are managed through ServerClient. You will need a server API token.
import postmark
client = postmark.ServerClient("your-server-token")import asyncio
async def main():
result = await client.inbound_rules.list()
print(f"Total inbound rules: {result.total}")
for rule in result.items:
print(f" [{rule.id}] {rule.rule}")
asyncio.run(main())Block inbound messages from a specific address or domain.
import asyncio
async def main():
# Block a specific address
rule = await client.inbound_rules.create("spam@example.com")
print(f"Created rule: [{rule.id}] {rule.rule}")
# Block an entire domain
rule = await client.inbound_rules.create("@spammydomain.com")
print(f"Created rule: [{rule.id}] {rule.rule}")
asyncio.run(main())import asyncio
async def main():
result = await client.inbound_rules.delete(trigger_id=1234)
print(result.message)
asyncio.run(main())- Messages — Bypass or retry blocked inbound messages
- Error Handling
- Postmark Inbound Rules API