Index: openacs.org-dev/packages/notifications/tcl/notification-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/notifications/tcl/notification-email-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs.org-dev/packages/notifications/tcl/notification-email-procs.tcl 12 Feb 2003 13:18:07 -0000 1.6 +++ openacs.org-dev/packages/notifications/tcl/notification-email-procs.tcl 13 Feb 2003 02:08:42 -0000 1.7 @@ -72,6 +72,21 @@ return [list $object_id $type_id] } + ad_proc -public bounce_address_prefix {} { + return [get_parameter -name "EmailBounceAddressPrefix"] + } + + ad_proc -public bounce_address { + {-object_id:required} + {-type_id:required} + } { + if {[empty_string_p $object_id] || [empty_string_p $type_id]} { + return "[address_domain] mailer <[bounce_address_prefix]@[address_domain]>" + } else { + return "[address_domain] mailer <[bounce_address_prefix]-$object_id-$type_id@[address_domain]>" + } + } + ad_proc -public send { to_user_id reply_object_id @@ -94,12 +109,17 @@ set from_email [reply_address -object_id $reply_object_id -type_id $notification_type_id] } - # Set the reply to address to the address of the mailer. + # Set the Reply-To and Mail-Followup-To addresses to the + # address of the notifications handler. set extra_headers [ns_set new] - ns_set put $extra_headers Reply-To [reply_address -object_id $reply_object_id -type_id $notification_type_id] - ns_set put $extra_headers Precedence bulk - ns_set put $extra_headers Sender "notifications-admin@openacs.org" + set reply_to [reply_address -object_id $reply_object_id -type_id $notification_type_id] + ns_set put $extra_headers Reply-To $reply_to + ns_set put $extra_headers Mail-Followup-To $reply_to + # Set the Envelope address to the address where bounce + # messages should go. + ns_set put $extra_headers Envelope [bounce_address -object_id $reply_object_id -type_id $notification_type_id] + acs_mail_lite::send \ -to_addr $email \ -from_addr $from_email \