On 08/03/2004, George Georgalis wrote:
> I actually new about mktemp (though not the problems on other
> platforms...) but did it my lazy way because I intended to not even use
> tmp files in the final version. unfortunately, never worked that method
> out and should have fixed my insecure temp file method before posting!

I sorta guessed you used the tmp file as a debugging aid from the
script, but thought I'd post just in case people picked up the script.

> Maybe a better way would just use the spam maildir/tmp/ directory and
> safecat move to spam maildir/new/ or unlink if it was spam or not... is
> there any problems with using mktemp filenames in maildir directories?

I think qmail tries again (with a different filename) if it gets a
clash with a filename in the Maildir/tmp directory so using temp files
in this directory should be fine.

I tend to use a tmp directory in my .tmda subdirectory. This way I can
do the "(umask 077; mkdir blah.$RANDOM.$RANDOM.$PPID)|| exit 0" trick
to create a directory within this directory and then use any temp
files I like within that directory (I think $RANDOM only works in
bash.) You can then safecat it from there.

Marcus

-- 
Marcus Williams -- http://www.quintic.co.uk
Quintic Ltd, 39 Newnham Road, Cambridge, UK
  This message is private [ ] public [*]

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to