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 -N -r1.75 -r1.76 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 9 Jan 2008 12:45:24 -0000 1.75 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 11 Jan 2008 11:10:40 -0000 1.76 @@ -13,6 +13,25 @@ package require base64 2.3.1 namespace eval acs_mail_lite { + #--------------------------------------- + ad_proc -deprecated deliver_mail {} { + + Deprecated (11-jan-2008). + Use acs_mail_lite::send instead + + } { + ns_log Warning "acs_mail_lite::deliver_mail is deprecated. Use acs_mail_lite::send instead" + } + + ad_proc -private -deprecated sendmail {} { + + Deprecated (11-jan-2008). + Use acs_mail_lite::smtp instead + + } { + ns_log Warning "acs_mail_lite::sendmail is deprecated. Use acs_mail_lite::smtp instead" + } + ad_proc -public get_package_id {} { @returns package_id of this package } { @@ -113,83 +132,6 @@ } #--------------------------------------- - ad_proc -public deliver_mail { - -to_addr:required - -from_addr:required - -subject:required - -body:required - {-extraheaders ""} - {-bcc ""} - {-valid_email_p 0} - -package_id:required - } { - Bounce Manager send - @option to_addr list of mail recipients - @option from_addr mail sender - @option subject mail subject - @option body mail body - @option extraheaders extra mail header - @option bcc list of recipients of a mail copy - @option valid_email_p flag if email needs to be checked if it's bouncing or - if calling code already made sure that the receiving email addresses - are not bouncing (this increases performance if mails are send in a batch process) - @option package_id package_id of the sending package - (needed to call package-specific code to deal with bounces) - } { - set msg "Subject: $subject\nDate: [ns_httptime [ns_time]]" - - array set headers $extraheaders - set message_id $headers(Message-Id) - - foreach {key value} $extraheaders { - append msg "\n$key\: $value" - } - - ## Blank line between headers and body - append msg "\n\n$body\n" - - # ---------------------------------------------------- - # Rollout support - # ---------------------------------------------------- - # if set in etc/config.tcl, then - # packages/acs-tcl/tcl/rollout-email-procs.tcl will rename a - # proc to ns_sendmail. So we simply call ns_sendmail instead - # of the sendmail bin if the EmailDeliveryMode parameter is - # set to anything other than default - JFR - #----------------------------------------------------- - set delivery_mode [ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailDeliveryMode] - - if {$delivery_mode ne "" - && $delivery_mode ne "default" - } { - # The to_addr has been put in an array, and returned. Now - # it is of the form: email email_address name namefromdb - # user_id user_id_if_present_or_empty_string - set to_address "[lindex $to_addr 1] ([lindex $to_addr 3])" - set eh [util_list_to_ns_set $extraheaders] - ns_sendmail $to_address $from_addr $subject $body $eh $bcc - } else { - - ## Terminate body with a solitary period - foreach line [split $msg "\n"] { - if {"." eq [string trim $line]} { - append data . - } - #AG: ensure no \r\r\n terminations. - set trimmed_line [string trimright $line \r] - append data "$trimmed_line\r\n" - } - append data . - - smtp -from_addr $from_addr -sendlist $to_addr -msg $data -valid_email_p $valid_email_p -message_id $message_id -package_id $package_id - if {$bcc ne ""} { - smtp -from_addr $from_addr -sendlist $bcc -msg $data -valid_email_p $valid_email_p -message_id $message_id -package_id $package_id - } - - } - } - - #--------------------------------------- ad_proc -private smtp { -multi_token:required -headers:required Index: openacs-4/packages/acs-mail-lite/tcl/complex-send-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/Attic/complex-send-procs.tcl,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-mail-lite/tcl/complex-send-procs.tcl 9 Jan 2008 14:31:55 -0000 1.23 +++ openacs-4/packages/acs-mail-lite/tcl/complex-send-procs.tcl 11 Jan 2008 11:10:40 -0000 1.24 @@ -553,7 +553,7 @@ } - acs_mail_lite::complex_smtp -multi_token $multi_token \ + acs_mail_lite::smtp -multi_token $multi_token \ -headers [list [list From "$from_string"] [list Reply-To "$reply_to_string"] \ [list To "[join $to_list ","]"] [list CC "[join $cc_list ","]"]] @@ -595,7 +595,7 @@ if {[acs_mail_lite::utils::valid_email_p $email]} { - acs_mail_lite::complex_smtp -multi_token $multi_token \ + acs_mail_lite::smtp -multi_token $multi_token \ -headers [list [list From "$from_string"] [list Reply-To "$reply_to_string"] [list To "$email"]] if { !$no_callback_p } { callback acs_mail_lite::complex_send \ @@ -622,7 +622,7 @@ if {[acs_mail_lite::utils::valid_email_p -email $email]} { set email "\"[party::name -party_id $party]\" <$email>" - acs_mail_lite::complex_smtp -multi_token $multi_token \ + acs_mail_lite::smtp -multi_token $multi_token \ -headers [list [list From "$from_string"] [list Reply-To "$reply_to_string"] [list To "$email"]] if { !$no_callback_p } { @@ -712,48 +712,4 @@ } } - ad_proc -private complex_smtp { - -multi_token:required - -headers:required - } { - Send messages via SMTP - - @param multi_token Multi Token generated which is passed directly to smtp::sendmessage - @param headers List of list of header key-value pairs like {{from malte@cognovis.de} {to malte@cognovis.de}} - } { - - set mail_package_id [apm_package_id_from_key "acs-mail-lite"] - - # Get the SMTP Parameters - set smtp [parameter::get -parameter "SMTPHost" \ - -package_id $mail_package_id -default [ns_config ns/parameters mailhost]] - if {$smtp eq ""} { - set smtp localhost - } - - set timeout [parameter::get -parameter "SMTPTimeout" \ - -package_id $mail_package_id -default [ns_config ns/parameters smtptimeout]] - if {$timeout eq ""} { - set timeout 60 - } - - set smtpport [parameter::get -parameter "SMTPPort" \ - -package_id $mail_package_id -default 25] - - set smtpuser [parameter::get -parameter "SMTPUser" \ - -package_id $mail_package_id] - - set smtppassword [parameter::get -parameter "SMTPPassword" \ - -package_id $mail_package_id] - - set cmd_string "smtp::sendmessage $multi_token" - foreach header $headers { - append cmd_string " -header {$header}" - } - append cmd_string " -servers $smtp -ports $smtpport -username $smtpuser -password $smtppassword" - ns_log Debug "complex-send cmd_string: $cmd_string" - eval $cmd_string - - } - }