Index: openacs-4/packages/notifications/notifications.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/notifications.info,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/notifications/notifications.info 25 Jun 2002 18:45:40 -0000 1.6 +++ openacs-4/packages/notifications/notifications.info 28 Jun 2002 20:21:50 -0000 1.7 @@ -20,6 +20,9 @@ + + + @@ -36,8 +39,10 @@ + + @@ -52,7 +57,9 @@ + + Index: openacs-4/packages/notifications/sql/oracle/notifications-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/notifications/sql/oracle/notifications-create.sql 25 Jun 2002 20:23:32 -0000 1.5 +++ openacs-4/packages/notifications/sql/oracle/notifications-create.sql 28 Jun 2002 20:21:50 -0000 1.6 @@ -12,10 +12,15 @@ @ notifications-core-create.sql @ notifications-package-create.sql +-- replies +@ notifications-replies-create.sql +@ notifications-replies-package-create.sql + -- the service contracts will eventually be created -- @ notifications-interval-sc-create.sql -- @ notifications-delivery-sc-create.sql +@ notification-type-sc-create.sql @ delivery-method-sc-create.sql @ notifications-init.sql @ email-sc-impl-create.sql Index: openacs-4/packages/notifications/tcl/delivery-method-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/delivery-method-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/notifications/tcl/delivery-method-procs.tcl 25 Jun 2002 18:58:06 -0000 1.2 +++ openacs-4/packages/notifications/tcl/delivery-method-procs.tcl 28 Jun 2002 20:21:50 -0000 1.3 @@ -45,7 +45,7 @@ set impl_key [get_impl_key -delivery_method_id $delivery_method_id] # Prepare the arguments - set args [list $to_user_id $reply_object_id $subject $content] + set args [list] ns_log Notice "NOTIF-DELIV-METHOD: about to call acs_sc on $impl_key" Index: openacs-4/packages/notifications/tcl/delivery-method-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/delivery-method-procs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/notifications/tcl/delivery-method-procs.xql 25 Jun 2002 18:58:40 -0000 1.1 +++ openacs-4/packages/notifications/tcl/delivery-method-procs.xql 28 Jun 2002 20:21:50 -0000 1.2 @@ -5,7 +5,7 @@ select impl_name from acs_sc_impls, notification_delivery_methods -where acs_sc_impls.impl_id = notification_delivery_methods.impl_id +where acs_sc_impls.impl_id = notification_delivery_methods.sc_impl_id and delivery_method_id= :delivery_method_id Index: openacs-4/packages/notifications/tcl/notification-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-email-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/notifications/tcl/notification-email-procs.tcl 25 Jun 2002 18:58:40 -0000 1.1 +++ openacs-4/packages/notifications/tcl/notification-email-procs.tcl 28 Jun 2002 20:21:50 -0000 1.2 @@ -14,6 +14,14 @@ return "ny03.openforce.net" } + ad_proc -private parse_email_address {email} { + if {![regexp {<([^>]*)>} $email all clean_email]} { + return $email + } else { + return $clean_email + } + } + ad_proc -public reply_address { {-object_id:required} {-type_id:required} @@ -55,7 +63,7 @@ } ad_proc -private qmail_mail_queue_dir {} { - return "" + return "/home/oracle/queues/forums" } ad_proc -private load_qmail_mail_queue { @@ -75,7 +83,7 @@ return [list] } - set mail_link_ids [list] + set list_of_reply_ids [list] set new_messages_p 0 foreach msg $messages { @@ -133,21 +141,29 @@ if [catch {set to $email_headers(to)}] { set to "" } + + set from [parse_email_address $from] # Find the from user set from_user [cc_lookup_email_user $from] # We don't accept empty users for now if {[empty_string_p $from_user]} { ns_log Notice "NOTIF-INCOMING-EMAIL: no user $from" + if {[catch {ns_unlink $msg} errmsg]} { + ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message" + } continue } - set to_stuff [notification::reply::parse_reply_address -reply_address $to] + set to_stuff [parse_reply_address -reply_address $to] # We don't accept a bad incoming email address if {[empty_string_p $to_stuff]} { ns_log Notice "NOTIF-INCOMING-EMAIL: bad to address $to" + if {[catch {ns_unlink $msg} errmsg]} { + ns_log Notice "NOTIF-INCOMING-EMAIL: couldn't remove message" + } continue } @@ -163,6 +179,8 @@ -content $body] catch {ns_unlink $msg} + + lappend list_of_reply_ids $reply_id } on_error { ns_log Error "Error inserting incoming email into the queue" } Index: openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql 25 Jun 2002 18:58:06 -0000 1.5 +++ openacs-4/packages/notifications/tcl/sweep-procs-oracle.xql 28 Jun 2002 20:21:50 -0000 1.6 @@ -25,7 +25,7 @@ notif_text, notif_html, notification_requests.user_id, - type_id, + notification_requests.type_id, acs_object.name(notifications.object_id) as object_name from notifications, notification_requests,