PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : cyrus, postfix falscher Return-Path



stephan.geberl
28.08.07, 14:37
Hallo,
Dieses Problem (oder Fehlkonfiguration?) wurde im Forum schon einmal genannt (2003), leider habe ich keine Lösung gefunden.
Frage: gibt es irgendeinen Weg, cyrus das unten gezeigte Verhalten abzugewöhnen (ohne ein procmail - skript zu bemühen)?
Bei meiner Konfiguration (Cyrus spricht direkt mit Postfix) fügt Cyrus dem Mail anscheinend zusätzlich 4 (3) Zeilen an, die in etwa so aussehen:


Return-Path: <cyrus@gemini21>
Received: from gemini21 ([unix socket])
by gemini21 (Cyrus v2.1.18-IPv6-Debian-2.1.18-2ubuntu2) with LMTP; Tue, 28 Aug 2007 10:28:51 +0200
X-Sieve: CMU Sieve 2.2
Return-Path: <sender@tatsächlicher_server>
Received: from gemini21.vip-beratung.local (localhost [127.0.0.1])
by gemini21.vip-beratung.local (Postfix) with ESMTP id 71D82949

dies ist bei der Verwendung mit einem Mailer anscheinend unkritisch, führt aber bei Verwendung von Sieve dazu, dass sämtliche Ferienmeldungen, Ablehnungen, Weiterleitungen im cyrus - Mailordner landen.

Vielen herzlichen Dank für jede Idee, Anregung zu diesem Problem

Roger Wilco
28.08.07, 19:06
Die Received-Zeile von Cyrus und der X-Sieve Header gehören so, das solltest du nicht ändern. Allerdings schreibt Cyrus keine Header um (also der Return-Path). Wie lieferst du die Mails von deinem MTA an Cyrus bzw. was hängt noch zwischen Postfix und der Zustellung via LMTP?

stephan.geberl
28.08.07, 23:06
Die Received-Zeile von Cyrus und der X-Sieve Header gehören so, das solltest du nicht ändern. Allerdings schreibt Cyrus keine Header um (also der Return-Path). Wie lieferst du die Mails von deinem MTA an Cyrus bzw. was hängt noch zwischen Postfix und der Zustellung via LMTP?
Herzlichen Dank für die Antwort. Ich habe versucht den Vorgang mit den (so denke ich jedenfalls) wichtigen Konfigurationsdateien zu beschreiben. Irgendwo muss ich wohl einen Denkfehler verbaut haben (dachte das wäre ein 0 8 15 Anfängerfehler, habe aber nirgens irgendeinen Hinweis gefunden). Meiner Meinung nach sollte eben nichts zwischen Postfix und Cyrus hängen,


lmtpunix cmd="lmtpd" listen="/var/run/cyrus/socket/lmtp" prefork=0 maxchild=20

eventuell unterliege ich da aber einer Täuschung.
Kurz der Vorgang der Reihe nach:
Eingehende Mails sollten durch Fetchmail (Bulk - Account) abgeholt werde (/etc/fetchmailrc)


set daemon 300
set postmaster "mail.admin@MEINEDOMAIN.com"
set syslog
set nobouncemail
poll MEINEDOMAIN.com
protocol POP3
envelope Delivered-To
localdomains MEINEDOMAIN.com
user "XXXX"
password "XXXX"
is *
options keep # (vorerst)
usw.

und (soweit habe ich das jedenfalls verstanden) über Postfix nach Cyrus weitergeleitet werden
Postfix Konfiguration (bitte entschuldigt die langen Konfigurationsdateien, aber ab da durchschaue ich das ganze nicht mehr in letzter Konsequenz):
/etc/postfix/main.cf


# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = gemini21.MYDOMAIN.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_maps = hash:/etc/virtual
myorigin = /etc/mailname
mydestination = gemini21.MYDOMAIN.local, localhost.MYDOMAIN.local, localhost, localhost.local, MYDOMAIN.local, MYDOMAIN.com
relayhost = [MYDOMAIN.com]
# bei Providereinwahl anders loesen
mynetworks_style = subnet
# mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mailbox_transport = cyrus
# Die folgenden absicherungen habe ich vorerst abgeschaltet

und /etc/postfix/master.cf (meine Vermutung ist, dass hier nur die letzten Zeilen von Interesse sind)


# of the file, see the Postfix master(5) manual page.
#
# ================================================== ========================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ================================================== ========================
smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
# -------------------------------------------------------------------
# AMAVIS imtp-Client
lmtp-amavis unix - - n - 2 lmtp
-o lmtp_data_done_timeout=1200
-o lmtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
# AMAVIS smtp-Client
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
# -------------------------------------------------------------------
# Client fuer die zurueckkommenden Nachrichten
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_delay_reject=no
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_ unknown_recipient_checks
# -------------------------------------------------------------------
#
# ================================================== ==================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ================================================== ==================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
spfpolicy unix - n n - - spawn
user=nobody argv=/usr/bin/perl /usr/local/libexec/postfix/smtpd-policy.pl
greypolicy unix - n n - - spawn
user=nobody argv=/usr/bin/perl /usr/local/libexec/postfix/greylist.pl
cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}

Damit müssten die Mails eigentlich per UNIX - Socket (lmtpunix) an Cyrus übergeben werden (für Sieve so gewünscht)
/etc/cyrus.conf


# Debian defaults for Cyrus IMAP server/cluster implementation
# see cyrus.conf(5) for more information
#
# All the tcp services are tcpd-wrapped. see hosts_access(5)
# $Id: cyrus.conf,v 1.16 2003/11/05 01:04:22 hmh Exp $

START {
# do not delete this entry!
recover cmd="/usr/sbin/ctl_cyrusdb -r"

# this is only necessary if using idled for IMAP IDLE
# this is NOT to be enabled right now in Debian builds
#idled cmd="idled"

# this is useful on backend nodes of a Murder cluster
# it causes the backend to syncronize its mailbox list with
# the mupdate master upon startup
#mupdatepush cmd="/usr/sbin/ctl_mboxlist -m"

# this is recommended if using duplicate delivery suppression
delprune cmd="/usr/sbin/ctl_deliver -E 3"
# this is recommended if caching TLS sessions
tlsprune cmd="/usr/sbin/tls_prune"
}

# UNIX sockets start with a slash and are absolute paths
# you can use a maxchild=# to limit the maximum number of forks of a service
# you can use babysit=true and maxforkrate=# to keep tight tabs on the service
# most services also accept -U (limit number of reuses) and -T (timeout)
SERVICES {
# --- Normal cyrus spool, or Murder backends ---
# add or remove based on preferences
imap cmd="imapd -U 30" listen="imap" prefork=0 maxchild=100
#imaps cmd="imapd -s -U 30" listen="imaps" prefork=0 maxchild=100
pop3 cmd="pop3d -U 30" listen="pop3" prefork=0 maxchild=50
#pop3s cmd="pop3d -s -U 30" listen="pop3s" prefork=0 maxchild=50

# At least one form of LMTP is required for delivery
# (you must keep the Unix socket name in sync with imap.conf)
#lmtp cmd="lmtpd" listen="localhost:lmtp" prefork=0 maxchild=20
lmtpunix cmd="lmtpd" listen="/var/run/cyrus/socket/lmtp" prefork=0 maxchild=20
# ----------------------------------------------

# useful if you need to give users remote access to sieve
# by default, we limit this to localhost in Debian
# sieve cmd="timsieved" listen="localhost:sieve" prefork=0 maxchild=100
sieve cmd="timsieved" listen="sieve" prefork=0

# this one is needed for the notification services
notify cmd="cyrus" listen="/var/run/cyrus/socket/notify" proto="udp" prefork=1

# --- Murder frontends -------------------------
# enable these and disable the matching services above,
# except for sieve (which deals automatically with Murder)

# mupdate database service - must prefork at least 1
# (mupdate slaves)
#mupdate cmd="mupdate" listen=3905 prefork=1
# (mupdate master, only one in the entire cluster)
#mupdate cmd="mupdate -m" listen=3905 prefork=1

# proxies that will connect to the backends
#imap cmd="proxyd" listen="imap" prefork=0 maxchild=100
#imaps cmd="proxyd -s" listen="imaps" prefork=0 maxchild=100
#pop3 cmd="pop3proxyd" listen="pop3" prefork=0 maxchild=50
#pop3s cmd="pop3proxyd -s" listen="pop3s" prefork=0 maxchild=50
#lmtp cmd="lmtpproxyd" listen="lmtp" prefork=1 maxchild=20
# ----------------------------------------------
}

EVENTS {
# this is required
checkpoint cmd="/usr/sbin/ctl_cyrusdb -c" period=30

# this is only necessary if using duplicate delivery suppression
delprune cmd="/usr/sbin/ctl_deliver -E 3" at=0401

# this is only necessary if caching TLS sessions
tlsprune cmd="/usr/sbin/tls_prune" at=0401
squatter cmd="squatter -r *" period=30
}

so sollte eigentlich der Absender des Mails im Return-Path stehen ---> wenn nicht irgendwas den cyrus einfügen würde.

stephan.geberl
30.08.07, 22:58
Herzlichen Dank, vor allem an Roger Wilco. Der Tip war hervorragend, es hat tatsächlich die Übergabe nicht richtig funktioniert (und zwar von Seiten Postfix). Folgende Einstellungen sind zu ändern (siehe auch http://wiki.ubuntuusers.de/Cyrus_IMAPD):
in /etc/postfix/main.cf


# mailbox_transport = cyrus
mailbox_transport = lmtp:unix:/var/run/cyrus/socket/lmtp

in /etc/postfix/master.cf


# lmtp unix - - - - - lmtp
lmtp unix - - n - - lmtp

wobei mir bei letzterem nicht bekannt ist, was es im Detail bewirkt.
Zusätzlich sollte dem Benutzer postfix noch die Gruppe mail zugeteilt werden (als root)


adduser postfix mail

jetzt sollten die Nachrichten über das Unix-Socket laufen (auf jeden Fall ist das Problem damit aus der Welt, im Return-Path wird schön der Absender des Mails eingetragen.)