Peter Eisch wrote:
When the plugin was changed to use the qpsmtp transaction temp file, this
broke the tmp_dir option. The patch below fixes this bug and allows the
files to be scanned to be written outside ~smtpd/tmp.
I'm inlined not to apply this code as it, because we made a deliberate
decision not to use File::Temp in the main code.
There are two distinct reasons to use something like File::Temp:
1) provide a globally unique filename;
2) provide a filename that is not predictable (to prevent hacking);
3) automatically delete temporary files (which you don't even use).
The existing Qpsmtpd::temp_file() and Qpsmtpd::temp_dir() code handles
#1 just fine, but we decided that #2 wasn't important (since the temp
files here are very short-lived and are never executed).
How about we change temp_file() to accept a second parameter (path) and
merely default to spool_dir() if path is not given? That way, the
clamav plugin could use the existing temp_file() code in another path
(tmp_dir) if needed.
John