Re: [SLUG] files for Paul

From: Paul M Foster (paulf@quillandmouse.com)
Date: Mon Jan 20 2003 - 18:10:11 EST


On Mon, Jan 20, 2003 at 05:23:58AM -0500, John wrote:

> On Mon, 20 Jan 2003 00:28:33 -0500, Paul M Foster wrote:
>
> -> So I haven't a clue why you're getting odd
> -> files with odd extensions.
>
> I didn't even think the file names were odd--just surprised at
> the odd starting point that they use for each fetch.
>
> -> Two things, though. I don't see fetchmail
> -> handing off the mail to procmail; there's nothing in the
> .fetchmailrc
> -> that tells it to use procmail for its delivery agent.
>
> Sorry. I mentioned the .forward file in my earlier email, but I
> didn't include it. It looks like this (just one single line),
> and it's in the user's home directory:
>
> "|exec /usr/bin/procmail"
>

While you can do this, the .forward file is better used for things like
forwarding mail destined for root to another user, and things like that.
In order to have fetchmail hand off the mail directly to procmail, you
can append the following line to your .fetchmailrc:

mda "/usr/bin/procmail -d"

BTW, don't know if you're aware, but you can make fetchmail fetch mail
from a variety of pop servers. I have three that I fetch from, and all
three are in my .fetchmailrc. Handy.

> -> Second, I notice
> -> it appears you're running fetchmail as root
> (/root/.fetchmailrc). This
> -> is a bad idea for security reasons. Better to run fetchmail
> as a regular
> -> user.
>
> You're correct that I'm running fetchmail as root. I sort of
> got myself confused over this issue; I was wondering what if I
> ended up handing off mail to two different users. But if that
> were the case, it would be procmail that needs to be running as
> root, wouldn't it?
>

I'm not sure about that. You could be right. It gets into file ownership
issues that I've never dealt with in this context. It's true, though,
that whatever user is running fetchmail will be the one who owns the
mail it fetches.

> -> And if you were (as root) to tell fetchmail to give the mail
> to
> -> procmail, it would ignore the /home/john/.procmailrc in favor
> of the
> -> /root/.procmailrc, if any.
>
> Somewhere along the way I got the impression that procmail
> always checks for a system-wide .procmailrc anyway. But I
> didn't create one. When I get down to creating recipes, I think
> I'll just add them as "includes" so I can have logically
> organized groups of recipes. In the case where you had two
> users set up, I imagine that some recipes might be global, and
> others might apply only to one user.
>

You can actually group recipes logically by simply commenting the
.procmailrc file. I do this in mine-- this section for list traffic,
this section for killfile winners, this section for spam, etc. The
global file would be /etc/procmailrc, according to the man page.

But if you're going to feed mail to various users via a pop server, then
you may not need procmail other than to filter spam. I've never run a
pop server, so I don't know what/where it wants things.

Paul



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 13:38:48 EDT