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 -r1.108.2.31 -r1.108.2.32 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 2 Oct 2023 10:06:22 -0000 1.108.2.31 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 16 Jul 2024 17:11:03 -0000 1.108.2.32 @@ -184,7 +184,9 @@ # if FixedSenderEmail is not empty, # so as to be consistent for all cases calling this proc. + ns_log notice "SMTP call sendmessage <$originator>" set cmd [list smtp::sendmessage $multi_token -originator $originator] + ns_log notice "SMTP call sendmessage <$originator> DONE" foreach header $headers { lappend cmd -header $header } @@ -205,9 +207,10 @@ ns_log warning "acs-mail-lite::smtp: invalid parameter combination;\ when SMTPUser is specified, SMTPPassword has to be provided as well and vice versa" } + ns_log notice "SMTP call <$cmd>" ns_log Debug "send cmd: $cmd" - if {[catch $cmd errorMsg]} { + if {[catch $cmd errorMsg]} { ns_log Error "acs-mail-lite::smtp: error $errorMsg while executing\n$cmd" error $errorMsg } @@ -631,6 +634,7 @@ } } + ns_log notice "ORIGINATOR <$originator>" # Set the date set message_date [acs_mail_lite::utils::build_date] @@ -1005,7 +1009,7 @@ # If there is no domain configured, use the configured # hostname as domain name # - foreach driver {nsssl nssock_v4 nssock_v6 nssock} { + foreach driver [lmap d [ns_driver info] {dict get $d module}] { set section [ns_driversection -driver $driver] set configured_hostname [ns_config $section hostname] if {$configured_hostname ne ""} { Index: openacs-4/packages/acs-mail-lite/tcl/test/acs-mail-lite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/test/acs-mail-lite-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-mail-lite/tcl/test/acs-mail-lite-procs.tcl 24 Mar 2023 16:23:10 -0000 1.1.2.1 +++ openacs-4/packages/acs-mail-lite/tcl/test/acs-mail-lite-procs.tcl 16 Jul 2024 17:11:04 -0000 1.1.2.2 @@ -58,34 +58,46 @@ set subject {Test immediate subject} set body {Test immediate body} - aa_section "Immediate sending" + # + # We have currently no good way to check, whether the + # outgoing email server is configured properly. Therefore, + # we perform this test only, when the nssmptd module is + # loaded. In this case, we assume, it is configured. When + # mail is not configured, the test might fail in + # unpredictable ways, which are not necessarily related to + # the code. + # + if {[info commands ns_smtpd] ne ""} { - acs_mail_lite::send \ - -to_addr $to_addr \ - -from_addr $from_addr \ - -subject $subject \ - -body $body \ - -object_id $any_object_id \ - -send_immediately + acs_mail_lite::send \ + -to_addr $to_addr \ + -from_addr $from_addr \ + -subject $subject \ + -body $body \ + -object_id $any_object_id \ + -send_immediately - set recipient_id [dict get $recipient_info user_id] + set recipient_id [dict get $recipient_info user_id] - aa_false "Mail was NOT scheduled for sending" [db_0or1row check_scheduled { - select 1 from acs_mail_lite_queue - where object_id = :any_object_id - and to_addr = :to_addr - and from_addr = :from_addr - and subject = :subject - and body = :body - }] + aa_false "Mail was NOT scheduled for sending" [db_0or1row check_scheduled { + select 1 from acs_mail_lite_queue + where object_id = :any_object_id + and to_addr = :to_addr + and from_addr = :from_addr + and subject = :subject + and body = :body + }] - aa_true "A unique id was assigned to the message" [db_0or1row check_id { - select 1 from acs_mail_lite_send_msg_id_map - where object_id = :any_object_id - and package_id = :package_id - and party_id = :recipient_id - }] + aa_true "A unique id was assigned to the message" [db_0or1row check_id { + select 1 from acs_mail_lite_send_msg_id_map + where object_id = :any_object_id + and package_id = :package_id + and party_id = :recipient_id + }] + } else { + aa_log "Test skipped, since 'ns_smtpd' is not configured" + } } -teardown_code { parameter::set_value \ Index: openacs-4/packages/acs-mail-lite/tcl/test/email-inbound-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/test/email-inbound-procs.tcl,v diff -u -r1.7.2.13 -r1.7.2.14 --- openacs-4/packages/acs-mail-lite/tcl/test/email-inbound-procs.tcl 29 Aug 2022 14:17:23 -0000 1.7.2.13 +++ openacs-4/packages/acs-mail-lite/tcl/test/email-inbound-procs.tcl 16 Jul 2024 17:11:04 -0000 1.7.2.14 @@ -357,7 +357,7 @@ } else { set within_limits_p 0 } - aa_true "r276: prioirty for case '${j}' '0' < \ + aa_true "r276: priority for case '${j}' '0' < \ '$p_arr(${j})' < '${p_min}' is within limits." $within_limits_p }