somehow, though debugging sendmail and getting good results when querying the mysql database as it knows the user info etc. I have problem with procmail
when using procmail-3.13.1 with patch you offer here, I had slight problems compiling it, but when I added into the src/Makefile additional .$(O) files, I could get it to compile without any problem - - somehow it is looking up in /etc/passwd file for userinfo instead of sql/users table, so when I have user setup in sql, it'll deliver mail only if the user resides in /etc/passwd
otherwise it will give me errors, like thisone:
Sep 23 12:40:03 prati sendmail[3824]: h8NBr7dL003603: to=<test1>, ctladdr=<root@host.net> (1001/454545), delay=00:46:55, xdelay=00:00:00, mailer=local, pri=480565, dsn=4.0.0, stat=Deferred: local mailer (/usr/bin/procmail) exited with EX_TEMPFAIL
Sep 23 12:40:03 prati sendmail[3824]: h8NBq4dL003522: SYSERR(root): mailer local died with signal 11
hangon!! if I add a record for this user into the "alias" table, directing the email to a file, then procmail will deliver without error... here is an example:
mysql> select * from alias;
+---------------+------------------------+
| address | alias |
+---------------+------------------------+
| test1 | /var/spool/mail/test1 |
+---------------+------------------------+
this is how the sendmail logs the mail beeing delivered to the alias mailfile
Sep 23 23:37:46 prati sendmail[5833]: h8NNbkdL005786: alias <test1@host.net> => /var/spool/mail/test1
Sep 23 23:37:46 prati sendmail[5833]: h8NNbkdL005786: to=/var/spool/mail/test1, ctladdr=<test1@host.net> (51/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=34997, dsn=2.0.0, stat=Sent
here is how my sqlmail.conf looks like:
cat /etc/mail/sqlmail.conf
#############################
# MySQL Config for Sendmail #
#############################
MysqlSocket /var/lib/mysql/mysql.sock
MysqlHost 127.0.0.1
MysqlUsername sendmail
MysqlPassword *
MysqlDatabase mail
MysqlUserTable users
MysqlMailboxTable users
MysqlAliasTable alias
MysqlMapTable maps
MysqlLHSColumn address
MysqlRHSColumn alias
clearly by accessing sendmail, I can see that it shows the correct information, like
virtuser table
mailertable table
alias table
all seems to work properly, sendmail is able to give correct information on emails stored in virtuser, alias, users etc. but procmail seems to be not so keen on using the sql....
when procmail is supposed to deliver the mail to the pop user mailbox, it simply won't and returns an error through sendmail in syslog
ie. I have tried to use the procmail-3.22 without any patch and it will only deliver the mail if I create the alias table record directing the mail to a file instead of using the users table....
somehow, though debugging sendmail and getting good results when querying the mysql database as it knows the user info etc. I have problem with procmail
when using procmail-3.13.1 with patch you offer here, I had slight problems compiling it, but when I added into the src/Makefile additional .$(O) files, I could get it to compile without any problem - - somehow it is looking up in /etc/passwd file for userinfo instead of sql/users table, so when I have user setup in sql, it'll deliver mail only if the user resides in /etc/passwd
otherwise it will give me errors, like thisone:
Sep 23 12:40:03 prati sendmail[3824]: h8NBr7dL003603: to=<test1>, ctladdr=<root@host.net> (1001/454545), delay=00:46:55, xdelay=00:00:00, mailer=local, pri=480565, dsn=4.0.0, stat=Deferred: local mailer (/usr/bin/procmail) exited with EX_TEMPFAIL
Sep 23 12:40:03 prati sendmail[3824]: h8NBq4dL003522: SYSERR(root): mailer local died with signal 11
hangon!! if I add a record for this user into the "alias" table, directing the email to a file, then procmail will deliver without error... here is an example:
mysql> select * from users;
+-----------+----------+------+--------+---------------------+-----------------------+-----------+-----------------------------+
| username | passwd | uid | gid | gecos | home_dir | shell | maildrop |
+-----------+----------+------+--------+---------------------+-----------------------+-----------+-----------------------------+
| test1 | prufa123 | 1001 | 454545 | testtest123 | /disk2/home/test1 | /nologin | /disk2/spool/mail/test1 |
+-----------+----------+------+--------+---------------------+-----------------------+-----------+-----------------------------+
mysql> select * from alias;
+---------------+------------------------+
| address | alias |
+---------------+------------------------+
| test1 | /var/spool/mail/test1 |
+---------------+------------------------+
this is how the sendmail logs the mail beeing delivered to the alias mailfile
Sep 23 23:37:46 prati sendmail[5833]: h8NNbkdL005786: alias <test1@host.net> => /var/spool/mail/test1
Sep 23 23:37:46 prati sendmail[5833]: h8NNbkdL005786: to=/var/spool/mail/test1, ctladdr=<test1@host.net> (51/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=34997, dsn=2.0.0, stat=Sent
here is how my sqlmail.conf looks like:
cat /etc/mail/sqlmail.conf
#############################
# MySQL Config for Sendmail #
#############################
MysqlSocket /var/lib/mysql/mysql.sock
MysqlHost 127.0.0.1
MysqlUsername sendmail
MysqlPassword *
MysqlDatabase mail
MysqlUserTable users
MysqlMailboxTable users
MysqlAliasTable alias
MysqlMapTable maps
MysqlLHSColumn address
MysqlRHSColumn alias
clearly by accessing sendmail, I can see that it shows the correct information, like
virtuser table
mailertable table
alias table
all seems to work properly, sendmail is able to give correct information on emails stored in virtuser, alias, users etc. but procmail seems to be not so keen on using the sql....
when procmail is supposed to deliver the mail to the pop user mailbox, it simply won't and returns an error through sendmail in syslog
ie. I have tried to use the procmail-3.22 without any patch and it will only deliver the mail if I create the alias table record directing the mail to a file instead of using the users table....
and this is how users table looks like:
mysql> desc users;
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| username | char(32) | YES | | NULL | |
| passwd | char(32) | YES | | NULL | |
| uid | mediumint(9) | | PRI | NULL | auto_increment |
| gid | mediumint(9) | YES | | NULL | |
| gecos | char(32) | YES | | NULL | |
| home_dir | char(32) | YES | | NULL | |
| shell | char(32) | YES | | NULL | |
| maildrop | char(128) | YES | | NULL | |
+----------+--------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)
do you have any suggestions on how I can make procmail use the users table instead of accessing the /etc/passwd for user mailbox info...
my best regards and many thanks in advance!!
X
need no worry...
I've turned one lame thing to a very keen solution...
it's simply better done with PostFix than sendmail+sql...
you who are in trouble getting this to work, try using postfix + courier imap + mysql... it simply works :)
http://www.postfix.org
it solved all my problems with the MTA+MDA etc...