Mailing List Archive

dbMail install w/ sendmail & mysql related fix
I have install dbmail in the following Linux box.

- Compaq AP400
- Pentium II 350 x 2
- 128 M RAM
- RedHat 7.2
- Kernel 2.4.17
- mysql 3.23.41
- sendmail 8.12.2
- dbmail CVS 21Feb2002

The new sendmail.mc file should add the following lines :

dnl define new dbMail mailer
MAILER(dbmail)dnl
LOCAL_CONFIG
dnl define Domain name for dbMail usage
D{DOM}x5687.net
dnl define user listing file for dbMail usage
F{dbuserlist}/etc/mail/db_user_list
dnl insert condition jump into ParseLocal Section
LOCAL_RULE_0
R$+ < $* ${DOM}. > $* $: $>TO_DB $1 < $2 ${DOM}. >
LOCAL_RULESETS
dnl condition jump to dbMail mailer
STO_DB
R$* <@ $+ > $* $1
R$={dbuserlist} $@ $#DBM $: $1

I created a new mailer type "dbmail". The dbmail.m4 file was attached. You
must copy it into <your cf installed dir>/mailer/ before re-geneate
sendmail.cf from new sendmail.mc file.

For username find in /etc/mail/db_user_list will delivery into dbmail. All
others will delivery by default mailer. This method's downside was you
can't delivery to a virtual user. Since all delivery checking was run by
sendmail (may I was wrony, please noted me if your known). The
db_user_list must contain the username only. The sendmail maro would
delete the domain name partion. You must also insert the username into
dbmail's database.

I have amended the dbmail/main.c from #define INDEX_DELIVERY_MODE 1 to
#define INDEX_DELIVERY_MODE 3 It was because sendmail always call
dbmail-smtp with parameter "-f <from@address> -d <usrname>". I couldn't
eliminate it.

After that I still facting a problem, it was the dbmail-smtp always logged
a error "mysql_real_query 1 failed: MySQL server has gone away". It make
the incoming messages go into the deferal queue. I guess there must some
problem between the dbmail-smtp and mysqld. Therefore I inserted some
retry loop into the dbmysql.c(as enclosed).

--
Eddy Lai
http://www.5687.net/