Re: Postfix: alle Mails annehmen und an Skript weiterleiten

From: Bernd Siggy Brentrup <lists_at_psycho.i21k.de>
Date: Sat, 15 Aug 2009 09:38:35 +0200

Moin Christoph,

nachdem meine vorherige Antwort größtenteils aus dem Gedächtnis
geschrieben war, hier nun eine fundiertere Version aus den
Kopfkommentaren von postfix-to-mailman.py mit angehängten
exit codes weil diese extrem wichtig sind wenn Dein Programm
postfix nicht durcheinanderbring soll. Leider ist das Ganze
auf Englisch.

# This script is meant to be called as a postfix transport pipe.

# It catches all mail to a virtual domain, eg "lists.example.com". It
# looks at the recipient for each mail message and decides if the mail
# is addressed to a valid list or not, and optionally bounces the
# message with a helpful suggestion if it's not addressed to a
# list. It decides if it is a posting, a list command, or mail to the
# list administrator, by checking for the -admin, -owner, -request,
# -join, -leave, -subscribe and -unsubscribe addresses. It will
# recognize a list as soon as the list is created, there is no need to
# add _any_ aliases for any list. It recognizes mail to postmaster,
# abuse and mailer-daemon, and routes those mails to DEB_LISTMASTER as
# defined in mm_cfg.py

# INSTALLATION:
#
# Install this file as /var/lib/mailman/bin/postfix-to-mailman.py
#
# To configure a virtual domain to connect to mailman, edit Postfix thusly:
#
# /etc/postfix/main.cf:
# relay_domains = ... lists.example.com
# transport_maps = hash:/etc/postfix/transport
# mailman_destination_recipient_limit = 1
#
# /etc/postfix/master.cf
# mailman unix - n n - - pipe
# flags=FR user=list
# argv=/var/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
#
# /etc/postfix/transport:
# lists.example.com mailman:
#
# /etc/mailman/mm_cfg.py
# MTA = None # No MTA alias processing required
# # alias for postmaster, abuse and mailer-daemon
# DEB_LISTMASTER = 'postmaster_at_example.com'
#
# Replace lists.example.com above with the name of the domain to be
# connected to Mailman. Note that _all_ mail to that domain will go to
# Mailman, so you don't want to put the name of your main domain
# here. Typically a virtual domain lists.domain.com is used for
# Mailman, and domain.com for regular email.
#
# With the sheer amount of spam using faked addresses it seems more
# appropriate to me to just reject non-existing addresses. The old
# behavior sending a helpful bounce message is still configurable
# by defining DEB_HELP_TEXT in mm_cfg.

# Exit codes accepted by postfix
# from postfix-2.0.16/src/global/sys_exits.h
EX_USAGE = 64 # command line usage error
EX_NOUSER = 67 # addressee unknown
EX_SOFTWARE = 70 # internal software error
EX_TEMPFAIL = 75 # temporary failure

Ich hoffe das hilft Dir weiter.

Grüße
  Siggy

-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
               bsb-at-psycho-dot-informationsanarchistik-dot-de
               or:                bsb-at-psycho-dot-i21k-dot-de
========> ceterum censeo javascriptum esse restrictam <========

Received on Sat Aug 15 2009 - 09:38:35 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 15 2009 - 09:38:52 CEST