Abyss web server - 628 Part V . Running Servers tmpfn =
628 Part V . Running Servers tmpfn = mktemp() tmpfh = open(tmpfn, w+b ) while True: rbuf = stdin.read(1024) if rbuf == : break tmpfh.write(rbuf) tmpfh.close() vscan = popen( %s –no-summary –stdout –infected –mbox %s % (CLAMSCAN, tmpfn), r ) while True: rbuf = vscan.readline() if rbuf == : break if rbuf.find( FOUND ): errors.append(rbuf[rbuf.find( : )+2:-1]) vscan.close() tmpfh = open(tmpfn, r ) if len(errors) > 0: while True: rbuf = tmpfh.readline() if rbuf == n : break stdout.write(rbuf) for e in errors: stdout.write( X-Virus-Alert: %s in messagen % e) stdout.write( n ) while True: rbuf = tmpfh.read(1024) if rbuf == : break stdout.write(rbuf) tmpfh.close() unlink(tmpfn) When called from maildrop to process a message, this program will save the message to a temporary file that it scans using clamscan (which is part of the ClamAV package). It then processes the output from clamscan to determine whether any viruses were found. Finally, it passes the message back to maildrop, including a X-Virus-Alert header (as appropriate), and removes the temporary file. 5. Set the permissions on clam-mailscan so that it can be executed by any user: # chmod 0755 /usr/local/sbin/clam-mailscan
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.