Exim4 + Majordomo: user unknown & local delivery failed

Kürzlich gab es auf einem Debian 3.1 / Confixx 3.3.1 Server mit Exim4 Probleme mit den Mailinglisten. Das Einrichten von Mailinglisten sowie das Anmelden mittels Majorcool Weboberfläche klappte zwar problemlos, jedoch wurde jeglicher Versuch, an majordomo@domain oder an mailingliste@domain zu senden, mit folgender Fehlermeldung geblockt :

Fehler beim Sender der Nachricht. Der Mail Server antwortet: unknown user. Bitte überprüfen Sie die E-Mail Adressen der Empfänger und wiederholen Sie den Vorgang

exim4 -bt -d mailingliste@domain
terminierte mit rc=2 und bestätigte, dass Exim offenbar der User mailingliste@domain gar nicht bekannt war.

Es stellte sich heraus, dass in der von Confixx generierten /etc/exim4/confixx/confixx-aliases keinerlei Einträge für Majordomo vorgenommen waren. Diese befanden sich zwar in /etc/exim4/confixx/virtusertable - wurden aber beim Ausführen von makemap nicht herangezogen, da diese Datei dazu die /root/confixx/safe/virtusertable.tmp verwendete, die keine Einträge für die Mailinglisten Aliase enthielt.

Als temporäre Zwischenlösung wurde makemap so angepasst, dass es /etc/exim4/confixx/virtusertable zur Generierung der Confixx Aliases Datei verwendet:

/etc/exim4/confixx/makemap:
#!/bin/sh
# create exim4 compatible files from confixx.
perl /etc/exim4/confixx/makemail.pl --aliases < /etc/exim4/confixx/virtusertable > /etc/exim4/confixx/confixx-aliases
cp /etc/exim4/confixx/domains-template /etc/exim4/confixx/confixx-domains
perl /etc/exim4/confixx/makemail.pl --domains < /etc/exim4/confixx/virtusertable >> /etc/exim4/confixx/confixx-domains
chmod 644 /etc/aliases
/etc/exim4/confixx/maildir.pl
chown root.Debian-exim /usr/bin/autoresponder.pl
/etc/init.d/exim4 reload

Damit war das user unknown Problem behoben, da Exim4 nun die Majordomo Alias Einträge zuordnen und über den Router confixx_aliases zustellen konnte:

# router for the confixx aliases
confixx_aliases:
driver = redirect
data = ${lookup{$local_part@$domain}lsearch*@{/etc/exim4/confixx/confixx-aliases}}
debug_print = "R: virtual for $local_part@$domain"
pipe_transport = address_pipe
condition = ${if and { {!match {$local_part}{^web(.*)p(.*)}} {!match {$local_part}{^confixx-du-(.*)}}} {1}{0}}

Soweit so gut, auf zum nächsten Problem ;)

Nun generierte ein Versand von Mails an majordomo@domain folgende Fehlermeldung:

Eine Nachricht die Sie versendet haben konnte nicht zu allen Empfängern gesendet werden.
Der Versand zu folgender/folgenden Adresse/n schlug fehl:

pipe to |/usr/bin/confixxevent.pl -ot 3 -oi 2943 -et 110
generated by majordomo-2943@domain
(ultimately generated from majordomo@domain)
local delivery failed

Die Log-Einträge waren noch etwas umfangreicher:

/var/log/exim4/mainlog.3:2008-02-07 01:06:58 1JXQ70-0007Wc-A4 ** |/usr/bin/confixxevent.pl -ot 3 -oi 2943 -et 110 (majordomo-2943@domain) R=system_aliases T=address_pipe: Child process of address_pipe transport returned 127 (could mean unable to exec or command does not exist) from command: /usr/bin/confixxevent.pl

Und bestätigten die Vermutung, dass die Rechte der Datei /usr/bin/confixxevent.pl Exim4 nicht erlauben, diese auszuführen.

chown root.Debian-exim /usr/bin/confixxevent.pl
chmod 550 /usr/bin/confixxevent.pl
# falls das nicht funktioniert:
chmod 555 /usr/bin/confixxevent.pl

sollte Abhilfe schaffen. Falls danach immer noch Fehler auftreten, lohnt sich ein Blick in die /usr/bin/confixxevent.pl. Im oberen Bereich stehen nämlich die Zugangsdaten zur Confixx DB und diese sollten natürlich mit den Daten in /root/confixx/confixx_main.conf übereinstimmen…

$db_address = 'DBI:mysql:confixx:localhost;mysql_socket=/var/run/mysqld/mysqld.sock';
$dbUser = 'confixx';
$dbPw = 'xxxxxxx';
$ServerID = 'xxxxxxxxxxxxxxxxx';

Nach diesen Änderungen funktionierte der Mailversand an majordomo@domain inklusive aller Mailinglisten Befehle (lists, subscribe, auth usw.) - also das An- und Abmelden bei Mailinglisten - problemlos,  allerdings war es nach wie vor unmöglich, an mailingliste@domain direkt zu senden:

Eine Nachricht die Sie versendet haben konnte nicht zu allen Empfängern gesendet werden.
Der Versand zu folgender/folgenden Adresse/n schlug fehl:

pipe to |”/usr/local/majordomo/wrapper resend -C /usr/local/majordomo/2943/majordomo.cf -M 10000 -R -l mailingliste -f owner-mailingliste -h domain -s mailingliste-2943-outgoing”
generated by news-2943@domain
(ultimately generated from mailingliste@domain)
local delivery failed

Die Log Einträge deuteten zunächst wieder auf ein Rechteproblem hin:

2008-02-09 12:58:52 1JYKB1-0006kr-WE ** |”/usr/local/majordomo/wrapper resend -C /usr/local/majordomo/2943/majordomo.cf -M 10000 -R -l mailingliste -f owner-mailingliste -h domain -s mailingliste-2943-outgoing” (mailingliste-2943@domain) R=system_aliases T=address_pipe: Child process of address_pipe transport returned 127 (could mean unable to exec or command does not exist) from command: “/usr/local/majordomo/wrapper resend -C /usr/local/majordomo/2943/majordomo.cf -M 10000 -R -l mailingliste -f owner-mailingliste -h domain -s mailingliste-2943-outgoing”

Allerdings waren die Rechte des wrappers in Ordnung:

-rwsr-xr-x 1 root majordomo 14703 Oct 20 2007 /usr/local/majordomo/wrapper

Letztendlich stellte sich heraus, dass nicht die Rechte des Wrappers, sondern die Schreibweise des Pipe Kommandos in der /etc/aliases Ursache des Problems war:

Nicht funktionierender Original Eintrag:
# Majordomo support for domain
majordomo-872: |"/usr/local/majordomo/wrapper majordomo -C /usr/local/majordomo/872/majordomo.cf" , "|/usr/bin/confixxevent.pl -ot 3 -oi 872 -et 110"
# mailingliste @ domain mailing list
mailingliste-872: |"/usr/local/majordomo/wrapper resend -C /usr/local/majordomo/872/majordomo.cf -M 10000 -R -l mailingliste -f owner-mailingliste -h domain -s mailingliste-872-outgoing"
mailingliste-872-outgoing: :include:/usr/local/majordomo/872/lists/mailingliste, mailingliste-872-archive
mailingliste-872-archive: |"/usr/local/majordomo/wrapper archive2.pl -C /usr/local/majordomo/872/majordomo.cf -m -a -f /usr/local/majordomo/872/lists/mailingliste.archive/t$
mailingliste-872-request: |"/usr/local/majordomo/wrapper request-answer -C /usr/local/majordomo/872/majordomo.cf mailingliste-872"
owner-mailingliste-872: mailingliste@domain2

Auf http://wiki.exim.org/FAQ/General_Debugging/Q0026 gab es den Hinweis, dass falls ein Pipe Kommando nicht funktioniert, wenn der Alias Eintrag so geschrieben ist:
alias: |"/some/command some parameters"

man versuchen soll, den Eintrag so zu schreiben:
alias: "|/some/command some parameters"

Und siehe da, mit dem folgenden Eintrag in der /etc/aliases arbeiteten die Mailinglisten wunderbar ;)

# Majordomo support for domain
majordomo-872: "|/usr/local/majordomo/wrapper majordomo -C /usr/local/majordomo/872/majordomo.cf" , "|/usr/bin/confixxevent.pl -ot 3 -oi 872 -et 110"
# mailingliste @ domain mailing list
mailingliste-872: "|/usr/local/majordomo/wrapper resend -C /usr/local/majordomo/872/majordomo.cf -M 10000 -R -l mailingliste -f owner-mailingliste -h domain -s mailingliste-872-outgoing"
mailingliste-872-outgoing: :include:/usr/local/majordomo/872/lists/mailingliste, mailingliste-872-archive
mailingliste-872-archive: "|/usr/local/majordomo/wrapper archive2.pl -C /usr/local/majordomo/872/majordomo.cf -m -a -f /usr/local/majordomo/872/lists/mailingliste.archive/t$
mailingliste-872-request: "|/usr/local/majordomo/wrapper request-answer -C /usr/local/majordomo/872/majordomo.cf mailingliste-872"
owner-mailingliste-872: mailingliste@domain2

Tags: , , , , , , , , ,

Einen Kommentar schreiben