procmail
[Top] [All Lists]

Re: procmail not right for `virtual domain'

2001-03-05 14:40:23
I've been working on the problem of mail/virtual hosts and have
been implementing the following (on a Linux system, sendmail,
procmail, qpopper)

The stuff that works right now

1. Use user names of the format 'user(_at_)host' (which is allowed by
   sendmail, passwd, etc) instead of just 'user'. Allowed by
   Linux's passwd file and ldap right now.
2. Store mail in '/var/spool/mail/host/user(_at_)host' instead of just
   '/var/spool/mail/user' (requires change to sendmail.cf and
   procmail). The procmail change just adds a '-s' option to
   specify the host part of spool directory. Local users
   (ie. root without a hostname) are sent to standard location
   so that cron can send messages there.
3. Change qpopper (a pop3 daemon) to read mail from the same
   subdirectory (requires users to specify their user name as
   'user(_at_)host' instead of just 'user', since the host name is
   lost when connecting to pop3 daemons)

Stuff yet to do

4. Get imap-2000 to handle the host subdirectories.
5. Figure out how to keep mail programs from stripping the
   host part of the name from the user name entered in the
   user name field.

These changes allow for a user 'john' to be used on the same 
machine for different virtual domains. (john(_at_)net1, john(_at_)net2, 
etc) I can send mail to the users, and can (manually) connect 
up to my test machines pop3 port, login, and access mail. 

Mail send to 'john(_at_)host1' goes into
'/var/spool/mail/host1/john(_at_)host1'

The reason for using the subdirectories is that with a
virtual domains of hundreds of users, it makes it easier
to manage them is they are stored in several subdirectories
instead of one large directory.

The changes are all small, and a little rough yet, but they
work well for me. Am willing to share them if there is intrest
in anyone going this direction.

Or does someone else have a better solution already designed?

Bahamat wrote:

Ok, I've been reading  the procmail FAQ.

The question about creating a virtual domain is exactly the situation I'm in.
Basically all mail for my domain is delivered to a single pop mailbox in the
upstream, then it's grabbed with fetchmail into a local mailbox.

The theory is then, that procmail would sort out all the mail and give it to
whomever it's suposed to go.

I understand however that the envelope is now gone, thus procmail has much
difficulty doing what I've asked it to do, and as the FAQ states, procmail is
not the right tool for the job here.

So my question is, what is the right tool for the job? I'm using exim, but
have to qualms about switching to sendmail or postfix if it would help.

Or is this whole attempt futile and I should just ask my upstream to forward
all mail for my domain on down to my computer so that it can be done properly?
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail