Re: From root to users

Arthur Dent <[email protected]> Fri, 30 May 2014 18:05:56 +0100
Newsgroups gmane.mail.procmail
Message-ID <1401469556.11206.20.camel@localhost>
On Fri, 2014-05-30 at 10:36 -0600, LuKreme wrote:
> On 30 May 2014, at 09:59 , Alan Clifford <[email protected]> wrote:
> 
> > Arthur Dent wrote (at 12:13 (+0100) on Friday, 30th May, 2014):
> > 
> >> 
> >> Is there a way to inform procmail explicitly to pass on from root to
> >> user=mark?
> >> 
> > 
> > 
> > I am thinking something like this:
> > 
> > Delete this
> > 
> > # Anything else falls through to me:
> > | /usr/libexec/dovecot/dovecot-lda -d mark
> > 
> > 
> > add this to /etc/aliases
> > 
> > # Person who should get root's mail
> > root:           alan
> > 
> > assuming you are using sendmail.  Hmmm, thinks, you said "collect" mail, so I'm not sure what you are using to launch procmail
> 
> That won't work, it will alias ALL the root mail to alan before handing it off to the /etc/procmailrc

I'm going to try Alan's suggestion because what put me on to all this
was the fact that I had already aliased root to my user in order to get
the system messages (Fedora 20 now ships without an MDA and all system
emails are disabled by default - to get system emails I needed to alias
root to my account).
In testing something else I discovered that these system emails were
being delivered my my .procmailrc which I had simply left there thinking
it was now obsolete - the system emails were being delivered, but to a
different mailbox to the one I was expecting. After a lot of
hair-tearing I realised that my old .procmailrc was still there and that
was what was being used to deliver the system mail.

I will try Alan's suggestion and let you know if it works.

> I think what you have to do is call procmail from the /etc/procmailrc and then call the dovecot LDA from the .procmailrc.
> 
> so, in procmailrc:
> 
> #deliver anything else to mark
> :0
> | /usr/local/bin/procmail -d mark
> 
> (I don't know if you need any flags on that recipe or not, test first. Test *a lot* first.)

And if Alan's idea doesn't work - this is exactly the sort of thing that
I was thinking of. I looked in man procmail but I did not see the -d
switch. I've looked again and now wonder why I missed it...

> Then, in your .procmailrc, at the end you do
> 
> :0
> | /usr/libexec/dovecot/dovecot-lda -m $MYBOX

I already have that...

> (do not put a f (or w?) flag on this, dovecot-lda is a delivery pipe.

Ahh... I have :0 w on all my (dovecot-lda) delivery recipes. I saw that
on the Dovecot wiki. Is that wrong?

Thanks again.

Mark