Index: openacs-4/packages/acs-mail-lite/acs-mail-lite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/acs-mail-lite.info,v diff -u -r1.26 -r1.27 --- openacs-4/packages/acs-mail-lite/acs-mail-lite.info 17 Dec 2006 20:11:54 -0000 1.26 +++ openacs-4/packages/acs-mail-lite/acs-mail-lite.info 22 Dec 2006 07:57:42 -0000 1.27 @@ -14,7 +14,7 @@ Simplified reliable email transmission with bounce management. 2005-10-19 This package provides a simple ns_sendmail-like interface for sending messages, but queues messages in the database to ensure reliable sending and make sending a message 'transactional'. Prefered over acs-messaging or acs-mail. - 0 + 2 Index: openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-create.sql 17 Dec 2006 20:11:54 -0000 1.7 +++ openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-create.sql 22 Dec 2006 07:57:42 -0000 1.8 @@ -58,40 +58,43 @@ notification_count integer default 0 ); -CREATE TABLE acs_mail_lite_reply_prefixes -( - prefix varchar(100) NOT NULL, - package_id int4 NOT NULL, - impl_name varchar(100) NOT NULL -) ; - CREATE TABLE acs_mail_lite_complex_queue ( - id serial PRIMARY KEY, - creation_date text, - locking_server text, - to_party_ids text, - cc_party_ids text, - bcc_party_ids text, - to_group_ids text, - cc_group_ids text, - bcc_group_ids text, - to_addr text, - cc_addr text, - bcc_addr text, - from_addr text, - reply_to text, - subject text, - body text, - package_id integer, - files text, - file_ids text, - folder_ids text, - mime_type text, - object_id integer, - single_email_p boolean, - no_callback_p boolean, - extraheaders text, - alternative_part_p boolean, - use_sender_p boolean + id integer + constraint acs_mail_lite_complex_queue_pk + PRIMARY KEY, + creation_date text, + locking_server text, + to_party_ids varchar(4000), + cc_party_ids varchar(4000), + bcc_party_ids varchar(4000), + to_group_ids varchar(4000), + cc_group_ids varchar(4000), + bcc_group_ids varchar(4000), + to_addr clob, + cc_addr clob, + bcc_addr clob, + from_addr varchar(400), + reply_to varchar(400), + subject varchar(4000), + body clob, + package_id integer, + files varchar(4000), + file_ids varchar(4000), + folder_ids varchar(4000), + mime_type varchar(200), + object_id integer, + single_email_p varchar2(1) + constraint acs_mail_lite_co_qu_single_em_p_ck + check (valid_email_p in ('t','f')), + no_callback_p varchar2(1) + constraint acs_mail_lite_co_qu_no_callb_p_ck + check (valid_email_p in ('t','f')), + extraheaders clob, + alternative_part_p varchar2(1) + constraint acs_mail_lite_co_qu_alt_part_p_ck + check (valid_email_p in ('t','f')), + use_sender_p varchar2(1) + constraint acs_mail_lite_co_qu_use_sender_p_ck + check (valid_email_p in ('t','f')) ); Index: openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-drop.sql 17 Dec 2006 17:04:09 -0000 1.2 +++ openacs-4/packages/acs-mail-lite/sql/oracle/acs-mail-lite-drop.sql 22 Dec 2006 07:57:42 -0000 1.3 @@ -10,5 +10,4 @@ drop table acs_mail_lite_mail_log; drop table acs_mail_lite_bounce; drop table acs_mail_lite_bounce_notif; -drop TABLE acs_mail_lite_reply_prefixes; drop TABLE acs_mail_lite_complex_queue; \ No newline at end of file Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b5-1.3b6.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b7-1.3b8.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/Attic/upgrade-1.3b7-1.3b8.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b7-1.3b8.sql 17 Dec 2006 17:04:09 -0000 1.1 +++ openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b7-1.3b8.sql 22 Dec 2006 07:57:42 -0000 1.2 @@ -2,37 +2,42 @@ -- -- Name: acs_mail_lite_complex_queue; Type: TABLE; Schema: public; Owner: cognovis; Tablespace: -- - CREATE TABLE acs_mail_lite_complex_queue ( - id serial PRIMARY KEY, - creation_date text, - locking_server text, - to_party_ids text, - cc_party_ids text, - bcc_party_ids text, - to_group_ids text, - cc_group_ids text, - bcc_group_ids text, - to_addr text, - cc_addr text, - bcc_addr text, - from_addr text, - subject text, - body text, - package_id integer, - files text, - file_ids text, - folder_ids text, - mime_type text, - object_id integer, - single_email_p boolean, - no_callback_p boolean, - extraheaders text, - alternative_part_p boolean, - use_sender_p boolean + id integer + constraint acs_mail_lite_complex_queue_pk + PRIMARY KEY, + creation_date text, + locking_server text, + to_party_ids varchar(4000), + cc_party_ids varchar(4000), + bcc_party_ids varchar(4000), + to_group_ids varchar(4000), + cc_group_ids varchar(4000), + bcc_group_ids varchar(4000), + to_addr clob, + cc_addr clob, + bcc_addr clob, + from_addr varchar(400), + reply_to varchar(400), + subject varchar(4000), + body clob, + package_id integer, + files varchar(4000), + file_ids varchar(4000), + folder_ids varchar(4000), + mime_type varchar(200), + object_id integer, + single_email_p varchar2(1) + constraint acs_mail_lite_co_qu_single_em_p_ck + check (valid_email_p in ('t','f')), + no_callback_p varchar2(1) + constraint acs_mail_lite_co_qu_no_callb_p_ck + check (valid_email_p in ('t','f')), + extraheaders clob, + alternative_part_p varchar2(1) + constraint acs_mail_lite_co_qu_alt_part_p_ck + check (valid_email_p in ('t','f')), + use_sender_p varchar2(1) + constraint acs_mail_lite_co_qu_use_sender_p_ck + check (valid_email_p in ('t','f')) ); - --- --- PostgreSQL database statements - end of file --- - Index: openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b9-1.3b10.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/Attic/upgrade-1.3b9-1.3b10.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b9-1.3b10.sql 21 Dec 2006 20:48:48 -0000 1.1 +++ openacs-4/packages/acs-mail-lite/sql/oracle/upgrade/upgrade-1.3b9-1.3b10.sql 22 Dec 2006 07:57:42 -0000 1.2 @@ -1 +1 @@ -alter table acs_mail_lite_complex_queue add column reply_to text; \ No newline at end of file +alter table acs_mail_lite_complex_queue add column reply_to varchar(400); \ No newline at end of file Index: openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-create.sql 17 Dec 2006 20:11:55 -0000 1.7 +++ openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-create.sql 22 Dec 2006 07:57:42 -0000 1.8 @@ -50,46 +50,41 @@ constraint acs_mail_li_bou_notif_us_id_fk references parties (party_id) on delete cascade - constraint acs_mail_lite_notif_pk + constraint acs_mail_lite_bounce_notif_pk primary key, notification_time timestamptz default current_timestamp, notification_count integer default 0 ); -CREATE TABLE acs_mail_lite_reply_prefixes -( - prefix varchar(100) NOT NULL, - package_id int4 NOT NULL, - impl_name varchar(100) NOT NULL -) ; - CREATE TABLE acs_mail_lite_complex_queue ( - id serial PRIMARY KEY, - creation_date text, - locking_server text, - to_party_ids text, - cc_party_ids text, - bcc_party_ids text, - to_group_ids text, - cc_group_ids text, - bcc_group_ids text, - to_addr text, - cc_addr text, - bcc_addr text, - from_addr text, - reply_to text, - subject text, - body text, - package_id integer, - files text, - file_ids text, - folder_ids text, - mime_type text, - object_id integer, - single_email_p boolean, - no_callback_p boolean, - extraheaders text, - alternative_part_p boolean, - use_sender_p boolean + id integer + constraint acs_mail_lite_complex_queue_pk + primary key, + creation_date text, + locking_server text, + to_party_ids text, + cc_party_ids text, + bcc_party_ids text, + to_group_ids text, + cc_group_ids text, + bcc_group_ids text, + to_addr text, + cc_addr text, + bcc_addr text, + from_addr text, + reply_to text, + subject text, + body text, + package_id integer, + files text, + file_ids text, + folder_ids text, + mime_type text, + object_id integer, + single_email_p boolean, + no_callback_p boolean, + extraheaders text, + alternative_part_p boolean, + use_sender_p boolean ); Index: openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-drop.sql 17 Dec 2006 17:04:10 -0000 1.3 +++ openacs-4/packages/acs-mail-lite/sql/postgresql/acs-mail-lite-drop.sql 22 Dec 2006 07:57:42 -0000 1.4 @@ -10,5 +10,4 @@ drop table acs_mail_lite_mail_log; drop table acs_mail_lite_bounce; drop table acs_mail_lite_bounce_notif; -drop TABLE acs_mail_lite_reply_prefixes; drop TABLE acs_mail_lite_complex_queue; Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/acs-mail-lite/sql/postgresql/upgrade/upgrade-1.3b5-1.3b6.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.tcl 3 Dec 2006 13:23:24 -0000 1.10 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.tcl 22 Dec 2006 07:57:43 -0000 1.11 @@ -131,50 +131,3 @@ } } -ad_proc -public -callback subsite::parameter_changed -impl acs-mail-lite { - -package_id:required - -parameter:required - -value:required -} { - Implementation of subsite::parameter_changed for acs-mail-lite. - All packages that implement the callback acs_mail_lite::incoming_email require to provide - a package parameter called EnvelopePrefix. As soon as a site admin sets this parameter - this callback here is called to put that information in the mapping table acs_mail_lite_reply_tokens. - This table allows acs-mail-lite to inform the implementation directly. - - In order to allow packages listening to mails sent out by notifications we also listen to the parameter - ProcessNotificationRepliesP. - - @author Nima Mazloumi (nima.mazloumi@gmx.de) - @creation-date 2005-08-17 - - @param package_id the package_id of the package the parameter was changed for - @param parameter the parameter name - @param value the new value - -} { - ns_log Debug "subsite::parameter_changed -impl acs-mail-lite called for $parameter" - - set empty_p [empty_string_p $value] - - set package_key [apm_package_key_from_id $package_id] - - if {[string equal "EnvelopePrefix" $parameter] || [string equal "EmailReplyAddressPrefix" $parameter]} { - if {[db_0or1row entry_exists {}]} { - if { $empty_p } { - ns_log Notice "subsite::parameter_changed -impl acs-mail-lite prefix: removing prefix $prefix" - db_dml remove_entry {} - } else { - ns_log Notice "subsite::parameter_changed -impl acs-mail-lite prefix: changing prefix $prefix to $value" - db_dml update_entry {} - } - } else { - if {!$empty_p} { - ns_log Notice "subsite::parameter_changed -impl acs-mail-lite prefix: creating new prefix $value for package_id $package_id" - db_dml insert_entry {} - } - } - } else { - ns_log Debug "subsite::parameter_changed -impl acs-mail-lite don't care about $parameter" - } -} Index: openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.xql 3 Dec 2006 13:23:24 -0000 1.3 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-callback-procs.xql 22 Dec 2006 07:57:43 -0000 1.4 @@ -19,30 +19,4 @@ - - - update acs_mail_lite_reply_prefixes set prefix = :value where - package_id = :package_id and impl_name = :package_key - - - - - - insert into acs_mail_lite_reply_prefixes (package_id,impl_name,prefix) - values (:package_id,:package_key,:value) - - - - - - delete from acs_mail_lite_reply_prefixes where package_id = :package_id - - - - - - select * from acs_mail_lite_reply_prefixes where package_id = :package_id - - - Index: openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl,v diff -u -r1.63 -r1.64 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 19 Dec 2006 10:51:50 -0000 1.63 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 22 Dec 2006 07:57:43 -0000 1.64 @@ -284,53 +284,9 @@ set email(from) [parse_email_address -email $email(from)] - # The whole code with the prefixes does not work and is actually not well through through I fear. - # This is why it is disabled in total and we rely on simple callback mechanisms instead + # We execute all callbacks now + callback acs_mail_lite::incoming_email -array email - if {1} { - - # We execute all callbacks now - callback acs_mail_lite::incoming_email -array email - - } else { - - set process_p 1 - - #check if we have several sites. In this case a site prefix is set - set site_prefix [get_parameter -name SitePrefix -default ""] - set package_prefix "" - - if {![empty_string_p $site_prefix]} { - regexp "($site_prefix)-(\[^-\]*)\?-(\[^@\]+)\@" $email(to) all site_prefix package_prefix rest - #we only process the email if both a site and package prefix was found - if {[empty_string_p $site_prefix] || [empty_string_p $package_prefix]} { - set process_p 0 - } - #no site prefix is set, so this is the only site - } else { - regexp "(\[^-\]*)-(\[^@\]+)\@" $email(to) all package_prefix rest - #we only process the email if a package prefix was found - if {[empty_string_p $package_prefix]} { - set process_p 0 - } - } - if {$process_p} { - - #check if an implementation exists for the package_prefix and call the callback - - if {[db_0or1row select_impl {}]} { - - ns_log Notice "load_mails: Prefix $prefix found. Calling callback implmentation $impl_name for package_id $package_id" - callback -impl $impl_name acs_mail_lite::incoming_email -array email -package_id $package_id - - } else { - ns_log Notice "load_mails: prefix not found. Doing nothing." - } - } else { - ns_log Error "load_mails: Either the SitePrefix setting was incorrect or not registered package prefix '$package_prefix'." - } - } - #let's delete the file now if {[catch {ns_unlink $msg} errmsg]} { ns_log Error "load_mails: unable to delete queued message $msg: $errmsg" Index: openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.xql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.xql 3 Dec 2006 13:23:24 -0000 1.12 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.xql 22 Dec 2006 07:57:43 -0000 1.13 @@ -135,11 +135,5 @@ - - - select * from acs_mail_lite_reply_prefixes where prefix = :package_prefix - - - Index: openacs-4/packages/acs-mail-lite/tcl/complex-send-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/Attic/complex-send-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-mail-lite/tcl/complex-send-procs-oracle.xql 17 Dec 2006 20:11:55 -0000 1.3 +++ openacs-4/packages/acs-mail-lite/tcl/complex-send-procs-oracle.xql 22 Dec 2006 07:57:43 -0000 1.4 @@ -6,7 +6,8 @@ insert into acs_mail_lite_complex_queue - (creation_date, + (id, + creation_date, locking_server, to_party_ids, cc_party_ids, @@ -34,7 +35,8 @@ use_sender_p ) values - (:creation_date, + (:acs_mail_lite_id_seq.nextval, + :creation_date, :locking_server, :to_party_ids, :cc_party_ids, Index: openacs-4/packages/acs-mail-lite/tcl/complex-send-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/Attic/complex-send-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-mail-lite/tcl/complex-send-procs-postgresql.xql 17 Dec 2006 20:11:55 -0000 1.2 +++ openacs-4/packages/acs-mail-lite/tcl/complex-send-procs-postgresql.xql 22 Dec 2006 07:57:43 -0000 1.3 @@ -6,7 +6,8 @@ insert into acs_mail_lite_complex_queue - (creation_date, + (id, + creation_date, locking_server, to_party_ids, cc_party_ids, @@ -34,7 +35,8 @@ use_sender_p ) values - (:creation_date, + (nextval('acs_mail_lite_id_seq'), + :creation_date, :locking_server, :to_party_ids, :cc_party_ids,