You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Steve <st...@browsermedia.com> on 2003/06/16 21:43:24 UTC

Reading and writing X-header fields

I am writing an application in which I need to track messages (long-story-short). I have noted applications - such as spam applications - that create "Extended" headers such "X-Spam-Status: Yes". I would like to create a mailet which reads and writes these headers. 

I have done some reading on creating mailets as well as the javamail API, but no practical experience....yet: 
In my mailet, would I use Mail.getMessage().getHeader(myHeaderName)[0]? 
Can I do a Mail.getMessage().removeHeader(myHeaderName) and then Mail.getMessage.setHeader(myHeaderName) to accomplish an update? 
Or is the javamail route a red-herring?

I remember a post not long ago when someone asked about these headers. I cannot find the posting at mail-archive.com nor my local inbox archive, so I apologize for this is repeated question; Does the Mailet API provide a means to read and write these extended headers?

TIA,

Steve B.

RE: Reading and writing X-header fields

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Where are the AddHeader mailet and HasHeader matcher located?

http://cvs.apache.org/viewcvs.cgi/jakarta-james/src/java/org/apache/james/tr
ansport/mailets/
http://cvs.apache.org/viewcvs.cgi/jakarta-james/src/java/org/apache/james/tr
ansport/matchers/



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Reading and writing X-header fields

Posted by Steve <st...@browsermedia.com>.
Where are the AddHeader mailet and HasHeader matcher located? I am searching
james cvs and cannot find them.

Steve B.

----- Original Message -----
From: "Hontvari Jozsef" <ho...@solware.com>
To: "James Users List" <ja...@jakarta.apache.org>; <sb...@synsys.com>
Sent: Monday, June 16, 2003 4:08 PM
Subject: Re: Reading and writing X-header fields


> ... and the AddHeader mailet and HasHeader matcher
>
> ----- Original Message -----
> From: "Steve Brewin" <sb...@synsys.com>
> To: "'James Users List'" <ja...@jakarta.apache.org>
> Sent: Monday, June 16, 2003 9:59 PM
> Subject: RE: Reading and writing X-header fields
>
>
> > Look at the code for fetchpop or fetchmail to see how these do it.
> >
> > -- Steve
> >
> > > -----Original Message-----
> > > From: Steve [mailto:steve@browsermedia.com]
> > > Sent: 16 June 2003 20:43
> > > To: james-user
> > > Subject: Reading and writing X-header fields
> > >
> > >
> > > I am writing an application in which I need to track messages
> > > (long-story-short). I have noted applications - such as spam
> > > applications - that create "Extended" headers such
> > > "X-Spam-Status: Yes". I would like to create a mailet which
> > > reads and writes these headers.
> > >
> > > I have done some reading on creating mailets as well as the
> > > javamail API, but no practical experience....yet:
> > > In my mailet, would I use
> > > Mail.getMessage().getHeader(myHeaderName)[0]?
> > > Can I do a Mail.getMessage().removeHeader(myHeaderName) and
> > > then Mail.getMessage.setHeader(myHeaderName) to accomplish an update?
> > > Or is the javamail route a red-herring?
> > >
> > > I remember a post not long ago when someone asked about these
> > > headers. I cannot find the posting at mail-archive.com nor my
> > > local inbox archive, so I apologize for this is repeated
> > > question; Does the Mailet API provide a means to read and
> > > write these extended headers?
> > >
> > > TIA,
> > >
> > > Steve B.
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Reading and writing X-header fields

Posted by Hontvari Jozsef <ho...@solware.com>.
... and the AddHeader mailet and HasHeader matcher

----- Original Message ----- 
From: "Steve Brewin" <sb...@synsys.com>
To: "'James Users List'" <ja...@jakarta.apache.org>
Sent: Monday, June 16, 2003 9:59 PM
Subject: RE: Reading and writing X-header fields


> Look at the code for fetchpop or fetchmail to see how these do it.
> 
> -- Steve
> 
> > -----Original Message-----
> > From: Steve [mailto:steve@browsermedia.com]
> > Sent: 16 June 2003 20:43
> > To: james-user
> > Subject: Reading and writing X-header fields
> > 
> > 
> > I am writing an application in which I need to track messages 
> > (long-story-short). I have noted applications - such as spam 
> > applications - that create "Extended" headers such 
> > "X-Spam-Status: Yes". I would like to create a mailet which 
> > reads and writes these headers. 
> > 
> > I have done some reading on creating mailets as well as the 
> > javamail API, but no practical experience....yet: 
> > In my mailet, would I use 
> > Mail.getMessage().getHeader(myHeaderName)[0]? 
> > Can I do a Mail.getMessage().removeHeader(myHeaderName) and 
> > then Mail.getMessage.setHeader(myHeaderName) to accomplish an update? 
> > Or is the javamail route a red-herring?
> > 
> > I remember a post not long ago when someone asked about these 
> > headers. I cannot find the posting at mail-archive.com nor my 
> > local inbox archive, so I apologize for this is repeated 
> > question; Does the Mailet API provide a means to read and 
> > write these extended headers?
> > 
> > TIA,
> > 
> > Steve B.
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Reading and writing X-header fields

Posted by Steve Brewin <sb...@synsys.com>.
Look at the code for fetchpop or fetchmail to see how these do it.

-- Steve

> -----Original Message-----
> From: Steve [mailto:steve@browsermedia.com]
> Sent: 16 June 2003 20:43
> To: james-user
> Subject: Reading and writing X-header fields
> 
> 
> I am writing an application in which I need to track messages 
> (long-story-short). I have noted applications - such as spam 
> applications - that create "Extended" headers such 
> "X-Spam-Status: Yes". I would like to create a mailet which 
> reads and writes these headers. 
> 
> I have done some reading on creating mailets as well as the 
> javamail API, but no practical experience....yet: 
> In my mailet, would I use 
> Mail.getMessage().getHeader(myHeaderName)[0]? 
> Can I do a Mail.getMessage().removeHeader(myHeaderName) and 
> then Mail.getMessage.setHeader(myHeaderName) to accomplish an update? 
> Or is the javamail route a red-herring?
> 
> I remember a post not long ago when someone asked about these 
> headers. I cannot find the posting at mail-archive.com nor my 
> local inbox archive, so I apologize for this is repeated 
> question; Does the Mailet API provide a means to read and 
> write these extended headers?
> 
> TIA,
> 
> Steve B.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org