Re: Sorting locally delivered email using Procmail

2002-10-09 Thread Andy Saxena

On Mon, Oct 07, 2002 at 04:29:58AM -0400, Andy Saxena wrote:
 
 For details, please read my original posting. Here's the situation in
 brief:
 Deliver local mail to users in such a way that they can run their
 procmail recipes. For e.g., if a user gets all the mail about cron jobs,
 he should be able to direct that into the =inbox.cron folder.
 

I found the solution! Procmail was generating the From  envelope
header that cyrdeliver finds inacceptable! It seems if you call procmail
from exim, it runs in an explicit delivery mode (whatever that means)
and adds the From  header to the incoming email. My solution is really
simple. I used formail to get rid of the From  header like so:


--~/.procmailrc (begin)-
SHELL=/bin/sh
DELIVERMAIL=/usr/sbin/cyrdeliver
LOGFILE=$HOME/.maillog
IMAP=$DELIVERMAIL -a andy -q -m user.andy
LOGABSTRACT=all
VERBOSE=on

#Remove the From  header if it exists! Pass on the email to the other
#filters.
:0 fw

| /usr/bin/formail -I 'From ' -b

--~/.procmailrc (end)-


Exim is configured in the following manner:

-/etc/exim/exim.conf (begin)---

##
#  TRANSPORTS CONFIGURATION  #
##
#   ORDER DOES NOT MATTER#
# Only one appropriate transport is called for each delivery.#
##

# This transport is used for local delivery to user mailboxes. 

local_delivery:
  driver = pipe
  command = /usr/sbin/cyrdeliver ${local_part}
  return_path_add = true
  return_output
  prefix = 
  user = cyrus

# This transport is used for procmail

procmail_pipe:
  driver = pipe
  command = /usr/bin/procmail
  return_path_add
  delivery_date_add
  envelope_to_add
# check_string = From 
# escape_string = From 
#  suffix = 
  user = $local_part
  group = mail


##
#  DIRECTORS CONFIGURATION   #
# Specifies how local addresses are handled  #
##
#  ORDER DOES MATTER #
#   A local address is passed to each in turn until it is accepted.  #
##

# This director runs procmail for users who have a .procmailrc file

procmail:
  driver = localuser
  transport = procmail_pipe
  require_files = ${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail
  no_verify

# This director matches local user mailboxes. Since procmail does all
# delivery, it is never used.

localuser:
  driver = localuser
  transport = local_delivery

end

-/etc/exim/exim.conf (end)-

Please keep in mind that the above two illustrations are abridged
versions.

I am surprised that nobody else has faced this problem. It's hard to
imagine that I am the only one wanting to use Cyrus IMAP and sort all
the email into their various folders using procmail. Are there more
elegant solutions out there?

-Andy


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Sorting locally delivered email using Procmail

2002-10-07 Thread Keith G. Murphy

Andy Saxena wrote:
 On Fri, Oct 04, 2002 at 10:45:48AM -0500, Keith G. Murphy wrote:
 
Actually, I just use fetchmail to download from my ISP's POP3 store to 
my local Cyrus IMAP server (via procmail).

So your situation is completely different.  I don't see how you could 
use fetchmail to do what you are wanting to do.

What happens if you run cyrdeliver manually while logged on as the 
'mail' user (assuming your exim is running as that)?  You might have 
some kind of permissions problem.  fetchmail is running as root for me, 
so that's might be why it works for me, but not in the context of exim 
for you.
 
 
 Looks like there's a great deal of misunderstanding/ miscommunication
 about what I am trying to achieve.
 
 For details, please read my original posting. Here's the situation in
 brief:
 Deliver local mail to users in such a way that they can run their
 procmail recipes. For e.g., if a user gets all the mail about cron jobs,
 he should be able to direct that into the =inbox.cron folder.
 
Well, I don't see what I'm misunderstanding.  My points were

* When one of your users sends a mail, it's going to exim.  At that 
point, exim needs to deliver it, and fetchmail really can't (well, 
shouldn't) get involved - cyrdeliver, as you are doing, seems the proper 
thing to do.  Therefore, I mentioned that my setup, where I use 
fetchmail, because I want to download mail from a POP account, won't 
work (well, isn't the best way) for you.

* Since cyrdeliver is running under exim's user (mail) for you, and 
either under root or the recipient's user for me, your problems may stem 
from permissions, and you need to see what happens if you try doing the 
delivery under a different username.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Sorting locally delivered email using Procmail

2002-10-04 Thread Keith G. Murphy

Andy Saxena wrote:
 On Thu, Oct 03, 2002 at 10:58:01AM -0500, Keith G. Murphy wrote:
 

You might want to try this.  I don't know if it makes any difference or 
not, but cyrdeliver is picky and not well documented, and I notice that 
I always use the userid argument, and it works.  It's a different 
situation, though; I'm using fetchmail for my needs.

IMAP=$DELIVERMAIL -a andy -q -m andy andy
  
 
 
 No dice. It won't work. By the way, the setup works for me when I get
 email from the ISP using fetchmail and deliver it to Cyrus using the
 same procmail recipe.
 
 You use fetchmail for local delivery from user A to user B? Could you
 please share your Exim and fetchmail setup?
 
Actually, I just use fetchmail to download from my ISP's POP3 store to 
my local Cyrus IMAP server (via procmail).

So your situation is completely different.  I don't see how you could 
use fetchmail to do what you are wanting to do.

What happens if you run cyrdeliver manually while logged on as the 
'mail' user (assuming your exim is running as that)?  You might have 
some kind of permissions problem.  fetchmail is running as root for me, 
so that's might be why it works for me, but not in the context of exim 
for you.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Sorting locally delivered email using Procmail

2002-10-04 Thread

Keith G. Murphy ([EMAIL PROTECTED]) wrote*:
Actually, I just use fetchmail to download from my ISP's POP3 store to
my local Cyrus IMAP server (via procmail).

I've been using this app for years, always stable, very flexible, easy to
configure, I ditched cooking recipes when I found this:

getmail, A POP3 mail retriever with reliable Maildir and mbox delivery
http://www.qcc.sk.ca/~charlesc/software/getmail-2.0/

Run it from a cron job, it does its thing, then you can invoke a script written in
your favorite language (or shell...), or even customize the Python code directly,
to do exactly what you want (unless I misunderstood your requirements).

--
That's angle as in geometry.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Sorting locally delivered email using Procmail

2002-10-03 Thread Keith G. Murphy

Andy Saxena wrote:
 Hi,
 
 I tried under a different subject heading that may have been misleading.
 So here goes another try:
 
 I am trying to use procmail for local delivery. My setup consists of
 exim and cyrus from sid.
 
 Calling the localuser director before procmail I am easily able to
 deliver local email to myself. However, if I call the procmail
 director before localuser, the delivery fails.
 
 ---~/.procmailrc (end)--
 
 SHELL=/bin/sh
 DELIVERMAIL=/usr/sbin/cyrdeliver
 LOGFILE=$HOME/.maillog
 IMAP=$DELIVERMAIL -a andy -q -m andy
 LOGABSTRACT=all
 VERBOSE=on
 
You might want to try this.  I don't know if it makes any difference or 
not, but cyrdeliver is picky and not well documented, and I notice that 
I always use the userid argument, and it works.  It's a different 
situation, though; I'm using fetchmail for my needs.

IMAP=$DELIVERMAIL -a andy -q -m andy andy
   


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Sorting locally delivered email using Procmail

2002-10-03 Thread Andy Saxena

On Thu, Oct 03, 2002 at 10:58:01AM -0500, Keith G. Murphy wrote:
 Andy Saxena wrote:
 Hi,
 
 
 I am trying to use procmail for local delivery. My setup consists of
 exim and cyrus from sid.
 
 
 SHELL=/bin/sh
 DELIVERMAIL=/usr/sbin/cyrdeliver
 LOGFILE=$HOME/.maillog
 IMAP=$DELIVERMAIL -a andy -q -m andy
 LOGABSTRACT=all
 VERBOSE=on
 
 You might want to try this.  I don't know if it makes any difference or 
 not, but cyrdeliver is picky and not well documented, and I notice that 
 I always use the userid argument, and it works.  It's a different 
 situation, though; I'm using fetchmail for my needs.
 
 IMAP=$DELIVERMAIL -a andy -q -m andy andy
   

No dice. It won't work. By the way, the setup works for me when I get
email from the ISP using fetchmail and deliver it to Cyrus using the
same procmail recipe.

You use fetchmail for local delivery from user A to user B? Could you
please share your Exim and fetchmail setup?

Personally, I think the the problem is in trying to use Exim to deliver
directly to Procmail.

-Andy


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]