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

Guillaume Perréal perreal at lyon.cemagref.fr
Fri Aug 15 12:42:32 EDT 2003


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.

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.

- 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).

- 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.

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.

Best regards,
-- 



More information about the Rt-devel mailing list