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 -r1.5 -r1.6 --- openacs-4/packages/notifications/tcl/notification-email-procs.tcl 9 Jul 2002 16:29:39 -0000 1.5 +++ openacs-4/packages/notifications/tcl/notification-email-procs.tcl 11 Jul 2002 04:53:02 -0000 1.6 @@ -32,7 +32,7 @@ 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 @@ -68,7 +68,6 @@ return [list $object_id $type_id] } - ad_proc -public send { to_user_id reply_object_id @@ -91,12 +90,12 @@ ad_proc -private load_qmail_mail_queue { {-queue_dir:required} } { - Scans qmail incoming email queue and queues up messages - using acs-mail. + Scans qmail incoming email queue and queues up messages + using acs-mail. @Author dan.wickstrom@openforce.net, ben@openforce @creation-date 22 Sept, 2001 - + @param queue_dir The location of the qmail mail queue in the file-system. } { @@ -109,7 +108,7 @@ set list_of_reply_ids [list] set new_messages_p 0 - + foreach msg $messages { ns_log Notice "opening file: $msg" if [catch {set f [open $msg r]}] { @@ -118,13 +117,13 @@ set file [read $f] close $f set file [split $file "\n"] - + set new_messages 1 set end_of_headers_p 0 set i 0 set line [lindex $file $i] set headers [list] - + # walk through the headers and extract each one while ![empty_string_p $line] { set next_line [lindex $file [expr $i + 1]] @@ -134,31 +133,31 @@ if {[regexp {^([^:]+):[ ]+(.+)$} $line match name value]} { # join headers that span more than one line (e.g. Received) if { ![regexp {^([^:]+):[ ]+(.+)$} $next_line match] && !$end_of_headers_p} { - append line $next_line - incr i + append line $next_line + incr i } lappend headers [string tolower $name] $value - + if {$end_of_headers_p} { - incr i - break + incr i + break } } else { # The headers and the body are delimited by a null line as specified by RFC822 if {[regexp {^[ ]*$} $line match]} { - incr i - break + incr i + break } } incr i - set line [lindex $file $i] + set line [lindex $file $i] } set body "\n[join [lrange $file $i end] "\n"]" - - # okay now we have a list of headers and the body, let's + + # okay now we have a list of headers and the body, let's # put it into notifications stuff array set email_headers $headers - + if [catch {set from $email_headers(from)}] { set from "" } @@ -180,7 +179,7 @@ } continue } - + set to_stuff [parse_reply_address -reply_address $to] # We don't accept a bad incoming email address @@ -202,15 +201,15 @@ -from_user $from_user \ -subject $email_headers(subject) \ -content $body] - - catch {ns_unlink $msg} + catch {ns_unlink $msg} + lappend list_of_reply_ids $reply_id } on_error { ns_log Error "Error inserting incoming email into the queue" } } - + return $list_of_reply_ids } Index: openacs-4/packages/notifications/tcl/sweep-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/sweep-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/notifications/tcl/sweep-procs.tcl 1 Jul 2002 19:35:30 -0000 1.7 +++ openacs-4/packages/notifications/tcl/sweep-procs.tcl 11 Jul 2002 04:53:02 -0000 1.8 @@ -120,7 +120,7 @@ # Send it notification::delivery::send -to_user_id [ns_set get $notif user_id] \ -notification_type_id [ns_set get $notif type_id] \ - -subject "\[[ad_system_name] - [ns_set get $notif object_name]\] [ns_set get $notif notif_subject]" \ + -subject "\[[ns_set get $notif object_name]\] [ns_set get $notif notif_subject]" \ -content [ns_set get $notif notif_text] \ -reply_object_id [ns_set get $notif response_id] \ -delivery_method_id [ns_set get $notif delivery_method_id]