Martin Gregorie-2 wrote:
> 
> How are you assembling the message? About the best you can do is to grab
> it as a text string when the message is ready to be sent to the mail
> server. At thius point it should contain the headers your program has
> added and the assembled MIME format body, The string can then be written
> to spamc's stdin and its output read from stdout. Run spamc with the -R
> option: this will cause it to output a formatted report about the
> message preceeded with a line reading n/m (n=score, m=spam threshhold).
> 
> If your mail client is written in Java you're probably using JavaMail.
> In this case the message will probably have been assembled in a
> MimeMessage object. When that's complete, i.e. just before you call the
> Transport.send() method to send the message, call
> MimeMessage.writeTo(OutputStream) and copy everything read from the
> OutputStream to spamc's stdin as described above.
> 

Hi Martin,

Your recommended/suggested solution of assembly message exactly meets my use
case requirement. Thanks for letting me know the existence of the method
MimeMessage.writeTo(OutputStream).  That's great!  Thanks once again for
that valuable solution.

Regards,
Gnanam
-- 
View this message in context: 
http://old.nabble.com/SpamAssassin-Integration-tp28903365p28922585.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.

Reply via email to