procmail
[Top] [All Lists]

Re: Where Is $HOME?

2001-07-24 09:39:48
On 24 Jul, Ben Ocean wrote:
| At 09:03 AM 7/24/2001 -0400, you wrote:
| >On 23 Jul, Ben Ocean wrote:
| >| Silly question, I know, but I have all sorts of users on my RH62 box that
| >| have no home or any account other than an email account. Some of them don't
| >| even have directories since I'm using a platform called Zope to build Web
| >| sites and putting ProxyPass lines in my httpd.conf file. So, where is 
$HOME?
| >
| >I don't know the specific answer to your question. But while you're
| >waiting you could do something like (in /etc/procmailrc):
| >
| >xLOGFILE=$LOGFILE
| >xVERBOSE=$VERBOSE
| >VERBOSE=no
| >LOGFILE=/pathto/procmaillog.testvars
| >LOG="$LOGNAME $HOME
| >"
| >LOGFILE=$xLOGFILE
| >VERBOSE=$xVERBOSE
| 
| Hmm. I ran this line:
| find / -type f -name "procmaillog.testvars" -print
| and got this:
| find: /proc/6/fd: Permission denied
| so, would the path be:
| /proc/6/fd/procmaillog.testvars
| ?
| 

No. /proc has nothing to do with procmail, and is definitely not a place
to put a log file (or any other user files). The /proc filesystem is
(quoting man 5 proc) "a pseudo-filesystem used as an inteface to kernel
data structures...".  It's not a real filesystem.

I guess to be perfectly clear I should have written:

LOGFILE=/pathto/procmaillog.testvars_or_other_filename_of_your_choosing

The concept was to create a separate logfile to make it easier to
gather the information, and to keep from "cluttering" your [presumed]
existing log file(s). This is just a short term measure to gather the
information you're looking for. It should create, in the specified file,
a one line entry with the LOGNAME and HOME for the recipient of each
message procmail processes. Name it anything you want, and put it in any
directory you want. It doesn't have to exist. Procmail will create it if
it doesn't, or append to it if it does.

| What exactly is an rcfile? .procmailrc I presume? And is a .procmailrc file 
| necessary if setting up procmail globally?

An rcfile loosely speaking is a configuration file. In the case of
procmail, that configuration consists of variable assignments (such as
LOGFILE=) and recipes. /etc/procmailrc, /etc/procmailrcs/.varsrc,
/etc/procmailrcs/.xlooprc, /etc/procmailrcs/lists.deh.rc, and
/home/deh/.procmailrc are all examples of procmail rcfiles on *my*
system. What's on yours depends on your configuration.

My suggestion would to put the 8 lines I proposed in /etc/procmailrc.
If you don't have an /etc/procmailrc file, then you create it. Replace
the LOGFILE=/pathto/... statement with one that specifies a path and
filename of your choosing as a target file for these particular procmail
log entries.  Then when you look in this log file, you should see 2
columns, the first is the $LOGNAME and the second is $HOME as procmail
knows them for each message processed.

This was only offered as a possible way for you to get this information
without waiting for a definitive answer, since I don't know the
definitive answer. My *guess* would be that, when you say users
have no "account other than an email account", they have an
account but no shell access. I would further *guess* that procmail gets
$HOME from /etc/passwd and that you could do the same. But since
guessing gets us nowhere, I offered a way you could get the information
without waiting. It won't tell you how procmail got/set the variables,
but it should tell you what they are.

-- 
                   /"\
Don Hammond        \ /     ASCII Ribbon Campaign
Raleigh, NC US      X        Against HTML Mail,
                   / \      and News Too

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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