procmail
[Top] [All Lists]

Sendmail, Procmail and Virtual Hosting.

2002-07-23 12:06:11
Hello fellows,

My server was running RH 7.1 when the hard drive crashed
last May.  I had the hard drive replaced, RH 7.2 installed
and the data restored.  RH 7.2 came with Sendmail V 8.36.8.3
and Procmail 3.21.  I have only the one server for web and
mail, but host about 28 domains with virtual hosting.

To deliver the mail, with Sendmail as MTA and Procmail as
LDA, I use /etc/aliases, /etc/mail/local-host-names and
/etc/mail/virtusertable.  The mail goes through
/etc/procmailrc and $HOME/.procmailrc.  I have a call to The
Sanitizer and other recipes in /etc/procmailrc.

There is a Unix user for each domain, who receives the mail
sent to the default or mainuser mail box,  and a Unix user
for each additional POP box under each domain, with entries
in /etc/passwd and /etc/shadow.  The POP usernames are named
mainusername-popusername to avoid duplicity.

Every domain is listed in /etc/mail/local-host-names and the
file /etc/mail/virtusertable follows the following format:

@domainname1.tld     mainusername1
mainusername1(_at_)domainname1(_dot_)tld     mainusername1
@domainname2.tld     mainusername2
mainusername2(_at_)domainname2(_dot_)tld    mainusername2
popusername1(_at_)domainname2(_dot_)tld   mainusername2-popusername1
popusername2(_at_)domainname2(_dot_)tld     mainusername2-popusername2

This used to work perfectly well, delivering the mail to
each account and a catch-all with anything addressed to the
domain being delivered to the default box,  and still does,
for the old domains and POP boxes.

I added another domain however, and it no longer accepts
catch-all mail, but returns it "User Unknown" for the new
domain, although it still accepts them for the old domains.
This in itself is not a problem, due to the increase of
spam, it is probably a desirable thing.

The new POP boxes however, are a different problem.  First
of all and uppermost, the MUA's cannot pick up the mail from
/var/spool/mail/mainusern-popusern and mail addressed to
popuser1(_at_)domainname2(_dot_)tld gets delivered to mainuser2 instead
of mainuser2-popuser1.  This happens to newly-created POP
boxes.  POP boxes of the same domain created earlier get
their mail delivered OK and are able to pick up the mail
from the MUA without problem.

I did some testing using sendmail -bv and found that the
mail is being delivered only to the username, regardless of
the domain, as long as the domain is in
/etc/mail/local-host-names.  To illustrate:

mail sent to popusername1(_at_)domainname2(_dot_)tld gets delivered to
/var/spool/mail/mainusername2, if it is a newly created box;
or to /var/spool/mail/mainusername2-popusername1, if it is
an old one.  Not only that... mail addressed to
mainusername1(_at_)domainname2(_dot_)tld gets delivered to
/var/spool/mail/mainusername1 if a new one or to
/var/spool/mail/mainuser2 under the catch-all, if an old
one.

The entries in /var/log/maillog are, in my opinion,
unremarkable.  Sending a message to guevara(_at_)humberto(_dot_)info
generates:

Jul 23 13:34:02 dns1 sendmail[19064]: g6NHY2719064:
from=<humberto(_at_)HRFinancial(_dot_)com>, size=548, class=0,
nrcpts=1,
msgid=<LNBBLMAKIJOIFLDLCGOIIENHCNAA(_dot_)humberto(_at_)HRFinancial(_dot_)com
, proto=SMTP, daemon=MTA, relay=mydomain.com [10.6.1.21]
Jul 23 13:34:04 dns1 sendmail[19065]: g6NHY2719064:
to=<guevara(_at_)humberto(_dot_)info>,
ctladdr=<humberto(_at_)HRFinancial(_dot_)com> (604/593),
delay=00:00:02, xdelay=00:00:01, mailer=local, pri=30039,
dsn=2.0.0, stat=Sent

Likewise, there seems to be nothing strange when you go pick
it up, except that although there are some older messages in
the /var/spool/mail/hum-guevara box which I put there, this
one went to /var/spool/mail/hum, the default mail box for
the domain; and the MUA is unable to pick up the messages
that are already in /var/spool/mail/hum-guevara.:

Jul 23 13:34:24 dns1 ipop3d[19147]: pop3 service init from
10.6.1.21
Jul 23 13:34:24 dns1 ipop3d[19147]: Login user=hum-guevara
host=myhost.com [10.6.1.21] nmsgs=0/0
Jul 23 13:34:24 dns1 ipop3d[19147]: Logout user=hum-guevara
host=bosshome.usa-hosts.cxm [10.6.1.21] nmsgs=0 ndele=0

The $HOME/procmail/log shows:

procmail: [19066] Tue Jul 23 13:34:04 2002
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "PMDIR=/home/hum/procmail"
procmail: Assigning "LOGFILE=/home/hum/procmail/log"
procmail: Opening "/home/hum/procmail/log"
procmail: Locking "/var/spool/mail/hum.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/hum"
procmail: Opening "/var/spool/mail/hum"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/spool/mail/hum.lock"
procmail: Notified comsat: "hum(_at_)0:/var/spool/mail/hum"
From humberto(_at_)HRFinancial(_dot_)com  Tue Jul 23 13:34:03 2002
 Subject: test
  Folder: /var/spool/mail/hum                                               833


I tried looking at /var/messages but, for some reason
unknown to me, the file is not there.  I did get a message
once in the daily email that root receives from LogWatch (I
think probably generated during a reboot) which read:

NOQUEUE: SYSERR(root): /etc/sendmail.cf: line 148: readcf:
map virtuser: class dbm not available

But alas, I don't know what it means.  I have been reading
up on Sendmail and so far, I don't understand much about the
installation.  Line 148 is the one that calls the
virtusertable, though:

Kvirtuser hash -o /etc/mail/virtusertable

In summary, I believe that, although this is a mail delivery
problem, the problem most likely does not lie within
Procmail and thus, I ask for your indulgence in using the
list to try and find a solution to my situation.  I would be
very grateful if any of you can tell me what to do about my
problem.  I must tell you that I know next to nothing about
installing the server, because I am blind and use a windows
screen reader and voice synthetizer; therefore, I can access
the server only from Windoes through FTP, Telnet and Samba;
I cannot really work at the console at all.  I do have root
privileges however, and through Telnet, I should be able to
do whatever is needed to solve the problem.

Thanks in advance for your help.

Kind regards,

Humberto Rodriguez
humberto(_at_)humberto(_dot_)info

_______________________________________________
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>