Bibhor asked: > Is it possible to automatically capture the attachment sent to an > email address before they are downloaded by the client program like > outlook? Once captured I would like to parse the content of the > attachment.
It depends on the mail server (MTA) you're using. For qmail, you could put the following in your tcpserver.smtp file: :allow,QMAILQUEUE="/var/qmail/bin/myscript" This assumes you've compiled qmail with the QMAILQUEUE patch, and that TCPServer is handling incoming connections. If so, all incoming messages will be piped to /var/qmail/bin/myscript, which can be a simple Bash script like this: #!/bin/bash out=/tmp/`date +%s`$$ cat > $out if [ -z "`grep 'evil stuff' $out`" ]; then cat $out > /var/qmail/bin/qmail-queue rm -f $out fi This creates a file with a unique filename (the date in seconds, plus a process ID) and checks whether the file contains "evil stuff". If not, the message is piped to qmail-queue, which delivers it. Otherwise the message isn't delivered, and you'll have a copy in /tmp. Obviously this is a quick hack, and I spent about three minutes designing it, so you can probably make it more robust. :) But the point is that it's possible to do all sorts of interesting things prior to mail delivery... HTH, Jeff
pgpN7UlLXHY4Q.pgp
Description: PGP signature
/* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
