diff options
author | edwin <edwin@FreeBSD.org> | 2006-08-06 06:35:33 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2006-08-06 06:35:33 +0800 |
commit | 4952e17de8680af7925a3caaf85750dcaf73e4f8 (patch) | |
tree | 5a73989b0f97d8d2add27f9ea02b438038191b8c /mail/dbmail21 | |
parent | 35f041a126d8472a767a4358832e763cf40b9dc3 (diff) | |
download | freebsd-ports-gnome-4952e17de8680af7925a3caaf85750dcaf73e4f8.tar.gz freebsd-ports-gnome-4952e17de8680af7925a3caaf85750dcaf73e4f8.tar.zst freebsd-ports-gnome-4952e17de8680af7925a3caaf85750dcaf73e4f8.zip |
New port: mail/dbmail21 -current branch of DBMail
Dbmail is the name of a group of programs that enable the possiblilty
of storing and retrieving mail messages from a database (currently
MySQL, PostgreSQL or SQLite).
What are the advantages?
* Scalability.
Dbmail is as scalable as the database that is used for the
mail storage.
* Manageability.
Dbmail is based upon a database. Dbmail can be managed by
changing settings in the database (f.e. using PHP/Perl/SQL).
* Speed.
Dbmail uses very efficient, database specific queries for
retrieving mail information. This is much faster then parsing
a filesystem.
* Security.
Dbmail has got nothing to do with the filesystem or interaction
with other programs in the Unix environment which need special
permissions. Dbmail is as secure as the database it's based
upon.
* Flexibility.
Changes on a Dbmail system (adding of users, changing passwords
etc.) are effective immediately.
WWW: http://www.dbmail.org/
PR: ports/101356
Submitted by: Mark Starovoytov <mark_sf@kikg.ifmo.ru>
Diffstat (limited to 'mail/dbmail21')
-rw-r--r-- | mail/dbmail21/Makefile | 158 | ||||
-rw-r--r-- | mail/dbmail21/distinfo | 6 | ||||
-rw-r--r-- | mail/dbmail21/files/dbmail-pop3d.sh.in | 2 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_001_383 | 44 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_002 | 28 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_004 | 52 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_005 | 14 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_006 | 138 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_007_385 | 76 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_008 | 22 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_009_372 | 63 | ||||
-rw-r--r-- | mail/dbmail21/files/patch-2.1.7_010_372 | 116 | ||||
-rw-r--r-- | mail/dbmail21/pkg-descr | 28 | ||||
-rw-r--r-- | mail/dbmail21/pkg-message | 12 | ||||
-rw-r--r-- | mail/dbmail21/pkg-plist | 76 |
15 files changed, 735 insertions, 100 deletions
diff --git a/mail/dbmail21/Makefile b/mail/dbmail21/Makefile index 1768309c1559..9c9dcafc56cc 100644 --- a/mail/dbmail21/Makefile +++ b/mail/dbmail21/Makefile @@ -1,89 +1,137 @@ # New ports collection makefile for: dbmail -# Date created: 07/26/2003 -# Whom: Clement Laforet <sheepkiller@cultdeadsheep.org> +# Date created: 3 August 2006 +# Whom: Mark Starovoytov <mark_sf@kikg.ifmo.ru> # # $FreeBSD$ # PORTNAME= dbmail -PORTVERSION= 2.0.10 +PORTVERSION= 2.1.7 CATEGORIES= mail -MASTER_SITES= http://www.dbmail.org/download/2.0/ -PKGNAMESUFFIX= -${DATABASE} +MASTER_SITES= http://www.dbmail.org/download/2.1/ MAINTAINER= mark_sf@kikg.ifmo.ru COMMENT= An SQL database-based mail system (POP3 and IMAP) +CONFLICTS= dbmail-*-2.0.* + +OPTIONS= MYSQL "Build with MySQL support" on \ + POSTGRESQL "Build with PostgreSQL support" off \ + SQLITE "Build with SQLite support" off \ + SIEVE "Build w. support for Sieve mail sorting language" off \ + LDAP "Build with support for LDAP authentication" off + +USE_AUTOTOOLS= libtool:15 GNU_CONFIGURE= YES CONFIGURE_ARGS= --prefix=${PREFIX} USE_GMAKE= YES -USE_OPENSSL= YES +USE_LDCONFIG= ${PREFIX}/lib/dbmail USE_RC_SUBR= dbmail-pop3d.sh dbmail-lmtpd.sh dbmail-imapd.sh -INSTALLS_SHLIB= yes -CFLAGS += -fPIC +LIB_DEPENDS+= gmime-2.0.4:${PORTSDIR}/mail/gmime2 +USE_GNOME= glib20 +USE_OPENSSL= YES +USE_PTHREADS= YES + +CFLAGS+= -fPIC -I${LOCALBASE}/include +LDFLAGS+= -pthread +CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" LOCALBASE=${LOCALBASE} + +PORTDOCS= AUTHORS BUGS COPYING INSTALL NEWS README \ + README.aliases README.exim README.ldap \ + README.postfix README.qmail README.sieve \ + README.smtp README.solaris README.usermap \ + THANKS +MAN1= dbmail-smtp.1 dbmail.1 +MAN5= dbmail.conf.5 +MAN8= dbmail-export.8 dbmail-imapd.8 dbmail-lmtpd.8 \ + dbmail-pop3d.8 dbmail-sievecmd.8 dbmail-timsieved.8 \ + dbmail-users.8 dbmail-util.8 +MANCOMPRESSED= no +MSG_FILE= ${PKGDIR}/pkg-message +PKGMESSAGE= ${WRKDIR}/pkg-message + +PLIST_SUB+= PORTNAME=${PORTNAME} +.if defined(NOPORTDOCS) +PLIST_SUB+= PORTDOCS="@comment " +.else +PLIST_SUB+= PORTDOCS="" +.endif + +.include <bsd.port.pre.mk> + +.if defined(WITH_MYSQL) +CONFIGURE_ARGS+=--with-mysql +USE_MYSQL= YES +DATABASE+= mysql +PLIST_SUB+= MYSQL="" +.else +PLIST_SUB+= MYSQL="@comment " +.endif .if defined(WITH_POSTGRESQL) -CONFIGURE_ARGS+= --with-pgsql -USE_PGSQL= yes -DATABASE= postgresql -PLIST_SUB+= PGSQL="" -PLIST_SUB+= MYSQL="@comment " -LDFLAGS+= -L${LOCALBASE}/lib/ +CONFIGURE_ARGS+=--with-pgsql +USE_PGSQL= yes +DATABASE+= postgresql +PLIST_SUB+= PGSQL="" .else -USE_MYSQL= YES -CONFIGURE_ARGS+= --with-mysql -DATABASE= mysql -PLIST_SUB+= MYSQL="" -PLIST_SUB+= PGSQL="@comment " -CFLAGS+= -I${LOCALBASE}/include/mysql -LDFLAGS+= -L${LOCALBASE}/lib/mysql +PLIST_SUB+= PGSQL="@comment " .endif -CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" LOCALBASE=${LOCALBASE} -PORTDOCS= INSTALL README EXTRAS +.if defined(WITH_SQLITE) +CONFIGURE_ARGS+=--with-sqlite +USE_SQLITE= yes +DATABASE+= sqlite +PLIST_SUB+= SQLITE="" +.else +PLIST_SUB+= SQLITE="@comment " +.endif -MAN1= dbmail-smtp.1 -MAN8= dbmail-imapd.8 dbmail-lmtpd.8 dbmail-pop3d.8 \ - dbmail-users.8 dbmail-util.8 -MANCOMPRESSED= no +.if defined(WITH_SIEVE) +CONFIGURE_ARGS+=--with-sieve=${LOCALBASE}/include +LIB_DEPENDS+= sieve.1:${PORTSDIR}/mail/libsieve +PLIST_SUB+= SIEVE="" +.else +PLIST_SUB+= SIEVE="@comment " +.endif -pre-everything:: - @${ECHO} "" - @${ECHO} "You may use the following build options:" - @${ECHO} " By default dbmail uses MySQL backend database." - @${ECHO} " To build dbmail with PostgreSQL as backend database," - @${ECHO} " define WITH_POSTGRESQL" - @${ECHO} "" +.if defined(WITH_LDAP) +CONFIGURE_ARGS+=--with-auth-ldap=${LOCALBASE}/include +USE_OPENLDAP= yes +.endif + +.if defined(WITHOUT_MYSQL) && defined(WITHOUT_POSTGRESQL) && defined(WITHOUT_SQLITE) +IGNORE="requires at least one database backend selected. Run 'make config'" +.endif + +.if ( ${OSVERSION} < 503000 ) +IGNORE="can be compiled only on FreeBSD 5.3-RELEASE or greater" +.endif post-patch: @${FIND} ${WRKSRC} -name CVS -type d | ${XARGS} ${RM} -fr - @${FIND} ${WRKSRC} -name '*.orig' -type f -delete + @${FIND} ${WRKSRC} -name *.orig -type f | ${XARGS} ${RM} -fr + ${SED} -e 's|%%DATADIR%%|${DATADIR}|g' \ + ${MSG_FILE} > ${PKGMESSAGE} post-configure: @${REINPLACE_CMD} -i.orig 's!/etc/dbmail.conf!${PREFIX}/etc/dbmail.conf!g' \ - ${WRKSRC}/dbmail.h + ${WRKSRC}/dbmail.h post-install: - ${INSTALL_DATA} ${WRKSRC}/dbmail.conf ${PREFIX}/etc/dbmail.conf-dist - @${MKDIR} ${DATADIR}/sql - ${INSTALL_DATA} ${WRKSRC}/sql/${DATABASE}/* ${DATADIR}/sql - cd ${WRKSRC}/man && ${INSTALL_MAN} ${MAN1} ${MAN1PREFIX}/man/man1 + @${INSTALL_DATA} ${WRKSRC}/dbmail.conf ${PREFIX}/etc/dbmail.conf-dist + @if [ ! -f ${PREFIX}/etc/dbmail.conf ] ; then \ + ${CP} -p ${PREFIX}/etc/dbmail.conf-dist ${PREFIX}/etc/dbmail.conf; \ + fi + @${MKDIR} ${DATADIR} + @for f in ${DATABASE}; do \ + ${MKDIR} ${DATADIR}/$$f ; \ + ${INSTALL_DATA} ${WRKSRC}/sql/$$f/* ${DATADIR}/$$f; \ + done .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} - cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} + @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} .endif - @${ECHO} "" - @${ECHO} "IMPORTANT NOTE FOR ADMINS UPGRADING FROM 1.X->2.X!!!" - @${ECHO} "" - @${ECHO} " *) Don't forget to update the database using a script from" - @${ECHO} " ${DATADIR}/sql/" - @${ECHO} " *) Many programs have been renamed and their arguments changed." - @${ECHO} " *) Read the upgrading notes." - @${ECHO} " *) Don't be careless with this upgrade or mail will be lost!" - @${ECHO} " *) dbmail can be controled by setting dbmail_imapd_enable," - @${ECHO} " dbmail_lmtpd_enable, and/or dbmail_pop3d_enable in" - @${ECHO} " /etc/rc.conf." - @${ECHO} "" - -.include <bsd.port.mk> + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.post.mk> diff --git a/mail/dbmail21/distinfo b/mail/dbmail21/distinfo index e9dc43fb98b0..345b98be2d99 100644 --- a/mail/dbmail21/distinfo +++ b/mail/dbmail21/distinfo @@ -1,3 +1,3 @@ -MD5 (dbmail-2.0.10.tar.gz) = 985c41a6ded0a6094948c5835d9dd4ec -SHA256 (dbmail-2.0.10.tar.gz) = 249a57d7c163155c7bf2ca758fa1fabc676aa84d3a0d8403e497a8da7ff49716 -SIZE (dbmail-2.0.10.tar.gz) = 632451 +MD5 (dbmail-2.1.7.tar.gz) = b6523e36d228198eeaf631c9a78a7fec +SHA256 (dbmail-2.1.7.tar.gz) = f46272083fcf4a30cd79a4c97ef19d3e4abc047dbea39eb137eab66c1b6ae133 +SIZE (dbmail-2.1.7.tar.gz) = 842237 diff --git a/mail/dbmail21/files/dbmail-pop3d.sh.in b/mail/dbmail21/files/dbmail-pop3d.sh.in index d787f6a668e7..21bc97377b8b 100644 --- a/mail/dbmail21/files/dbmail-pop3d.sh.in +++ b/mail/dbmail21/files/dbmail-pop3d.sh.in @@ -8,7 +8,7 @@ # KEYWORD: shutdown # -# Add the following lines to /etc/rc.conf to enable dbmail-pop3d: +# Add the following lines to /etc/rc.conf to enable dbmail-pop3d: # #dbmail_pop3d_enable="YES" # diff --git a/mail/dbmail21/files/patch-2.1.7_001_383 b/mail/dbmail21/files/patch-2.1.7_001_383 new file mode 100644 index 000000000000..3dfd1954f67b --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_001_383 @@ -0,0 +1,44 @@ +Index: modules/sortsieve.c +=================================================================== +--- modules/sortsieve.c (revision 2211) ++++ modules/sortsieve.c (revision 2212) +@@ -198,11 +198,10 @@ + } + + /* If there were any imapflags, set them. */ ++ memset(&msgflags, 0, IMAP_NFLAGS * sizeof(int)); + if (flags) { + int i, j; + +- memset(&msgflags, 0, IMAP_NFLAGS * sizeof(int)); +- + for (i = 0; flags[i]; i++) { // Loop through all script/user-specified flags. + for (j = 0; imap_flag_desc[j]; i++) { // Find the ones we support. + if (g_strcasestr(imap_flag_desc[j], flags[i])) { +@@ -684,8 +683,10 @@ + void sort_free_result(sort_result_t *result) + { + if (result == NULL) return; +- g_string_free(result->errormsg, TRUE); +- g_string_free(result->rejectmsg, TRUE); ++ if (result->errormsg != NULL) ++ g_string_free(result->errormsg, TRUE); ++ if (result->rejectmsg != NULL) ++ g_string_free(result->rejectmsg, TRUE); + dm_free(result); + } + +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2211) ++++ ChangeLog (revision 2212) +@@ -1,3 +1,9 @@ ++2006-07-26 Aaron Stone <aaron@serendipity.cx> ++ ++ * modules/sortsieve.c: ++ Accepted patch from maenaka (closes bug #383) to clear the IMAP flags ++ if none are given by the Sieve script. ++ + 2006-07-25 Paul J Stevens <paul@nfg.nl> + + * misc.c: diff --git a/mail/dbmail21/files/patch-2.1.7_002 b/mail/dbmail21/files/patch-2.1.7_002 new file mode 100644 index 000000000000..c268d37c635a --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_002 @@ -0,0 +1,28 @@ +Index: db.c +=================================================================== +--- db.c (revision 2212) ++++ db.c (revision 2213) +@@ -2885,6 +2885,9 @@ + *mailboxes = g_list_reverse(*mailboxes); + *errmsg = "Everything is peachy keen"; + ++ g_strfreev(chunks); ++ dm_free(cpy); ++ + return DM_SUCCESS; + + equery: +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2212) ++++ ChangeLog (revision 2213) +@@ -3,6 +3,9 @@ + * modules/sortsieve.c: + Accepted patch from maenaka (closes bug #383) to clear the IMAP flags + if none are given by the Sieve script. ++ * db.c: ++ Accepted patch from Leif Jackson to close a memory leak in ++ db_imap_split_mailbox. + + 2006-07-25 Paul J Stevens <paul@nfg.nl> + diff --git a/mail/dbmail21/files/patch-2.1.7_004 b/mail/dbmail21/files/patch-2.1.7_004 new file mode 100644 index 000000000000..6fbd421ffe24 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_004 @@ -0,0 +1,52 @@ +Index: debug.c +=================================================================== +--- debug.c (revision 2214) ++++ debug.c (revision 2215) +@@ -103,6 +103,7 @@ + fprintf(stderr, "%s %s", trace_to_text(level), message); + if (message[l] != '\n') + fprintf(stderr, "\n"); ++ fflush(stderr); + } + + if (level <= TRACE_SYSLOG) { +Index: modules/sortsieve.c +=================================================================== +--- modules/sortsieve.c (revision 2214) ++++ modules/sortsieve.c (revision 2215) +@@ -187,7 +187,7 @@ + extern const char * imap_flag_desc[]; + const char * const * flags; + const char * mailbox; +- int msgflags[IMAP_NFLAGS]; ++ int *msgflags = NULL; + + mailbox = sieve2_getvalue_string(s, "mailbox"); + flags = sieve2_getvalue_stringlist(s, "imapflags"); // TODO +@@ -198,9 +198,9 @@ + } + + /* If there were any imapflags, set them. */ +- memset(&msgflags, 0, IMAP_NFLAGS * sizeof(int)); + if (flags) { + int i, j; ++ msgflags = g_new0(int, IMAP_NFLASGS); + + for (i = 0; flags[i]; i++) { // Loop through all script/user-specified flags. + for (j = 0; imap_flag_desc[j]; i++) { // Find the ones we support. +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2214) ++++ ChangeLog (revision 2215) +@@ -1,3 +1,11 @@ ++2006-07-27 Aaron Stone <aaron@serendipity.cx> ++ ++ * debug.c: ++ Added fflush after fprintf (closes bug #388). ++ * modules/sortsieve.c: ++ Make sure that the msgflags pointer is NULL if there are no special ++ flags (closes bug #383). ++ + 2006-07-26 Paul J Stevens <paul@nfg.nl> + + * debian/control, modules/sortsieve.c: diff --git a/mail/dbmail21/files/patch-2.1.7_005 b/mail/dbmail21/files/patch-2.1.7_005 new file mode 100644 index 000000000000..bed2fd41dde4 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_005 @@ -0,0 +1,14 @@ +Index: modules/sortsieve.c +=================================================================== +--- modules/sortsieve.c (revision 2215) ++++ modules/sortsieve.c (revision 2216) +@@ -222,6 +222,9 @@ + m->result->cancelkeep = 1; + } + ++ if (msgflags) ++ g_free(msgflasgs); ++ + return SIEVE2_OK; + } + diff --git a/mail/dbmail21/files/patch-2.1.7_006 b/mail/dbmail21/files/patch-2.1.7_006 new file mode 100644 index 000000000000..0102ba6fbc02 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_006 @@ -0,0 +1,138 @@ +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2216) ++++ ChangeLog (revision 2217) +@@ -1,3 +1,11 @@ ++2006-07-30 Aaron Stone <aaron@serendipity.cx> ++ ++ * sql/mysql/create_tables.mysql, migrate_from_2.0_to_2.1.mysql: ++ Accepted patch from Maenaka to only create Sieve tables once, in ++ InnoDB format (closes bug #386). ++ * pipe.c: ++ Attempt to resolve bug #372. ++ + 2006-07-27 Aaron Stone <aaron@serendipity.cx> + + * debug.c: +Index: sql/mysql/migrate_from_2.0_to_2.1.mysql +=================================================================== +--- sql/mysql/migrate_from_2.0_to_2.1.mysql (revision 2216) ++++ sql/mysql/migrate_from_2.0_to_2.1.mysql (revision 2217) +@@ -176,21 +176,18 @@ + + + CREATE TABLE dbmail_sievescripts ( +- id BIGINT NOT NULL AUTO_INCREMENT, +- owner_idnr BIGINT NOT NULL +- REFERENCES dbmail_users(user_idnr) +- ON UPDATE CASCADE ON DELETE CASCADE, +- active TINYINT(1) DEFAULT '0' NOT NULL, +- name VARCHAR(100) NOT NULL DEFAULT '', +- script TEXT NOT NULL DEFAULT '', +- PRIMARY KEY (id) +-); ++ owner_idnr bigint(21) DEFAULT '0' NOT NULL, ++ name varchar(100) NOT NULL, ++ script text, ++ active tinyint(1) default '0' not null, ++ INDEX (name), ++ INDEX (owner_idnr), ++ INDEX (owner_idnr, name), ++ FOREIGN KEY owner_idnr_fk (owner_idnr) ++ REFERENCES dbmail_users (user_idnr) ON DELETE CASCADE ON UPDATE CASCADE ++) ENGINE=InnoDB; + +-# Looking in db.c, the WHERE clauses are: owner, owner name, owner active. +-CREATE INDEX dbmail_sievescripts_1 on dbmail_sievescripts(owner_idnr,name); +-CREATE INDEX dbmail_sievescripts_2 on dbmail_sievescripts(owner_idnr,active); + +- + # Add columns for storing the Sieve quota. + ALTER TABLE dbmail_users + ADD maxsieve_size BIGINT DEFAULT '0' NOT NULL, +Index: sql/mysql/create_tables.mysql +=================================================================== +--- sql/mysql/create_tables.mysql (revision 2216) ++++ sql/mysql/create_tables.mysql (revision 2217) +@@ -207,7 +207,9 @@ + active tinyint(1) default '0' not null, + INDEX (name), + INDEX (owner_idnr), +- INDEX (owner_idnr, name) ++ INDEX (owner_idnr, name), ++ FOREIGN KEY owner_idnr_fk (owner_idnr) ++ REFERENCES dbmail_users (user_idnr) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB; + + +@@ -359,25 +361,6 @@ + UNIQUE KEY replycache_1 (to_addr,from_addr, handle) + ) ENGINE=InnoDB; + +-# +-# Add tables and columns to hold Sieve scripts. +- +-DROP TABLE IF EXISTS dbmail_sievescripts; +-CREATE TABLE dbmail_sievescripts ( +- id BIGINT NOT NULL AUTO_INCREMENT, +- owner_idnr BIGINT NOT NULL +- REFERENCES dbmail_users(user_idnr) +- ON UPDATE CASCADE ON DELETE CASCADE, +- active TINYINT(1) DEFAULT '0' NOT NULL, +- name VARCHAR(100) NOT NULL DEFAULT '', +- script TEXT NOT NULL DEFAULT '', +- PRIMARY KEY (id) +-); +- +-# Looking in db.c, the WHERE clauses are: owner, owner name, owner active. +-CREATE INDEX dbmail_sievescripts_1 on dbmail_sievescripts(owner_idnr,name); +-CREATE INDEX dbmail_sievescripts_2 on dbmail_sievescripts(owner_idnr,active); +- + DROP TABLE IF EXISTS dbmail_usermap; + CREATE TABLE dbmail_usermap ( + login VARCHAR(100) NOT NULL, +Index: pipe.c +=================================================================== +--- pipe.c (revision 2216) ++++ pipe.c (revision 2217) +@@ -61,10 +61,12 @@ + int sendwhat, char *sendmail_external) + { + FILE *mailpipe = NULL; +- char *escaped_to = NULL; +- char *escaped_from = NULL; ++ char *escaped_to = NULL, *parsed_to = NULL; ++ char *escaped_from = NULL, *parsed_from = NULL; + char *sendmail_command = NULL; + field_t sendmail, postmaster; ++ InternetAddressList *ialist; ++ InternetAddress *ia; + int result; + + if (!from || strlen(from) < 1) { +@@ -94,13 +96,23 @@ + trace(TRACE_DEBUG, "%s, %s: sendmail command is [%s]", + __FILE__, __func__, sendmail); + +- if (! (escaped_to = dm_shellesc(to))) { ++ ialist = internet_address_parse_string(to); ++ ia = ialist->address; ++ parsed_to = internet_address_to_string(ia, TRUE); ++ internet_address_list_destroy(ialist); ++ ++ if (! (escaped_to = dm_shellesc(parsed_to))) { + trace(TRACE_ERROR, "%s, %s: out of memory calling dm_shellesc", + __FILE__, __func__); + return -1; + } + +- if (! (escaped_from = dm_shellesc(from))) { ++ ialist = internet_address_parse_string(from); ++ ia = ialist->address; ++ parsed_from = internet_address_to_string(ia, TRUE); ++ internet_address_list_destroy(ialist); ++ ++ if (! (escaped_from = dm_shellesc(parsed_from))) { + trace(TRACE_ERROR, "%s, %s: out of memory calling dm_shellesc", + __FILE__, __func__); + return -1; diff --git a/mail/dbmail21/files/patch-2.1.7_007_385 b/mail/dbmail21/files/patch-2.1.7_007_385 new file mode 100644 index 000000000000..b84a00ebc9d8 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_007_385 @@ -0,0 +1,76 @@ +Index: config.c +=================================================================== +--- config.c (revision 2217) ++++ config.c (revision 2218) +@@ -212,9 +212,10 @@ + if (config_get_value("serverid", "DBMAIL", serverid_string) < 0) + trace(TRACE_FATAL, "%s,%s: error getting config!", + __FILE__, __func__); ++ if (config_get_value("encoding", "DBMAIL", db_params->encoding) < 0) ++ trace(TRACE_FATAL, "%s,%s: error getting config!", ++ __FILE__, __func__); + +- +- + if (config_get_value("table_prefix", "DBMAIL", db_params->pfx) < 0) + trace(TRACE_FATAL, "%s,%s: error getting config!", + __FILE__, __func__); +Index: modules/dbmysql.c +=================================================================== +--- modules/dbmysql.c (revision 2217) ++++ modules/dbmysql.c (revision 2218) +@@ -90,6 +90,16 @@ + int collations_match = 0; + int i, j; + ++ if (strlen(_db_params.encoding) > 0) { ++ snprintf(the_query, DEF_QUERYSIZE, "SET NAMES %s", _db_params.encoding); ++ if (db_query(the_query) == DM_EQUERY) { ++ trace(TRACE_ERROR, ++ "%s,%s: error setting collation", __FILE__, __func__); ++ return DM_EQUERY; ++ } ++ db_free_result(); ++ } ++ + snprintf(the_query, DEF_QUERYSIZE, + "SHOW VARIABLES LIKE 'collation_%%'"); + if (db_query(the_query) == DM_EQUERY) { +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2217) ++++ ChangeLog (revision 2218) +@@ -5,6 +5,9 @@ + InnoDB format (closes bug #386). + * pipe.c: + Attempt to resolve bug #372. ++ * config.c, dbmail.conf, dbmailtypes.h, modules/dbmysql.c: ++ Accepted patch from Maenaka to allow configurable MySQL connection ++ encoding (closes bug #385). + + 2006-07-27 Aaron Stone <aaron@serendipity.cx> + +Index: dbmail.conf +=================================================================== +--- dbmail.conf (revision 2217) ++++ dbmail.conf (revision 2218) +@@ -18,6 +18,7 @@ + pass= # Database password. + db=dbmail # Database name. + #table_prefix=dbmail_ # Table prefix. Defaults to "dbmail_" if not specified. ++#encoding=latin1 # MySQL connection encoding must match to table encoding. + #postmaster=DBMAIL-MAILER # Postmaster's email address for use in bounce messages. + sendmail=/usr/sbin/sendmail # Sendmail executable for forwards, replies, notifies, vacations. + +Index: dbmailtypes.h +=================================================================== +--- dbmailtypes.h (revision 2217) ++++ dbmailtypes.h (revision 2218) +@@ -99,6 +99,7 @@ + field_t sock; /**< path to local unix socket (local connection) */ + field_t pfx; /**< prefix for tables e.g. dbmail_ */ + unsigned int serverid; /**< unique id for dbmail instance used in clusters */ ++ field_t encoding; /**< character encoding to use */ + } db_param_t; + + /** configuration items */ diff --git a/mail/dbmail21/files/patch-2.1.7_008 b/mail/dbmail21/files/patch-2.1.7_008 new file mode 100644 index 000000000000..4e050d901c09 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_008 @@ -0,0 +1,22 @@ +Index: modules/sortsieve.c +=================================================================== +--- modules/sortsieve.c (revision 2218) ++++ modules/sortsieve.c (revision 2219) +@@ -200,7 +200,7 @@ + /* If there were any imapflags, set them. */ + if (flags) { + int i, j; +- msgflags = g_new0(int, IMAP_NFLASGS); ++ msgflags = g_new0(int, IMAP_NFLAGS); + + for (i = 0; flags[i]; i++) { // Loop through all script/user-specified flags. + for (j = 0; imap_flag_desc[j]; i++) { // Find the ones we support. +@@ -223,7 +223,7 @@ + } + + if (msgflags) +- g_free(msgflasgs); ++ g_free(msgflags); + + return SIEVE2_OK; + } diff --git a/mail/dbmail21/files/patch-2.1.7_009_372 b/mail/dbmail21/files/patch-2.1.7_009_372 new file mode 100644 index 000000000000..d92952dcefa8 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_009_372 @@ -0,0 +1,63 @@ +Index: ChangeLog +=================================================================== +--- ChangeLog (revision 2219) ++++ ChangeLog (revision 2220) +@@ -1,3 +1,9 @@ ++2006-08-01 Aaron Stone <aaron@serendipity.cx> ++ ++ * pipe.c: ++ Proper fix to prevent passing addresses with full names on the ++ sendmail command line (closes bug #372). ++ + 2006-07-30 Aaron Stone <aaron@serendipity.cx> + + * sql/mysql/create_tables.mysql, migrate_from_2.0_to_2.1.mysql: +Index: pipe.c +=================================================================== +--- pipe.c (revision 2219) ++++ pipe.c (revision 2220) +@@ -98,26 +98,40 @@ + + ialist = internet_address_parse_string(to); + ia = ialist->address; +- parsed_to = internet_address_to_string(ia, TRUE); +- internet_address_list_destroy(ialist); ++ if (ia->type != INTERNET_ADDRESS_NAME) { ++ // There isn't a valid address here. Bail... ++ internet_address_list_destroy(ialist); ++ return -1; ++ } ++ parsed_to = ia->value.addr; + + if (! (escaped_to = dm_shellesc(parsed_to))) { + trace(TRACE_ERROR, "%s, %s: out of memory calling dm_shellesc", + __FILE__, __func__); ++ internet_address_list_destroy(ialist); + return -1; + } + ++ internet_address_list_destroy(ialist); ++ + ialist = internet_address_parse_string(from); + ia = ialist->address; +- parsed_from = internet_address_to_string(ia, TRUE); +- internet_address_list_destroy(ialist); ++ if (ia->type != INTERNET_ADDRESS_NAME) { ++ // There isn't a valid address here. Bail... ++ internet_address_list_destroy(ialist); ++ return -1; ++ } ++ parsed_from = ia->value.addr; + + if (! (escaped_from = dm_shellesc(parsed_from))) { + trace(TRACE_ERROR, "%s, %s: out of memory calling dm_shellesc", + __FILE__, __func__); ++ internet_address_list_destroy(ialist); + return -1; + } + ++ internet_address_list_destroy(ialist); ++ + if (!sendmail_external) { + sendmail_command = g_strconcat(sendmail, " -f ", escaped_from, " ", escaped_to, NULL); + dm_free(escaped_to); diff --git a/mail/dbmail21/files/patch-2.1.7_010_372 b/mail/dbmail21/files/patch-2.1.7_010_372 new file mode 100644 index 000000000000..dc87a13f1a54 --- /dev/null +++ b/mail/dbmail21/files/patch-2.1.7_010_372 @@ -0,0 +1,116 @@ +Index: pipe.c +=================================================================== +--- pipe.c (revision 2220) ++++ pipe.c (revision 2221) +@@ -46,6 +46,31 @@ + return ret; + } + ++static int parse_and_escape(const char *in, char **out) ++{ ++ InternetAddressList *ialist; ++ InternetAddress *ia; ++ ++ TRACE(TRACE_DEBUG, "parsing address [%s]", in); ++ ialist = internet_address_parse_string(in); ++ ia = ialist->address; ++ if (ia->type != INTERNET_ADDRESS_NAME) { ++ TRACE(TRACE_MESSAGE, "unable to parse email address [%s]", in); ++ internet_address_list_destroy(ialist); ++ return -1; ++ } ++ ++ if (! (*out = dm_shellesc(ia->value.addr))) { ++ TRACE(TRACE_ERROR, "out of memory calling dm_shellesc"); ++ internet_address_list_destroy(ialist); ++ return -1; ++ } ++ ++ internet_address_list_destroy(ialist); ++ ++ return 0; ++} ++ + // Send only certain parts of the message. + #define SENDNOTHING 0 + #define SENDHEADERS 1 +@@ -61,12 +86,10 @@ + int sendwhat, char *sendmail_external) + { + FILE *mailpipe = NULL; +- char *escaped_to = NULL, *parsed_to = NULL; +- char *escaped_from = NULL, *parsed_from = NULL; ++ char *escaped_to = NULL; ++ char *escaped_from = NULL; + char *sendmail_command = NULL; + field_t sendmail, postmaster; +- InternetAddressList *ialist; +- InternetAddress *ia; + int result; + + if (!from || strlen(from) < 1) { +@@ -93,60 +116,21 @@ + return -1; + } + +- trace(TRACE_DEBUG, "%s, %s: sendmail command is [%s]", +- __FILE__, __func__, sendmail); +- +- ialist = internet_address_parse_string(to); +- ia = ialist->address; +- if (ia->type != INTERNET_ADDRESS_NAME) { +- // There isn't a valid address here. Bail... +- internet_address_list_destroy(ialist); +- return -1; +- } +- parsed_to = ia->value.addr; +- +- if (! (escaped_to = dm_shellesc(parsed_to))) { +- trace(TRACE_ERROR, "%s, %s: out of memory calling dm_shellesc", +- __FILE__, __func__); +- internet_address_list_destroy(ialist); +- return -1; +- } +- +- internet_address_list_destroy(ialist); +- +- ialist = internet_address_parse_string(from); +- ia = ialist->address; +- if (ia->type != INTERNET_ADDRESS_NAME) { +- // There isn't a valid address here. Bail... +- internet_address_list_destroy(ialist); +- return -1; +- } +- parsed_from = ia->value.addr; +- +- if (! (escaped_from = dm_shellesc(parsed_from))) { +- trace(TRACE_ERROR, "%s, %s: out of memory calling dm_shellesc", +- __FILE__, __func__); +- internet_address_list_destroy(ialist); +- return -1; +- } +- +- internet_address_list_destroy(ialist); +- + if (!sendmail_external) { ++ parse_and_escape(to, &escaped_to); ++ parse_and_escape(from, &escaped_from); + sendmail_command = g_strconcat(sendmail, " -f ", escaped_from, " ", escaped_to, NULL); + dm_free(escaped_to); + dm_free(escaped_from); + if (!sendmail_command) { +- trace(TRACE_ERROR, "%s, %s: out of memory calling g_strconcat", +- __FILE__, __func__); ++ TRACE(TRACE_ERROR, "out of memory calling g_strconcat"); + return -1; + } + } else { + sendmail_command = sendmail_external; + } + +- trace(TRACE_INFO, "%s, %s: opening pipe to [%s]", +- __FILE__, __func__, sendmail_command); ++ TRACE(TRACE_INFO, "opening pipe to [%s]", sendmail_command); + + if (!(mailpipe = popen(sendmail_command, "w"))) { + trace(TRACE_ERROR, "%s, %s: could not open pipe to sendmail", diff --git a/mail/dbmail21/pkg-descr b/mail/dbmail21/pkg-descr index 2c03d30b6ea9..975d756571ae 100644 --- a/mail/dbmail21/pkg-descr +++ b/mail/dbmail21/pkg-descr @@ -1,22 +1,26 @@ -Dbmail is the name of a group of programs that enable the possiblilty of storing -and retrieving mail messages from a database (currently MySQL or PostgreSQL). +Dbmail is the name of a group of programs that enable the possiblilty +of storing and retrieving mail messages from a database (currently +MySQL, PostgreSQL or SQLite). What are the advantages? * Scalability. - Dbmail is as scalable as the database that is used for the mail storage. + Dbmail is as scalable as the database that is used for the + mail storage. * Manageability. - Dbmail is based upon a database. Dbmail can be managed by changing - settings in the database (f.e. using PHP/Perl/SQL). + Dbmail is based upon a database. Dbmail can be managed by + changing settings in the database (f.e. using PHP/Perl/SQL). * Speed. - Dbmail uses very efficient, database specific queries for retrieving mail - information. This is much faster then parsing a filesystem. + Dbmail uses very efficient, database specific queries for + retrieving mail information. This is much faster then parsing + a filesystem. * Security. - Dbmail has got nothing to do with the filesystem or interaction with other - programs in the Unix environment which need special permissions. Dbmail - is as secure as the database it's based upon. + Dbmail has got nothing to do with the filesystem or interaction + with other programs in the Unix environment which need special + permissions. Dbmail is as secure as the database it's based + upon. * Flexibility. - Changes on a Dbmail system (adding of users, changing passwords etc.) are - effective immediately. + Changes on a Dbmail system (adding of users, changing passwords + etc.) are effective immediately. WWW: http://www.dbmail.org/ diff --git a/mail/dbmail21/pkg-message b/mail/dbmail21/pkg-message new file mode 100644 index 000000000000..5cb452372e73 --- /dev/null +++ b/mail/dbmail21/pkg-message @@ -0,0 +1,12 @@ + +IMPORTANT NOTE FOR ADMINS UPGRADING FROM 1.X->2.X!!! + + *) Don't forget to update the database using a script from + %%DATADIR%%/ + *) Many programs have been renamed and their arguments changed. + *) Read the upgrading notes. + *) Don't be careless with this upgrade or mail will be lost! + *) dbmail can be controled by setting dbmail_imapd_enable, + dbmail_lmtpd_enable, and/or dbmail_pop3d_enable in + /etc/rc.conf. + diff --git a/mail/dbmail21/pkg-plist b/mail/dbmail21/pkg-plist index 1e3162bf4c1e..89fa1c52772f 100644 --- a/mail/dbmail21/pkg-plist +++ b/mail/dbmail21/pkg-plist @@ -1,36 +1,54 @@ +@unexec if cmp -s %D/etc/dbmail.conf-dist %D/etc/dbmail.conf; then rm -f %D/etc/dbmail.conf; fi etc/dbmail.conf-dist -lib/dbmail/libauthdbmail.so.0 -lib/dbmail/libauthdbmail.a -lib/dbmail/libauthdbmail.la -lib/dbmail/libauthdbmail.so -lib/dbmail/libsortdbmail.so.0 -lib/dbmail/libsortdbmail.a -lib/dbmail/libsortdbmail.la -lib/dbmail/libsortdbmail.so -lib/libdbmail.so.0 -lib/libdbmail.a -lib/libdbmail.la -lib/libdbmail.so +@exec if [ ! -f %D/etc/dbmail.conf ] ; then cp -p %D/%F %B/dbmail.conf; fi +@exec mkdir -p %D/lib/dbmail +lib/dbmail/libauth_ldap.a +lib/dbmail/libauth_ldap.la +lib/dbmail/libauth_ldap.so +lib/dbmail/libauth_ldap.so.0 +lib/dbmail/libauth_sql.a +lib/dbmail/libauth_sql.la +lib/dbmail/libauth_sql.so +lib/dbmail/libauth_sql.so.0 +lib/dbmail/libmysql.a +lib/dbmail/libmysql.la +lib/dbmail/libmysql.so +lib/dbmail/libmysql.so.0 +lib/dbmail/libpgsql.a +lib/dbmail/libpgsql.la +lib/dbmail/libpgsql.so +lib/dbmail/libpgsql.so.0 +lib/dbmail/libsort_sieve.a +lib/dbmail/libsort_sieve.la +lib/dbmail/libsort_sieve.so +lib/dbmail/libsort_sieve.so.0 +lib/dbmail/libsqlite.a +lib/dbmail/libsqlite.la +lib/dbmail/libsqlite.so +lib/dbmail/libsqlite.so.0 +@dirrm lib/dbmail +sbin/dbmail-export sbin/dbmail-imapd sbin/dbmail-lmtpd sbin/dbmail-pop3d sbin/dbmail-smtp sbin/dbmail-users sbin/dbmail-util -%%MYSQL%%%%DATADIR%%/sql/create_tables.mysql -%%MYSQL%%%%DATADIR%%/sql/create_tables_innoDB.mysql -%%MYSQL%%%%DATADIR%%/sql/migrate_from_1.x_to_2.0.mysql -%%MYSQL%%%%DATADIR%%/sql/migrate_from_1.x_to_2.0_innodb.mysql -%%MYSQL%%lib/dbmail/libmysqldbmail.so.0 -%%MYSQL%%lib/dbmail/libmysqldbmail.a -%%MYSQL%%lib/dbmail/libmysqldbmail.la -%%MYSQL%%lib/dbmail/libmysqldbmail.so -%%PGSQL%%%%DATADIR%%/sql/create_tables.pgsql -%%PGSQL%%%%DATADIR%%/sql/migrate_from_1.x_to_2.0.pgsql -%%PGSQL%%lib/dbmail/libpgsqldbmail.so.0 -%%PGSQL%%lib/dbmail/libpgsqldbmail.a -%%PGSQL%%lib/dbmail/libpgsqldbmail.la -%%PGSQL%%lib/dbmail/libpgsqldbmail.so -@dirrm lib/dbmail -@dirrm %%DATADIR%%/sql -@dirrm %%DATADIR%% +%%SIEVE%%sbin/dbmail-sievecmd +%%SIEVE%%sbin/dbmail-timsieved +@exec mkdir -p %D/share/%%PORTNAME%% +%%MYSQL%%@exec mkdir -p %D/share/PORTNAME/%%PORTNAME%%/mysql +%%MYSQL%%share/%%PORTNAME%%/mysql/create_tables.mysql +%%MYSQL%%share/%%PORTNAME%%/mysql/migrate_from_1.x_to_2.0_innodb.mysql +%%MYSQL%%share/%%PORTNAME%%/mysql/migrate_from_2.0_to_2.1.mysql +%%MYSQL%%share/%%PORTNAME%%/mysql/update_headervalue_01.mysql +%%MYSQL%%@dirrm share/%%PORTNAME%%/mysql +%%PGSQL%%@exec mkdir -p %D/share/PORTNAME/%%PORTNAME%%/postgresql +%%PGSQL%%share/%%PORTNAME%%/postgresql/create_tables.pgsql +%%PGSQL%%share/%%PORTNAME%%/postgresql/migrate_from_1.x_to_2.0.pgsql +%%PGSQL%%share/%%PORTNAME%%/postgresql/migrate_from_2.0_to_2.1.pgsql +%%PGSQL%%@dirrm share/%%PORTNAME%%/postgresql +%%SQLITE%%@exec mkdir -p %D/share/PORTNAME/%%PORTNAME%%/sqlite +%%SQLITE%%share/%%PORTNAME%%/sqlite/create_tables.sqlite +%%SQLITE%%@dirrm share/%%PORTNAME%%/sqlite +@dirrm share/%%PORTNAME%% |