.forward, procmail, cyrus combination does not work!

Wouter van Marle wouter at squirrel-systems.com
Mon Aug 15 11:33:51 EDT 2005


On Thu, 2005-08-11 at 11:12 +0200, Casper wrote: 

> Can you send me a snip of the procmaillog, maillog, imap.log and your  
> procmail file (.forward 2)...
> 
> And i will try to help you out of the logs.


One strange thing I noticed in my mail logs: lmtp is indeed being used
for delivery when the mail arrives through postfix. Here the result of a
mail sent from root at localhost to wouter. Hereby the relevant part
of /var/log/mail/info:

Aug 15 23:05:00 cm222-167-159-88 postfix/pickup[17635]: DC32F7C1F: uid=0
from=<root>
Aug 15 23:05:00 cm222-167-159-88 postfix/cleanup[18623]: DC32F7C1F:
message-id=<20050815150500.DC32F7C1F at smtp.mymusic.com.hk>
Aug 15 23:05:00 cm222-167-159-88 postfix/qmgr[4430]: DC32F7C1F:
from=<root at mymusic.com.hk>, size=313, nrcpt=1 (queue active)
Aug 15 23:05:01 cm222-167-159-88 postfix/local[18625]: DC32F7C1F:
to=<wouter at mymusic.com.hk>, orig_to=<wouter>, relay=local, delay=1,
status=sent (delivered to
command: /usr/bin/procmail)
Aug 15 23:05:01 cm222-167-159-88 postfix/qmgr[4430]: DC32F7C1F: removed
Aug 15 23:05:01 cm222-167-159-88 lmtpunix[17299]: accepted connection
Aug 15 23:05:01 cm222-167-159-88 cyrus-master[18645]: about to
exec /usr/lib/cyrus-imapd/lmtpd
Aug 15 23:05:01 cm222-167-159-88 lmtpunix[17299]: lmtp connection
preauth'd as postman
Aug 15 23:05:01 cm222-167-159-88 lmtpunix[18645]: executed

The procmail log for this one:
>From root at mymusic.com.hk  Mon Aug 15 23:05:01 2005
 Subject: test mail
  Folder: /usr/lib/cyrus-imapd/deliver -a wouter wouter
448
(mymusic.com.hk is one of my domains, and the one I've used to setup the
computer. It's sent locally.).

When arriving through fetchmail, the mail arrives properly in the imap
directories. Hereby the log of one of those mails:
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: accepted connection
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: lmtp connection
preauth'd as postman
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: IOERROR: fstating
sieve script /var/lib/imap/sieve/w/wouter/defaultbc: No such file or
directory
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: duplicate_check:
<017e01c5a19e$bdaaf6d0$baad8251 at ArifKamran> user.wouter          0
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: mystore: starting txn
2147483657
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: mystore: committing
txn 2147483657
Aug 15 23:17:38 cm222-167-159-88 lmtpunix[18923]: duplicate_mark:
<017e01c5a19e$bdaaf6d0$baad8251 at ArifKamran> user.wouter
1124119058 136

Again lmtp, and in this case some sieve error (I don't know what sieve
is, haven't bothered yet to figure out that: lets first get postfix to
imap working). And that while procmailrc really delivers through
"deliver". The main parts of procmail (many mail list recipes removed as
they are skipped in this case anyway). These recipes work great, mail
arriving through fetchmail is sorted to all the different imap folders
nicely.

# Macros
DELIVERMAIL="/usr/lib/cyrus-imapd/deliver -a wouter"
LOGFILE=$HOME/procmail.log

# create a backup of the mails
BACKUP="/usr/bin/bzip2 -z9c"

:0c
| $BACKUP >> $HOME/mailbackup.bz2

# and deliver all remaining mails to the mail inbox
:0
| $DELIVERMAIL wouter


Well that's it. I'm trying to get a log out of imap, will send it to you
when I got it.

Thanks very much again for the help.

Wouter.


> /Casper
> 
> 
> 
> On Thu, 11 Aug 2005 11:00:53 +0200, Wouter van Marle  
> <wouter at squirrel-systems.com> wrote:
> 
> > Hi Casper,
> >
> > I added the line to syslog.conf, then restarted the syslog service, and
> > tried again. The imapd.conf file now exists, but nothing is logged in
> > it! Weird.
> >
> > Actually procmail is now started through the .forward file, but that
> > shouldn't matter too much. The main difference seems to be that
> > fetchmail runs procmail as root, and postfix as another user (probably
> > "wouter", my user).
> >
> > I also noticed that /usr/lib/cyrus-imapd/deliver had only read
> > permissions for world, I changed that to r-x for world. Now at least
> > when piping a mail from the command prompt that works (cat test.msg
> > | /usr/lib/cyrus-imapd/deliver -a wouter wouter). However still nothing
> > when it's received through procmail! (e.g. sending a test mail through
> > the command "mail wouter" - it shows up in the procmail log, not in the
> > new imapd.log).
> >
> > Wouter.
> >
> >
> >
> >
> > On Thu, 2005-08-11 at 10:15 +0200, Casper wrote:
> >
> >> Hello again.
> >>
> >> This is my procmail file (a little bit)
> >>
> >> Procmail must deliver to cyrus mailbox with deliver, not with lmtp, if  
> >> use
> >> lmtp the mail is lost even if procmaillog says ok.
> >>
> >> *******************
> >>
> >>
> >> DELIVERMAIL="/usr/cyrus/bin/deliver"
> >> BACKUP="/usr/bin/bzip2 -z9c"
> >>
> >> INBOX="$DELIVERMAIL -a $CYRUSUSER -m user/$USER@$DOMAIN"
> >> SPAM="$DELIVERMAIL -a $CYRUSUSER -m user/$USER/spam@$DOMAIN"
> >>
> >>
> >> ##########################################################
> >> # Backup
> >>
> >> :0c
> >> | $BACKUP >> /home/backup/$CYRUSUSER.bz2
> >>
> >> ##########################################################
> >>
> >> :0fw: $CYRUSUSER.spam.lock
> >> | /usr/local/bin/spamassassin
> >>
> >> :0
> >> * ^X-Spam-Status: Yes
> >> | $SPAM
> >>
> >> :0
> >> | $INBOX
> >>
> >> *********************************
> >>
> >>
> >> And try to add
> >>
> >> local6.debug                                    /var/log/imapd.log
> >>
> >> in syslog.conf
> >>
> >> This tells what happen with imap (cyrus), if procmail speak with cyrus  
> >> or
> >> not, this is a good start to see what really happens.
> >>
> >>
> >> Notice
> >>
> >>
> >> INBOX="$DELIVERMAIL -a $CYRUSUSER -m user/$USER@$DOMAIN"
> >> SPAM="$DELIVERMAIL -a $CYRUSUSER -m user/$USER/spam@$DOMAIN"
> >>
> >> May be different on your system depending on imapd.conf. Below is  
> >> another
> >> config you can try if the first not work.
> >>
> >> This depends on
> >>
> >> altnamespace: yes
> >> unixhierarchysep: yes
> >>
> >> in imapd.conf (+imap-local.conf)
> >>
> >>
> >> INBOX="$DELIVERMAIL -a $CYRUSUSER -m user.$USER@$DOMAIN"
> >> SPAM="$DELIVERMAIL -a $CYRUSUSER -m user.$USER@$DOMAIN.spam"
> >>
> >> If you not use virtualdomains just delete the @DOMAIN.
> >>
> >> Good luck, and if you think i can do more for you just send me a mail...
> >> And i do my best... ;)
> >>
> >> /Casper
> >>
> >>
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/info-cyrus/attachments/20050815/cf84039f/attachment.html


More information about the Info-cyrus mailing list