Index: openacs-4/packages/acs-mail/tcl/acs-mail-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail/tcl/acs-mail-init.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-mail/tcl/acs-mail-init.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-mail/tcl/acs-mail-init.tcl 25 Oct 2001 23:49:20 -0000 1.2 @@ -13,3 +13,32 @@ # Default interval is 15 minutes. ad_schedule_proc -thread t 900 acs_mail_process_queue + +ad_proc -private acs_mail_check_uuencode { } { + Check if ns_uuencode is properly encoding binary files +} { + + # expected result from ns_uuencode + set expected_result "H4sICHH01DsAA2p1bmsAS8zPKU4tKkstAgCaYWMDCQAAAA==" + + set file "[file dirname [info script]]/test-binary-file" + + # open the binary file + set fd [open $file r] + fconfigure $fd -encoding binary + set file_content [read $fd] + close $fd + + # encode it + set encoded_content [ns_uuencode $file_content] + + if { [string equal $encoded_content $expected_result] } { + nsv_set acs_mail ns_uuencode_works_p 1 + ns_log Notice "acs-mail: ns_uuencode works!!" + } else { + nsv_set acs_mail ns_uuencode_works_p 0 + ns_log Notice "acs-mail: ns_uuencode broken - will use the slow tcl version" + } +} + +acs_mail_check_uuencode