mailman
Mailman
Overview
This skill provides guidance for configuring mailing list servers using Postfix and Mailman3. It covers the complete mail delivery pipeline including inbound mail handling, LMTP integration, subscription workflows, and outbound broadcast delivery to list subscribers.
Architecture Understanding
Before configuring, understand the bidirectional mail flow architecture:
Inbound Flow (Mail INTO Mailman)
- External mail arrives at Postfix
- Postfix routes list addresses to Mailman via LMTP
- Mailman processes: subscriptions, unsubscriptions, and posts
Outbound Flow (Mail OUT from Mailman)
- Mailman processes incoming posts
- Mailman generates individual messages for each subscriber
- Mailman sends via Postfix back to subscriber mailboxes
- Messages arrive in subscriber local mailboxes (e.g., /var/mail/)
Critical Insight: Both directions must work. A common failure mode is configuring only the inbound path while neglecting outbound delivery to subscribers.
Verification Strategy
Mandatory Pre-Completion Verification
Before declaring any mailing list setup complete, verify ALL three core functions:
- Join/Subscribe: User can join the mailing list
- Post/Broadcast: Messages sent to the list reach ALL subscribers
- Leave/Unsubscribe: User can leave the mailing list
End-to-End Testing Approach
To verify the complete mail flow:
-
Test subscription
- Send join request to list-join@domain
- Verify confirmation arrives
- Complete subscription process
-
Test broadcast delivery (most commonly missed)
- Send a message to list@domain
- Check EACH subscriber's mailbox for delivery
- Verify the message content is intact
-
Test unsubscription
- Send leave request to list-leave@domain
- Verify confirmation and removal
Log Analysis Checkpoints
Regularly inspect logs during configuration:
- Postfix logs:
/var/log/mail.logorjournalctl -u postfix - Mailman logs:
/var/log/mailman3/or check mailman's configured log directory - LMTP connection logs for both directions
Common Configuration Points
Postfix Configuration Areas
Key files to examine and configure:
/etc/postfix/main.cf- Main configuration/etc/postfix/master.cf- Service definitions- Transport maps for routing to Mailman
- Virtual/relay domain configuration
Mailman3 Configuration Areas
Key areas to verify:
- LMTP runner configuration (host and port)
- MTA integration settings
- Pipeline runners for processing posts
- Outbound mail configuration
Integration Points to Verify
- LMTP Connection: Confirm Mailman's LMTP runner is listening on the configured port
- Transport Maps: Ensure Postfix routes list addresses correctly
- Domain Handling: Verify how list domains interact with
mydestinationandrelay_domains - Outbound Runner: Confirm Mailman's "out" runner sends messages back through Postfix
Common Pitfalls
Domain Configuration Conflicts
When the list domain is in Postfix's mydestination, Postfix treats ALL addresses at that domain as local. This can conflict with mailing list routing. Solutions include:
- Using transport_maps to override for list addresses
- Careful configuration of virtual domains
- Verifying the routing precedence
LMTP Verification Gaps
A common mistake is assuming LMTP works for all message types because subscription requests succeed. Posts may fail separately. To verify:
- Check that the LMTP port is actually listening
- Test with actual post messages, not just subscription requests
- Trace a post message through the complete pipeline
Incomplete Outbound Configuration
Mailman must send mail back to subscribers. Verify:
- The "out" runner is active and processing
- Mailman can connect to Postfix for sending
- Subscriber addresses resolve correctly
- Messages actually appear in subscriber mailboxes
Premature Success Declaration
Never declare success based on:
- A single test passing
- Only subscription tests working
- Automated tests that may not cover all functionality
Always manually verify the broadcast functionality before completion.
Debugging Approach
When mail delivery fails:
-
Trace the message path
- Where does the message enter the system?
- Does it reach Mailman's LMTP?
- Does Mailman process it?
- Does Mailman attempt outbound delivery?
- Does Postfix accept the outbound message?
- Does it reach the subscriber mailbox?
-
Check queue directories
- Postfix queue:
mailqorpostqueue -p - Mailman queues: Check configured queue directories
- Postfix queue:
-
Verify service status
- All Mailman runners active
- Postfix accepting connections
- LMTP port listening
-
Examine logs between each step
- Do not restart services repeatedly without checking logs
- Each restart should be followed by log examination
Incremental Verification Process
Configure and verify in stages:
- Stage 1: Basic Postfix mail delivery (local mail works)
- Stage 2: Mailman installation and basic configuration
- Stage 3: LMTP connection (Postfix to Mailman)
- Stage 4: Subscription flow (join/leave)
- Stage 5: Broadcast flow (post to all subscribers)
- Stage 6: Full integration test with multiple subscribers
Do not proceed to the next stage until the current stage is verified working.