procmail
[Top] [All Lists]

Re: /var/mail/initial/logname if you aren't root

1996-02-10 17:24:11
 David said:
 
One system I use is moving its mailboxes from /var/mail/logname to
/var/mail/initial/logname: mine will be /var/mail/d/dattier instead of
/var/mail/dattier.
 
  I might just have to gag.

Is there a way I can recompile my non-root copy of procmail so that other
users can invoke it in their .forwards without having to add such a recipe
to their .procmailrcs?

  You could move the path of the /etc/procmailrcs to your own
directory.  But I am not sure if procmail has clever checks to
guarantee things about the owners of those files.  But that stinks of a
hack and it might not work.

  That said and done...  Note that in config.h you have the macro
SYSTEM_MBOX.  You could replace this with something like 

#define SYSTEM_MBOX somefunction(getenv("USER"))

and somefunction might be:

char *
somefunction(user)
  char *user;
{
  const char *beginning="/var/mail/";
  char *stuff_to_add;

  stuff_to_add=(char *)malloc((sizeof char)*(strlen(beginning)+
                                             strn(user)+
                                             5));

  if (!stuff_to_add) perror("malloc");

  /* strcat a bunch of things */

  return stuff_to_add;
}

that should do it

Soren

  

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