procmail
[Top] [All Lists]

Re: interface between programs and mail

2007-05-23 10:26:16
Chirag Ravishankar wrote:

How does the interface between mail and a program work. For example, 
if I filter mail through spamassassin by using the command 
/usr/sbin/spamc how does that executable take the mail and scan it for 
spam? Is it written in C code? If I want to write my own program for 
example taking the image attached and adding a frame to it, how should 
I write the interface with the email??

Mail filter programs communicate with procmail through stdin and stdout, 
for example spamc reads all mail from stdin, adds its headers, then 
writes out the message to stdout again.  The language of the filter 
program does not matter, this can be any executable including shell 
scripts, sed/awk/Perl scripts (there are pretty good libraries for 
handling various aspects of email headers available in Perl), compiled 
programs written in C/C++, anything your server can execute.

-- 
Klaus Johannes Rusch
KlausRusch(_at_)atmedia(_dot_)net
http://www.atmedia.net/KlausRusch/


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>