On Fri, 26 Aug 2005, Chris Hogan wrote:
> Has anybody ever got Sendmail working with Dovecot virtual users?
The problem is to help sendmail to find the backend to hand over the
message. Usually sendmail figures this information for its own retrieving
the data from the users database (passwd, LDAP, PAM, ...).
The only time I used non-existent, virtual users ever, I did something
along the line of this thread:
http://www.mhonarc.org/archive/html/procmail/2002-12/msg00252.html
Setup the virtuser table to map each address into a paritcular unique ID,
that is not clashing with any real user, then provide one alias per unique
ID to file (or pipe) the message via aliases.
You should be able to generate this information from the fake /etc/passwd.
The mails are deliviered using the default UID (nobody, usually).
You can tweak this process by piping the message through a SetUID
programm, but the main problem is that there is no way to figure out the
recipient from the message passed into, hence, the recipient must be
passed via command line, hence you need one line per user.
BTW: This is, more or less, the same way you integrate mailman into
sendmail.
Another variant might be this (cf/README):
"
procmail An interface to procmail (does not come with sendmail).
This is designed to be used in mailertables. For example,
a common question is "how do I forward all mail for a
given
domain to a single person?". If you have this mailer
defined, you could set up a mailertable reading:
host.com procmail:/etc/procmailrcs/host.com
with the file /etc/procmailrcs/host.com reading:
:0 # forward mail for host.com
! -oi -f $1 person at other.host
This would arrange for (anything)@host.com to be sent
to person at other.host. In a procmail script, $1 is the
name of the sender and $2 is the name of the recipient.
"
You should be able to make use of "$2", instead of re-sending the
mail.
Bye,
--
Steffen Kaiser