Index: openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-init.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-init.tcl 17 Nov 2006 15:14:57 -0000 1.8 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-init.tcl 18 Apr 2007 09:13:54 -0000 1.9 @@ -15,12 +15,12 @@ set queue_dir [parameter::get_from_package_key -parameter "BounceMailDir" -package_key "acs-mail-lite"] -ad_schedule_proc -thread t 120 acs_mail_lite::load_mails -queue_dir $queue_dir +# ad_schedule_proc -thread t 120 acs_mail_lite::load_mails -queue_dir $queue_dir # check every few minutes for bounces #ad_schedule_proc -thread t [acs_mail_lite::get_parameter -name BounceScanQueue -default 120] acs_mail_lite::scan_replies nsv_set acs_mail_lite send_mails_p 0 nsv_set acs_mail_lite check_bounce_p 0 -ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 25] acs_mail_lite::check_bounces +# ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 25] acs_mail_lite::check_bounces 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.68 -r1.69 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 8 Apr 2007 08:12:51 -0000 1.68 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 18 Apr 2007 09:13:54 -0000 1.69 @@ -465,7 +465,7 @@ @option bcc see to_addr @option package_id To be used for calling a package-specific proc when mail has bounced @option no_callback_p Boolean that indicates if callback should be executed or not. If you don't provide it it will execute callbacks - @returns the Message-Id of the mail + @returns the Message-Id of the mail or an empty string if e-mail was discarded } { ## Extract "from" email address @@ -514,26 +514,29 @@ set send_p [parameter::get -package_id [get_package_id] -parameter "send_immediately" -default 0] } - - # if send_p true, then start acs_mail_lite::send_immediately, so mail is not stored in the db before delivery - if { $send_p } { - acs_mail_lite::send_immediately -to_addr $to_addr -from_addr $from_addr -subject $subject -body $body -extraheaders $eh_list -bcc $bcc -valid_email_p $valid_email_p -package_id $package_id + if {$to_addr ne ""} { + # if send_p true, then start acs_mail_lite::send_immediately, so mail is not stored in the db before delivery + if { $send_p } { + acs_mail_lite::send_immediately -to_addr $to_addr -from_addr $from_addr -subject $subject -body $body -extraheaders $eh_list -bcc $bcc -valid_email_p $valid_email_p -package_id $package_id + } else { + # else, store it in the db and let the sweeper deliver the mail + db_dml create_queue_entry {} + } + + if { !$no_callback_p } { + callback acs_mail_lite::send \ + -package_id $package_id \ + -from_party_id $from_party_id \ + -to_party_id $to_party_id \ + -body $body \ + -message_id $message_id \ + -subject $subject + } + + return $message_id } else { - # else, store it in the db and let the sweeper deliver the mail - db_dml create_queue_entry {} + return "" } - - if { !$no_callback_p } { - callback acs_mail_lite::send \ - -package_id $package_id \ - -from_party_id $from_party_id \ - -to_party_id $to_party_id \ - -body $body \ - -message_id $message_id \ - -subject $subject - } - - return $message_id }