Exim 4 routers and transport for Sympa

Sympa is a nifty mailing list manager with a nice architecture for distributing list management duties and a solid web interface that I developed. This is a brief howto on integrating Exim4 and Sympa on a Debian-based distribution.

The problem

As with all mailing list managers, the MTA must be able to correctly route email intended for a list to the mailing list manager processing applications. Back in the bad old days on *NIX systems, this often meant creating mail aliases in /etc/aliases that routed mailing list messages to the list processing executables via a pipe, as in listname: "| /path/to/sympa/bin/queue listname@my.domain.org". This stinks because the piped command must run as the MTA's user and because this is a management nightmare and effectively means that users trsuted to edit /etc/aliases become a bottleneck to list creation.

A solution

If you are running Exim4 and Sympa, you can use two custom Exim4 routers and one transport to handle all Sympa traffic. This example assumes a Debian-based Exim4 + Sympa setup, but it should be easy to adapt to any other distribution by changing the paths to reflect the locations of the Sympa scripts on your system. For this guide, it is critical that all Sympa virtual robots, including the main/default virtual robot, have their own configuration and data directories.

The Exim routers check for the existence of the list in question by looking for the corresponding Sympa directory and then use regex matching to extract the relevant pieces of information from the message needed to tell Sympa how to process it. The Sympa transport simply provides a pipe transport for the routers.

At the top of your Exim configuration file (or in one of the files in conf.d/main/ in a split configuration), add lines to define your basic Sympa parameters:

###  Sympa paths and users  ###  

# Location of Sympa virtual robot directories
SYMPA_LISTS = /var/lib/sympa/expl

# Sympa executable paths
SYMPA_QUEUE = /usr/lib/sympa/bin/queue
SYMPA_BOUNCEQUEUE = /usr/lib/sympa/bin/bouncequeue

# Sympa uid and gid
SYMPA_UID = sympa
SYMPA_GID = sympa

Note: If you correctly enter the paths at this point, the rest should be pretty must distribution-independent.

At this point, you need to add two routers, either in conf.d/routers or in the routers section of your config file. Router order matters -- my Sympa routers are sandwiched between the real_local router and the system_aliases router, but you'll want to put them where it makes most sense.

The first router simply looks for any address called "listmanager" and routes it to a list. This could certainly be improved to be more sophisticated, but I don't know a lot of people named "listmanager" so I figured I could get away with it:

sympa_manager:
debug_print = "R: Sympa list manager for $domain"
driver = redirect
data = ${if match{$local_part}{listmanager} \
{| /usr/lib/sympa/bin/queue sympa@$domain}}
pipe_transport = sympa_pipe

The next router is more acrobatic and the critical piece here. It handles all the administrative addresses and correct routing to the bounce queue:

sympa_queue:
debug_print = "R: Sympa mailing lists for $local_part@$domain"
driver = redirect
data = ${if exists {SYMPA_LISTS/$domain/${sg{$local_part}{-request|-editor|-owner|-subscribe|-unsubscribe}{}}}\
{${if match{$local_part}{(.*)-owner}\
{| SYMPA_BOUNCEQUEUE ${sg{$local_part}{-owner}{}}@$domain}{| SYMPA_QUEUE $local_part@$domain}}}}
pipe_transport = sympa_pipe

Somewhere, I have a diagram that breaks down the logic implied in the data statement, which I'll post when I find. In any event, if a domain.tld/listname/ directory exists in the Sympa list directory, then the router passes off the message to Sympa.

Finally, you need a Sympa transport in your transport section. Transport order does not matter.

sympa_pipe:
debug_print = "T: address_pipe for $local_part@$domain"
driver = pipe
user = SYMPA_UID
group = SYMPA_GID
return_fail_output

That's it. To test, you can use the exim4 -bt command. Your output should look something like this:


$ exim4 -bt test@lists.foobar.com

R: Sympa list manager for lists.foobar.com
R: Sympa mailing lists for test@lists.foobar.com
test@lists.foobar.com -> | /usr/lib/sympa/bin/queue test@lists.foobar.com
transport = sympa_pipe


Comments

There are no comments right now.

Thanx! I guess this put me on the right track... However I'm still into some kind of trouble. The exim4 -bt-test works, but I get a "550 Unrouteable address"-error when actually trying to mail a mailing list... Alfred
Solved! The Debian-exim user did not have read access in the sympa directories... :-) Alfred
WoW GOld Blog offers Wow golD articles, wow gOLDnews, woW GOLd strategy guides, Welcome to WOW gold.
I'm getting a similar error. Is there some form of FAQ or help forum? cheap wow gold | age of conan gold | eve online isk | final fantasy xi gil | warhammer online gold
wow goldworld of warcraft goldbuy wow goldcheap wow goldwow power levelingwow powerleveling2moons gold2moons dilaoc power levelingaoc levelingAion goldbuy Aion goldAnarchy Online creditsAnarchy Online creditCity of Heroes influencecoh influenceCity of Villains infamyCOV infamydofus kamaskamas dofuseve online iskeve iskGaia Online Goldgaia goldGods and Heroes goldGranado Espada Visgranado espada goldGE moneyGuild Wars GoldGW goldHellgate London PalladiumHero online goldlast chaos goldlineage adenalineage 1 adenalineage 2 adenabuy lineage 2 adenalineage ii adenacheap lineage 2 adenaPotBS Doubloonpirates of the burning sea goldRagnarok Zenyro zenyRappelz Rupeerappelz goldScions of Fate GoldSecond Life Lindensecond life moneySWG CreditsStar Wars Galaxies Creditsthe SUN onlinethe SUN online goldSword of the New World Vissword of the new world goldTabula Rasa CreditTabula Rasa CreditsTales of Pirates GoldVanguard MoneyBuy Vanguard Goldvoyage century goldwow goldworld of warcraft goldbuy wow goldcheap wow goldwow power levelingwow powerlevelingaoc power levelingaoc leveling2moons dil2moons goldflyff penyabuy flyff goldflyff moneyGaia Online Goldgaia goldHero online goldmmorpg openmmorpg sourcefree fantasy mmorpgwow cd keycd keybuying wow goldwow 100 goldaoc power levelingaoc levelingaoc power levelingaoc levelingdiablo 2 cd keydiablo 2 cd keydiablo 2 cd key world of warcraft goldbuy wow goldcheap wow goldwow power levelingwow powerlevelingwow levelingworld of warcraft goldbuy wow goldcheap wow goldwow power levelingwow powerlevelingwow goldbuy wow goldcheap wow goldwow power levelingwow powerlevelingEverQuest 2 goldeq2 platrunescape goldrunescape moneyEverQuest 2 goldeq2 platLOTRO GoldLOTR Goldlord of the ring goldMaple Story MesosMaple Story mesomaplestory Mesosmaplestory Mesosilkroad online goldLineage 1 adenaGranado Espada goldSilkroad goldbuy silkroad goldflyff penyabuy flyff goldflyff moneyfinal fantasy xi gilffxi gilEverQuest platbuy eq goldEverQuest goldeq plateq goldage of conan power levelingaoc goldEverQuest platbuy eq goldEverQuest goldeq plateq goldrunescape goldrunescape moneyEverQuest 2 plateq2 platCity of Heroes influencecoh influenceCity of Villains infamyCOV infamylineage 1 adenalineage adenamaple Story mesosmaplestory mesosmaplestory mesoMaple Story mesopotbs doubloonragnarok zenyro zenyrappelz rupeerappelz goldstar wars galaxies creditsswg creditssilkroad goldsilk road goldsword of the new world vistales of pirates goldtibia moneyvanguard goldwarhammer goldage of conan goldage of conan power levelingage of conan goldage of conan power levelingage of conan goldage of conan power levelingage of conan goldage of conan power levelingage of conan goldage of conan power levelingage of conan goldage of conan power levelingaoc goldaoc goldAge of Conan goldaoc power levelingaoc levelingbuy ffxi gilage conan goldbuy ffxi gilbuy ffxi gilbuy ffxi gilage conan goldage conan goldage conan goldaoc goldgameleeraingamleeraingameleerain
wow gold wow gold wow gold age of conan gold age of conan gold age of conan gold aoc gold aoc gold aoc gold wow gold world of warcraft gold buy wow gold cheap wow gold wow power leveling wow powerleveling world of warcraft gold buy wow gold cheap wow gold wow power leveling wow powerleveling world of warcraft gold buy wow gold cheap wow gold wow power leveling wow powerleveling age conan gold age conan gold buy ffxi gil buy ffxi gil buy ffxi gil age of conan gold aoc gold aoc power leveling age of conan power leveling age conan gold aoc leveling ffxi gil final fantasy xi gil maple story mesos maplestory mesos maplestory meso lotro gold lotr gold lord of the ring gold ffxi gil final fantasy xi gil maple story mesos maplestory mesos maplestory meso lotro gold lotr gold lord of the ring gold lotro gold lotr gold lord of the ring gold maple story mesos maplestory mesos maplestory meso ffxi gil final fantasy xi gil runescape gold runescape money runescape gold runescape money runescape gold runescape money silkroad gold buy silkroad gold silkroad gold buy silkroad gold city of villains infamy cov infamy wow leveling wow gold dofus kamas kamas dofus dofus kamas kamas dofus dofus kamas kamas dofus age of conan gold aoc power leveling age of conan power leveling aoc leveling lotr gold maple story mesos maplestory mesos maplestory meso perfect world gold pirates of the burning Sea gold potbs doubloon ragnarok zeny ro zeny age of conan gold age of conan gold age of conan gold aoc power leveling age of conan power leveling aoc leveling age of conan gold aoc power leveling age of conan power leveling aoc leveling
大阪HIPHOPレーベルであるBABYCROWN。大阪の次世代を担う間違いないHIPHOPアーティスト・R&Bアーティスト・DJが所属する。人気HIPHOPイベントであるDIGUP大阪などの情報がてんこ盛り!Web限定のお得な情報などもあります。その他にも、人気DJによるお勧めのヒップホップMIXCDなどの情報も満載!ヒップホップ好きなら迷わずベイビークラウンをチェック♪HIPHOPR&B大阪イベントヒップホップMIXCDBABYCROWNDJ

Post new comment

The content of this field is kept private and will not be shown publicly.
Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 9 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.