These are the issues I ran into when trying to build sendmail-sql. Comments and help very welcome.
1. Including mysql.h: Most of the time, this file is included as <mysql.h> but in sendmail/map.c and in sendmail/mysql_sendmail.c it is included as <mysql/mysql.h>. To work around this one can either make sure that both (in my case) /usr/local/mysql/include and /usr/local/mysql/include/mysql are added to -I in site.config.m4, or you could change the patch-file before aplying it so only <mysql.h> is ever used in include statements.
2. The sendmail-sql-Makefile patch assumes you have both mysql and postrgess installed. If, as in my case, you only have mysql installed, you'd want to remove -DPGSQLMAP from the confENVDEF, and -lpq from confLIBS.
3. mail.local.c line 275 creates a warning about a cast from int to pointer because the definition of get_mysql_passwd doesn't get picked up. I've added an #include "mysql_local.h" to the top of the file, inside #IFDEF MYSQLMAP.
Because all files that include mysql_local.h also include <sm/sql.h> I've removed the struct mysql_sendmail_struct from mysql_local.h, otherwise there are 'redefined' errors.
4. The next problem I have been unable to fix:
mysql_local.c:172: error: `ml_mysql' undeclared (first use in this function)
Regards, Paul Boven.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
These are the issues I ran into when trying to build sendmail-sql. Comments and help very welcome.
1. Including mysql.h: Most of the time, this file is included as <mysql.h> but in sendmail/map.c and in sendmail/mysql_sendmail.c it is included as <mysql/mysql.h>. To work around this one can either make sure that both (in my case) /usr/local/mysql/include and /usr/local/mysql/include/mysql are added to -I in site.config.m4, or you could change the patch-file before aplying it so only <mysql.h> is ever used in include statements.
2. The sendmail-sql-Makefile patch assumes you have both mysql and postrgess installed. If, as in my case, you only have mysql installed, you'd want to remove -DPGSQLMAP from the confENVDEF, and -lpq from confLIBS.
3. mail.local.c line 275 creates a warning about a cast from int to pointer because the definition of get_mysql_passwd doesn't get picked up. I've added an #include "mysql_local.h" to the top of the file, inside #IFDEF MYSQLMAP.
Because all files that include mysql_local.h also include <sm/sql.h> I've removed the struct mysql_sendmail_struct from mysql_local.h, otherwise there are 'redefined' errors.
4. The next problem I have been unable to fix:
mysql_local.c:172: error: `ml_mysql' undeclared (first use in this function)
Regards, Paul Boven.