procmail
[Top] [All Lists]

Re: sendmail->procmail->imap

2001-11-06 03:56:59
Hi Michael,

thanks a lot for your answer. I tried it. But unfortunately for some
reason
it doesn't work. It can't write to imap-mailboxes though they exist.
With this mail I include
the last part of the procmail-log together wit the general procmailrc
and a special .procmailrc.

Maybe there should be done some more configuration in the sendmail.cf.
Connection by the mail server in this way are only accepted if the
imap-user also exists as regular user on the system.

The sendmail-configuration didn't cause any problems. But with procmail
it would be possible to distribute e-mails fetched from a provider and
destinated for different users on the systems to different imap-boxes.

I would be grateful if I could find a solution to that problem.


Besides that it is funny that you have the same last name Weber. But
probably 'Weber' in Germany is almost as abundant
as Mueller, Maier, Schulze. ;)

Greetings Bernd

P.S. In my precedent mail I forgot the appendix 

Administrator wrote:

I had a big problem with that as well.  Here is an example that I have.  I
am using Cyrus IMAP.

#CNN Breaking News Filter
:0:$CYUSER.lock
* ^From: BreakingNews(_at_)cnn(_dot_)com
| $DELIVERMAIL -e -a $CYUSER -m user.$CYUSER

This is in procmail.common

DELIVERMAIL=/usr/cyrus/bin/deliver

You need to have Procmail call Delivermail and then this will put the
message in the users inbox.  Subdirectories are called as:

| $DELIVERMAIL -e -a $CYUSER -m user.$CYUSER.Procmail

Procmail _IS_ case sensitive for your folders.  Also I have not been able to
have spaces in my folder names, so I would not recomment it.  I either make
folders one word, or use "_" between words.  I hope that this helps.  Let me
know if you need any more help.

Michael Weber

P.S. Nice last name.  ;)

----- Original Message -----
From: "Bernd Weber" <bweber(_at_)medienpartner(_dot_)de>
To: <procmail(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE>
Sent: Monday, November 05, 2001 10:52 AM
Subject: sendmail->procmail->imap

Dear procmail-users,

I managed to configure sendmail invoking procmail and set up an
/etc/procmailrc file. I just want to send Mail only to the IMAP-Boxes.

But unfortanetely when I send a mail for a user only existing as
imap-user, the mail-server refuses connections. The other e-Mails aren't
delivered correctly either.

Has anybody an idea how to setup sendmail->procmail->imap in a way only
regarding imap users and not users having a full account.

I would be very glad to get an answer.

Bernd
--
Bernd Weber
Medienpartner                     Tel    0 22 07/911 377
Kommunikationsgesellschaft mbH
Baerbroich 35                     Mobil  0177-3627616
51429 Bergisch-Gladbach           e-mail:bweber(_at_)medienpartner(_dot_)de
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail




-- 
Bernd Weber
Medienpartner                     Tel    0 22 07/911 377
Kommunikationsgesellschaft mbH
Baerbroich 35                     Mobil  0177-3627616
51429 Bergisch-Gladbach           e-mail:bweber(_at_)medienpartner(_dot_)de
procmail: [21546] Tue Nov  6 11:12:28 2001
procmail: Assigning "DELIVERMAIL=/usr/cyrus/bin/deliver"
procmail: Assigning "INCLUDERC=/var/imap/.procmailrc"
procmail: Assigning "CYUSER=bweber"
procmail: No match on 
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?):
 root"
procmail: Assigning "DROPPRIVS=1"
procmail: Assuming identity of the recipient, VERBOSE=off
procmail: Skipped "file"
procmail: Skipped "."
couldn't connect to lmtpd: Invalid argument
procmail: Error while writing to "/usr/cyrus/bin/deliver"
From bweber(_at_)medienpartner(_dot_)de  Tue Nov  6 11:12:28 2001
 Subject: test
  Folder: /dev/null

********** start of common procmailrc-file *********************

#################################################
# procmailrc
# This is the main procmail file with common SPAM recipes
# Based on the article at
# http://www.ncworldmag.com/ncw-05-1998/ncw-05-imap.html
# 
#
# First we define some basics

PATH=/usr/bin:/bin
SHELL=/bin/sh
#PMDIR=$HOME/Procmail
LOGFILE=/var/log/procmaillog
VERBOSE=on

# We define DELIVERTO just to prevent a lot of extra
# typing later on.  We define SPAMIT to prevent even more
# repetitive typing, as it's the same action for every user.
# This assumes we set up a SPAM folder right off the INBOX
# for every user on the system.  If we neglect to do that, we'll
# get in a bit of trouble.
DELIVERMAIL=/usr/cyrus/bin/deliver
#DELIVERTO=/usr/cyrus/bin/deliver-wrapper
#SPAMIT="$DELIVERTO user.$LOGNAME.SPAM"
#DELIVERAGE="$DELIVERTO user.bweber"
# This file includes the appropriate procmail.$LOGNAME
# file so that each user has his or her own recipe techniques
# for subscribed lists, e-mail alerts, etc.

# Before we begin any recipes, let's make a backup
# copy of any incoming mail.
#
# Remember to comment out the next recipe once
# you know everything is working fine, otherwise
# you'll fill up the backup directory very quickly.
# Some procmail tutorials demonstrate how you can
# set a quota on the backup directory so that you can
# leave it in force at all times.

#:0 ic
#| $DELIVERTO user.$LOGNAME.Backup

###############################
# If there used to be an existing system-wide procmailrc, you can
# include it here
#INCLUDERC=/etc/procmailrc
INCLUDERC=/var/imap/.procmailrc
# We shouldn't be running as a privileged user, but just in case,
# make sure we drop any privileges we have
DROPPRIVS=1

###############################
# If users want to be able to define their own private recipes
# and put them in their home .procmailrc files, comment out
# the next definition.
#
# These recipes will be processed BEFORE the user-specific
# recipes that are kept in the /home/cyrus directory
#
# setup some variables, before we start
#ALERTSBOX=user.$LOGNAME.Folders.Alerts
#LISTSBOX=user.$LOGNAME.Folders.Lists
#
#INCLUDERC=$HOME/.procmailrc

# If you want to define user-specific recipes that
# you manage centrally (perhaps because you don't want
# to allow your users to "roll their own," then
# uncomment the following line.  In this case, you have
# to create a file for each user in the form:
# procmail.username -- for example, procmail.Joe
#
# INCLUDERC=/usr/cyrus/etc/procmail.$LOGNAME

#############################
# Now we begin our recipes

#############################
# Email-specific SPAM recipes
# Here's one example

#### NOTE: surely cyrus 'deliver' does its own locking? There should
#### thus be no need for :0:$LOGNAME.lock

#:0
#* ^To:(_dot_)*anyplace(_at_)juno(_dot_)com
#| $SPAMIT

#############################
# General SPAM Recipes
# Here are a few examples
#
# The "To:" line doesn't exist

#:0
#* !^To:
#| $SPAMIT

#:0
#* ^TO_root
#| $DELIVERAGE

# The "To:" line is empty

#:0
#* ^To: $
#| $SPAMIT

# The "From:" line is empty

#:0
#* ^From: $
#| $SPAMIT

#############################
# All the mail that falls
# through the above recipes
# will be put into the user's
# inbox.  This is always the LAST
 recipe to appear in the file.

:0W
| $DELIVERMAIL -e -a bweber -m user.bweber

# If that fails - maybe because the user is out of quota, or the mailbox
# hasn't been created - then force a bounce (otherwise the message would
# get silently appended to /var/spool/mail/$LOGNAME).

# This is EX_CANTCREAT (Can't create output)
EXITCODE=73
:0
/dev/null

#
# End of procmailrc file
##############################

**** start of special procmailrc-file

CYUSER=bweber
:0:$CYUSER.lock
* ^TO: root
| $DELIVERMAIL -e -a $CYUSER -m user.$CYUSER
<Prev in Thread] Current Thread [Next in Thread>