procmail
[Top] [All Lists]

Re: how to keep symlinked mailbox from getting nuked?

1997-10-31 10:51:04
"Charles Hines" <chuck_hines(_at_)vnet(_dot_)IBM(_dot_)COM> writes:
I've just started using procmail, and I'm having a minor problem.  My
system mailbox is a symbolic link to another file, and procmail keeps
removing that symbolic link on me and creating a 0 length file.

I see in the man page that this is expected behavior, but I really
can't have it doing that nor can I really understand why it would want
to do that instead of trying to follow the symlink to the actual file
it's pointing to and work with that instead.

The reason for this is that symlinks break dotlocking: a dotlock is a
lock on a _name_, and links (hard or soft) give the same underlying
object two or more names.  In addition following symlinks offers all
kinds of security holes (readlink() and lstat() cannot be combined into
an atomic operation).


But anyways, is there any way for me to stop this behavior via the
..procmailrc or something similiar, or will I have to go in and muck
with the source code to stop this behavior?

The solution is to tell procmail to use the true filename.  If this
symlinking is for all users, then you should just recompile procmail
to use the correct algorithim to set ORGMAIL and DEFAULT.  If it's
just you, then you can just set DEFAULT and ORGMAIL at the top of
your .procmailrc to the same and correct value.


There didn't seem to be any way to change the value of the system
mailbox via the rc file (tried setting ORGMAIL, but that didn't work).

You need to set DEFAULT as well as ORGMAIL (procmail first tries delivery
to $DEFAULT, then to $ORGMAIL).


Philip Guenther

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