procmail
[Top] [All Lists]

Re: "Virtual recipients" processing without actual user accounts

1999-01-14 09:03:38
"Elmar K. Bins" <ekb(_at_)ivm(_dot_)net> writes:
I'm about to set up a box with "virtual" mail handling. This means, that
incoming mail shall be

- identified by local-part and domain
- filed into a specific mailbox depending on the above

The FM makes me believe that this may be achieved by means of calling
procmail with -m and some appropriate .rc.

I couldn't find anything about

- what recipes procmail goes through if there's no /etc/procmailrc
 on the system
- how it decides whether an address/local-part is valid or not
- how procmail selects the mailbox to drop the email

and of course

- how I can influence/override all these ;-)

procmail has three different 'modes' of running: normal, delivery, and
mailfilter.

Delivery mode is invoked using the -d flag.  All arguments are the -d
are usernames.  It is usually used by the MTA to deliver mail to users,
and indeed, procmail will return failure if it is given an invalid
username.  In delivery mode, procmail reads /etc/procmailrc before the
user's .procmailrc.

Mailfilter mode is invoked using the -m flag.  It accepts only one
rcfile as an argument -- other arguments are either variable
assignments or arguments that are made availible to the rcfile itself
as $1, $2, etc.  If the specified rcfile is located under
/etc/procmailrc/ then procmail will take on the uid of the owner of
that file.  Otherwise, it will run as the user who invoked it.
/etc/procmailrc is ignored.  In mailfilter mode, procmail unsets
ORGMAIL and DEFAULT to suppress normal delivery -- reaching the end of
the rcfile results in the mail bouncing.  If the rcfile sets either of
them then procmail will attempt delivery to that mailbox if it falls
off the end of the rcfile; however, the mailbox will have to be
writable by the uid/user that procmail is running as.

Normal mode is invoked by not using the -m or -d flags.  It accepts any
number of rcfiles and variable asssignments as arguments.  Procmail
runs as the invoking user in this mode.  /etc/procmailrc is ignored.


So, to answer your questions: if procmail reaches the end of the
specified rcfile, it bounces the mail (/etc/procmailrc is ignored).
Everything is up to the rcfile -- how to determine whether the address
is valid and where to put the message if it is.


To back up a step, how is the mail for these virtual addresses going to
be read?  If you can answer that question, it should tell you where the
mail is going to be stored and what privileges will be needed to store
the messages.  Procmail doesn't require anything along those lines, so
if you walk into this with no idea of how you want to do things and
look to procmail to tell you what the first step is, you won't get
anywhere.  You need to back up and start making some concrete decisions
about how things are going to be organized.  Design, _then_ implement.

And if you're planning on making money off this, consider hiring
someone who knows how to do this.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>