I'm posting this for a friend who is currently nntp impared:
============================================
I am having a problem under FreeBSD 2.2.2-RELEASE regarding forwarding
to an external program via the .forward file. Whenever an email is
received, I need it to be passed to my custom program as well as
stored in that user's mailbox. Thus, I would expect the .forward file
to be something like:
\myemail
|/the/path/myprogram
The problem is that when I create this .forward file and I send email
to the account, a message is returned that says:
Line 2: |/the/path/myprogram myemail is unsafe for mailing
I search the net and in related FAQs and there were a number of ideas
that seemed promising (rsmsh configuration, listing valid sheels in
/etc/shells, etc.), but none of them turned out to be the problem. I
tried to work around it by creating an alias in /etc/aliases that
reads:
myprog: |/the/path/myprogram
Then in each .forward file I put:
\myemail
myprog
This seemed to work just fine until I ran into a problem today. If
someone sends a message to two users on my system in a single SMTP
session and both users have myprog in the .forward file, only the
first user will actually have the message forwarded to "myprog." The
myprog program is NOT executed for the second user.
forward file, sendmail will leave copies of the email in both of their
mailboxes, but will execute "myprog" only once with UID=user1. Myprog
is never executed with UID=user2.
I suppose this makes sense since if "myprog" was a user he wouldn't
want two forwarded copies of the same message. However, I need my
program to be executed once for each user, even if it's the exact same
message.
Thus I am looking for a way to solve my problem. I see two options
for solving the problem:
1. Figure out how to configure sendmail to allow me to put a program
in each user's .forward file without reporting the "unsafe" error
message.
2. If possible, I'd like to use the current solution where all user's
.forward files reference an alias in /etc/aliases which references the
program; that way if I ever change the location of the program I just
need to update the /etc/aliases file and everyone will be "updated"
immediately. But I need to know if there's any way to tell sendmail
to execute "myprog" multiple times, once for each user receiving the
mail, executing as that user's UID.
Any and all help will be greatly appreciated. If possible, please
Thanks,
Craig Steiner