[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mail message filter for zmailer?



I know about the intercept function in crossbar.cf with it's drop, file
and error "functions".. but would it be possible to add a filter function
to zmailer??

Basically I need to be able to 'rewrite' ANY incoming/outgoing headers and
possibly scan a message for specific contents (ie uuencoded/mime
attachments and decode them and test for a virus).. what I am thinking is the
following:

 filterfunction(from,to)
   addressmatch) result = $(filter /path/to/filter/script, arg1, arg2.. argN)
		 case "$result" in
		   VIRUSFOUND: $(error virus)
				;;
		   HEADERREWRITE: mail message in arg1 (path to the new
			          message with the new headers) back into
				  zmailer
				;;
		 esac

 the filter takes the entire text of the incoming message and can be any
type of program that you like, C, sh, csh, perl etc.. It reads from stdin
until EOF is hit. This is the headers and body of the incoming message.
Headers and body are seperated by the first blank line in the message.
The filter returns a string stating a condition to be searched for by zmailer.
In the case above, the filter would return either the string "VIRUSFOUND" or
"HEADERREWRITE"

  You should be able to get the idea of what I am trying to do. Can this be
done? It would add ALOT of functionality to zmailer. Which is already a great
system.

--
 Name:Trevor Paquette      |Alberta Energy Company Ltd |Work:(403) 266-8400
Email:TrevorPaquette@aec.ca|3900, 421 7th Ave S.W.     | Fax:(403) 290-8400
      postmaster@aec.ca    |Calgary, Alberta, Canada   |ICBM:51'05"N/114'01"W
      root@aec.ca          |T2P 4K9                    |Mind:In the Rockies..