[rt-devel] RT3: mail UTF-8 automatic conversion and GPG verification

Jesse Vincent jesse at bestpractical.com
Mon Aug 18 02:41:33 EDT 2003



On Fri, Aug 15, 2003 at 06:42:32PM +0200, Guillaume Perral wrote:
> Le Vendredi 15 Août 2003 08:35, Autrijus Tang a écrit :
> > On Thu, Aug 14, 2003 at 06:29:38PM -0400, Jesse Vincent wrote:
> > > It might result in butchered user-names in creation. But that could be
> > > compensated for. I'd like autrijus input on this potential change. It
> > > sounds the most reasonable
> >
> > How about seeing if $Transaction->ContentObj->OriginalContent works?
> 
> Well, the "call stack" looks like this when I make the GPG check (from inner 
> to outer) :
> 
> 	GetCurrentUser() from RT::Interface::Email::Auth::GnuPG,
> 	Gateway() from RT::Interface::Email,
> 	Mason component /REST/1.O/NoAuth/mail-gateway
> 
> At this time, there isn't any existing Transaction.

It also wouldn't work, as you need to preserve the mime object.

> But I managed to make it working, by postponing body parts conversion. Here's 
> a summary of changes :
> 
> - in RT::EmailParser, I redefined _PostProcessNewEntity() to convert and 
> unfold only *main* headers. I'm hoping this will avoid getting butchered 
> user-names from other mail plug-ins, though it will not mess with signature 
> verification as main mail headers couldn't be (and thus aren't) signed.

do you then go and clean up headers later on?

> - in RT::Interface::Email, I redefined Gateway (sig!) to do the UTF-8 
> conversion just after authentication (does it fail or pass). (I also changed 
> a bit the way AuthStat and CurrentUser are assigned from plug-in return 
> values).

What did you need to change? I'd love to see.

> - I rewrote the RT::Interface::Email::Auth::GnuPG from enhanced-mailgate's 
> GetCurrentUserFromPGPSignature sub. The main change is to use the 
> '--status-fd' option of GPG that allows to get an locale-independant, easily 
> parseable status output.


Cool. you should also have a look at Mail::GnuPG.

> 
> I can post an archive with the two *_Local.pm files and the GnuPG.pm one if 
> someone wants. But I mainly ask for comments about that. After that, I'll go 
> on my way to integrate pseudo-headers handling in the Gateway sub.

I'd love to see your changes. Also, with your changes, does RT still
pass a "make regression"? 


I'd like to recommend that you implement the pseudoheader parsing as its
own module, so that it can be reused by other components that might also
want it, such as a CVS or Subversion integration.
	Best,

	Jesse

-- 
http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list