Index: openacs-4/packages/notifications/notifications.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/notifications.info,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/notifications/notifications.info 29 Jun 2002 00:21:11 -0000 1.8 +++ openacs-4/packages/notifications/notifications.info 9 Jul 2002 16:29:39 -0000 1.9 @@ -73,7 +73,9 @@ - + + + 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.3 -r1.4 --- openacs-4/packages/notifications/tcl/delivery-method-procs.tcl 28 Jun 2002 20:21:50 -0000 1.3 +++ openacs-4/packages/notifications/tcl/delivery-method-procs.tcl 9 Jul 2002 16:29:39 -0000 1.4 @@ -47,7 +47,7 @@ # Prepare the arguments set args [list] - ns_log Notice "NOTIF-DELIV-METHOD: about to call acs_sc on $impl_key" + # ns_log Notice "NOTIF-DELIV-METHOD: about to call acs_sc on $impl_key" # Make the generic call return [acs_sc_call NotificationDeliveryMethod ScanReplies $args $impl_key] Index: openacs-4/packages/notifications/tcl/notification-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-display-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/notifications/tcl/notification-display-procs.tcl 30 May 2002 06:26:09 -0000 1.2 +++ openacs-4/packages/notifications/tcl/notification-display-procs.tcl 9 Jul 2002 16:29:39 -0000 1.3 @@ -15,10 +15,13 @@ {-object_id:required} {-pretty_name:required} {-url:required} + {-user_id ""} } { Produce a widget for requesting notifications } { - set user_id [ad_conn user_id] + if {[empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } # Get the type id set type_id [notification::type::get_type_id -short_name $type] 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.4 -r1.5 --- openacs-4/packages/notifications/tcl/notification-email-procs.tcl 1 Jul 2002 19:35:30 -0000 1.4 +++ openacs-4/packages/notifications/tcl/notification-email-procs.tcl 9 Jul 2002 16:29:39 -0000 1.5 @@ -10,10 +10,29 @@ namespace eval notification::email { + ad_proc -public get_package_id {} { + return [apm_package_id_from_key notifications] + } + + ad_proc -public get_parameter { + {-name:required} + {-default ""} + } { + return [parameter::get -package_id [get_package_id] -parameter $name -default $default] + } + ad_proc -public address_domain {} { - return "ny03.openforce.net" + return [get_parameter -name "EmailDomain"] } + ad_proc -public reply_address_prefix {} { + return [get_parameter -name "EmailReplyAddressPrefix"] + } + + ad_proc -private qmail_mail_queue_dir {} { + return [get_parameter -name "EmailQmailQueue"] + } + ad_proc -private parse_email_address {email} { if {![regexp {<([^>]*)>} $email all clean_email]} { return $email @@ -27,9 +46,9 @@ {-type_id:required} } { if {[empty_string_p $object_id] || [empty_string_p $type_id]} { - return "notification" + return [reply_address_prefix] } else { - return "notification-$object_id-$type_id@[address_domain]" + return "[reply_address_prefix]-$object_id-$type_id@[address_domain]" } } @@ -38,8 +57,11 @@ } { This takes a reply address, checks it for consistency, and returns a list of object_id and type_id } { + # The pattern to match + set regexp_str "^[reply_address_prefix]-(\[0-9\]*)-(\[0-9\]*)\@" + # Check the format and extract type_id and object_id at the same time - if {![regexp {^notification-([0-9]*)-([0-9]*)@} $reply_address all object_id type_id]} { + if {![regexp $regexp_str $reply_address all object_id type_id]} { return "" } @@ -66,10 +88,6 @@ -body $content } - ad_proc -private qmail_mail_queue_dir {} { - return "/home/oracle/queues/forums" - } - ad_proc -private load_qmail_mail_queue { {-queue_dir:required} } {