PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : postfix + procmail + cyrus wollen nicht miteinander...



flachskopf
28.07.03, 17:21
Hallo Wissender,

Dies ist zwar ein sehr langes Posting, aber es sind fast nur Dateiauszüge. Also lies es bitte trotzdem.

Ich habe auf Suse 8.1 ein Mailsystem mit postfix, fetchmail, avmailgate und procmail eingerichtet. Dieses will ich nun mit cyrus so ausbauen, daß die Mails nach der Filterung in den IMAP-Mailboxen landen.
Zahlreiche HowTos haben mich diesem Ziel sehr nah gebracht: Der Weg der Mails ist richtig und cyrus läuft.

Das einzige Problem ist die Übergabe der Mails von postfix zu cyrus, wobei meiner Meinung nach das Problem irgendwie mit lmtp zusammenhängt.

Ich liste zuerst mal meine Konfigurationsdateien auf, so wie sie momentan aussehen.

/etc/postfix/master.cf
----------------------

smtp inet n - n - - smtpd
localhost:smtp-backdoor inet n - n - - smtpd -o content_filter=
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 nqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
flush unix n - n 1000? 0 flush
smtp unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp

cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -m ${sender} ${extension}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
relay unix - - n - - smtp
proxymap unix - - n - - proxymap


/etc/postfix/main.cf
--------------------

soft_bounce = yes
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
#default_privs = nobody
myhostname = gandalf.meinhomeserver.de
mydomain = meinhomeserver.de
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain,
#mynetworks_style = class
#mynetworks_style = subnet
#mynetworks_style = host
mynetworks = 192.168.0.0/24, 127.0.0.0/8
#relay_domains = $mydestination
#relayhost = $mydomain
#local_recipient_maps = $alias_maps unix:passwd.byname
#in_flow_delay = 1s
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#recipient_delimiter = +
#home_mailbox = Mailbox
mail_spool_directory = /var/mail
mailbox_command = /usr/bin/procmail
mailbox_transport = lmtp:unix:/var/spool/postfix/public/lmtp
#fallback_transport = lmtp:unix:/file/name
#luser_relay = $user@other.host
#header_checks = regexp:/etc/postfix/header_checks
#fast_flush_domains = $relay_domains
#smtpd_banner = $myhostname ESMTP $mail_name
#local_destination_concurrency_limit = 2
#default_destination_concurrency_limit = 10
debug_peer_level = 2
#debug_peer_list = 127.0.0.1
debugger_command =
PATH=/usr/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/sbin/sendmail
mailq_path = /usr/bin/mailq
setgid_group = maildrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples
canonical_maps = hash:/etc/postfix/canonical
content_filter = smtp:127.0.0.1:10024
readme_directory = no
unknown_local_recipient_reject_code = 450
#defer transports = local


/etc/imapd.conf
---------------

configdirectory: /var/lib/imap
partition-default: /var/spool/imap
sievedir: /var/lib/sieve
admins: cyrus root
allowanonymouslogin: no
autocreatequota: 10000
reject8bit: no
quotawarn: 90
timeout: 30
poptimeout: 10
dracinterval: 0
drachost: localhost
sasl_pwcheck_method: saslauthd
sasl_mech_list: plain login
#lmtp_overquota_perm_failure: no
#lmtpsocket: /var/lib/imap/socket/lmtp


/etc/cyrus.conf
---------------

# standard standalone server implementation

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

# this is only necessary if using idled for IMAP IDLE
# idled cmd="idled"
}

# UNIX sockets start with a slash and are put into /var/lib/imap/socket
SERVICES {
# add or remove based on preferences
imap cmd="imapd" listen="imap" prefork=0
# imaps cmd="imapd -s" listen="imaps" prefork=0
pop3 cmd="pop3d" listen="pop3" prefork=0
# pop3s cmd="pop3d -s" listen="pop3s" prefork=0
sieve cmd="timsieved" listen="sieve" prefork=0

# at least one LMTP is required for delivery
# lmtp cmd="lmtpd" listen="lmtp" prefork=0
lmtpunix cmd="lmtpd" listen="/varspool/postfix/public/lmtp" prefork=0

# this is only necessary if using notifications
# notify cmd="notifyd" listen="/var/lib/imap/socket/notify" proto="udp" prefork=1
}

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

# this is only necessary if using duplicate delivery suppression
delprune cmd="ctl_deliver -E 3" period=1440

# this is only necessary if caching TLS sessions
tlsprune cmd="tls_prune" period=1440

# Uncomment the next entry, if you want to automatically remove
# old messages of EVERY user.
# This example calls ipurge every 60 minutes and ipurge will delete
# ALL messages older then 30 days.
# enter 'man 8 ipurge' for more details

# cleanup cmd="ipurge -d 30 -f" period=60
}


/etc/procmailrc (Auszug)
------------------------

## SHELL=/bin/sh

DELIVERMAIL="/usr/lib/cyrus/bin/deliver"

VERBOSE=yes

:0w
* ^From:.*megaflachs@yahoo.de
| $DELIVERMAIL -e -a rv -m user.sauron


So habe ich die Konfiguration in vielen HowTo's gefunden. Wenn ich nun mit fetchmail die Mails hole, erhalte ich folgende Meldung in /var/log/mail:

Jul 28 16:57:38 gandalf postfix/smtpd[4391]: connect from localhost[127.0.0.1]
Jul 28 16:57:38 gandalf postfix/smtpd[4391]: E009C1FFCF: client=localhost[127.0.0.1]
Jul 28 16:57:38 gandalf postfix/cleanup[4393]: E009C1FFCF: message-id=<20030726230847.77227.qmail@web41505.mail.yahoo.com>
Jul 28 16:57:38 gandalf postfix/qmgr[4366]: E009C1FFCF: from=<megaflachs@yahoo.de>, size=1350, nrcpt=1 (queue active)
Jul 28 16:57:39 gandalf avgated[4396]: connection from localhost
Jul 28 16:57:39 gandalf avgated[4396]: spooled to 04396-6102C473
Jul 28 16:57:39 gandalf avgatefwd[4397]: Message 'incoming/xf-04396-6102C473' scheduled for scanning now.
Jul 28 16:57:39 gandalf avgatefwd[4397]: Virus Scanner will process message 'incoming/qf-04396-6102C473'.
Jul 28 16:57:39 gandalf postfix/smtp[4395]: E009C1FFCF: to=<root@localhost.meinhomeserver.de>, orig_to=<root@localhost>, relay=127.0.0.1[127.0.0.1], delay=1, status=sent (250 Mail accepted for delivery (queued as 04396-6102C473).)
Jul 28 16:57:39 gandalf avgated[4396]: connection to localhost closed
Jul 28 16:57:39 gandalf postfix/smtpd[4391]: disconnect from localhost[127.0.0.1]
Jul 28 16:57:39 gandalf avgatefwd[4400]: Message 'outgoing/xf-04396-6102C473' scheduled for delivery now.
Jul 28 16:57:39 gandalf postfix/smtpd[4401]: connect from localhost[127.0.0.1]
Jul 28 16:57:39 gandalf postfix/smtpd[4401]: 1FAAA1FFCF: client=localhost[127.0.0.1]
Jul 28 16:57:39 gandalf postfix/cleanup[4393]: 1FAAA1FFCF: message-id=<20030726230847.77227.qmail@web41505.mail.yahoo.com>
Jul 28 16:57:39 gandalf postfix/qmgr[4366]: 1FAAA1FFCF: from=<megaflachs@yahoo.de>, size=1815, nrcpt=1 (queue active)
Jul 28 16:57:39 gandalf postfix/smtpd[4401]: disconnect from localhost[127.0.0.1]
Jul 28 16:57:39 gandalf avgatefwd[4400]: Message 'outgoing/qf-04396-6102C473' successfully forwarded.
Jul 28 16:57:39 gandalf postfix/lmtp[4403]: 1FAAA1FFCF: to=<root@localhost.meinhomeserver.de>, relay=none, delay=0, status=deferred (connect to /var/spool/postfix/public/lmtp[/var/spool/postfix/public/lmtp]: Connection refused)

Also habe ich in den jeweiligen Dateien die Standardeinträge verwendet:

lmtpunix cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=0

und

mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp


Daraufhin verändert sich die letzte Zeile der log-Datei zu

Jul 28 17:03:26 gandalf postfix/lmtp[4517]: 9DAFB1DF89: to=<root@localhost.meinhomeserver.de>, relay=none, delay=0, status=deferred (connect to /var/lib/imap/socket/lmtp[/var/lib/imap/socket/lmtp]: Permission denied)

(obwohl die Datei für jeden volle Rechte hat)


Dann dachte ich, daß die auskommentierten Zeilen in imapd.conf eine Bedeutung haben, also Kommentare weg.

lmtp_overquota_perm_failure: no
lmtpsocket: /var/spool/postfix/public/lmtp

(hat aber gar nichts gebracht)


Dann der nächste Versuch:

mailbox_transport = cyrus

Daraus folgte folgende letzte Zeile der Mail-log-Datei:

Jul 28 17:10:49 gandalf postfix/pipe[4628]: F09EC211C8: to=<root@localhost.meinhomeserver.de>, relay=cyrus, delay=1, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Permission denied_ 421 4.3.0 deliver: couldn't connect to lmtpd_ )


Ich habe dann noch diverse Kombis der einzelnen Veränderungen versucht, aber ebenfalls ohne Erfolg.
Nun weiß ich nicht mehr, wo ich noch nach dem Fehler suchen soll. Vielleicht kannst Du mir helfen und sagen, was bei Dir anders ist.

!!ICH BIN PLANLOS!!

Im Voraus vielen Dank dafür, daß Du mich vor der Verzwieflung rettest.

Gruß, Flachskopf

[THC]Butcher
18.10.03, 11:32
Hi, ich habe zwar zur zeit den gleichen fehler aber ich glaube, dass ich ihn bei dir gefunden habe.


/etc/cyrus.conf
---------------

lmtpunix cmd="lmtpd" listen="/varspool/postfix/public/lmtp" prefork=0

ich denke da haste wohl einen slash vergessen, oder?

flachskopf
19.10.03, 17:42
Vielen Dank für den Tip!

Habe aber mittlerweile schon SuSE 8.2 installiert und damit hat alles gefunzt.

Gruß, Flachskopf