Clamdmail

Version 0.19

October 5, 2006


Algorithm

Grab configuration from env variables and qmail config files
Create temp files
Get message from fd0 and save it to a file
Get envelope addresses from fd1 and save them to a file
If (greylist)
 	Fork and run greylist
	If (greylist returns non-0)
		Exit with a soft-failure error code
Fork and run ripmime to decode the attachment(s)
Fork and run clamdscan on the directory
If (clamdscan returns non-0)
	Exit with a hard-failure error code
If (spamassassin)
	Fork and launch spamc
	Attach spamc's stdout to fd0
	Forward the message to spamc
Else
	Attach the message to fd0
Attach the address temp file to fd1
Fork qmail-queue
Delete the temp directory
Exit with the same code as our mail queue