This queue is for tickets about the RT-Extension-CommandByMail CPAN distribution.

Report information
The Basics
Id:
133045
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
tim.turner [...] lmax.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: CustomField not applying
Date: Fri, 24 Jul 2020 16:23:11 +0000
To: "bug-RT-Extension-CommandByMail@rt.cpan.org" <bug-RT-Extension-CommandByMail@rt.cpan.org>
From: Tim Turner <tim.turner@lmax.com>
I have tried CF.{} and CustomField{} neither of which work. Nothing is logged, I can apply changes to the standard fields like queue and subject RT-Extension-CommandByMail-3.01 RT 4.2.11 This is perl, v5.10.1
Show quoted text
____________ Tim Turner T +44 20 3192 2566 E Tim.turner@LMAX.com W www.LMAX.com This message and its attachments are confidential, may not be disclosed or used by any person other than the addressee and are intended only for the named recipient(s). If you are not the intended recipient, please notify the sender immediately and delete any copies of this message. LMAX Group is the holding company of LMAX Exchange, LMAX Global and LMAX Digital. Our registered address is Yellow Building, 1A Nicholas Road, London W11 4AN.
I had problems with this too. It appears that RT does not set any AddCustomField custom fields unless the sender address in the "From: " header maps to a user that has access to the queue. As you describe, everything else can be set fine, and nothing looks amiss in the logs (in fact, the logs show it does see the customfields, but then doesn't appear to do anything with them.) So this seems inconsistent. Example from my web form script to send mail to set up new orders:- [...] my $msg = MIME::Lite->new( From => 'sales@mydomain.net', To => 'rt_queue@mydomain.net', Subject => $subject, Type => 'multipart/mixed' ); $msg->add("X-RT-Command: Queue" => "NewMembers"); $msg->add("X-RT-Command: Requestor" => "$params{admin_name} <$params{admin_email}>"); $msg->add("X-RT-Command: AddRequestor" => "$params{tech_name} <$params{tech_email}>"); # Add connection site(s): foreach my $site (@sites) { $msg->add("X-RT-Command" => "AddCustomField.{ConnectionSites}: $site"); } $msg->attach( Type => 'TEXT', Data => $text ); $msg->send; The Queue and Requestor addresses are set correctly but no AddCustomField. If I change the From: address to the address of a Privileged user in RT, it works. (sales@ is in RT, but it is not a Privileged user with access to the queue.) For my testing purposes I set it to 'root@' since that user in RT has access to all the queues. I suppose I could set up a dedicated RT user for it and lock the access to commands with CommandByMailGroup (which for some reason only works with the ID of the group, not the group name itself, which is a little annoying.) RT::Extension::ExtractCustomFieldValues looks more complex to set up, but allows more flexible actions to be taken and more complex logic to be added using templates. For my purposes, RT::Extension::CommandByMail does everything I need to do. R.
Date: Wed, 17 Mar 2021 16:19:47 +0000
Subject: Re: [rt.cpan.org #133045] CustomField not applying
To: "bug-RT-Extension-CommandByMail@rt.cpan.org" <bug-RT-Extension-CommandByMail@rt.cpan.org>
From: "Tim Turner" <tim.turner@lmax.com>
Thanks for the reply.

You hit the nail on the head and I had also worked it out after some head scratching 🙂

The sender address did not have enough privs coming into RT, so I had to create that user and allow it to do the required actions.




From: Robert Lister via RT <bug-RT-Extension-CommandByMail@rt.cpan.org>
Sent: 17 March 2021 15:34
To: Tim Turner <tim.turner@lmax.com>
Subject: [rt.cpan.org #133045] CustomField not applying
 
<URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D133045&amp;d=DwIDaQ&amp;c=0Z1BrDuxWFC9EN7stAjUCw&amp;r=rvPj4pfCY8LdE2MChJZ3AUKN56Zmnhwy3U2Xb3NtC78&amp;m=hA7eSoFR_ufu9BR-L-lzLIeIpp-DRj3viJPuOui7wbM&amp;s=2RJTX0b2hkf5oNYRucMGWdjmb7KGIFTGLpQT-wZ4WB8&amp;e=  >

I had problems with this too.

It appears that RT does not set any AddCustomField custom fields unless the
sender address in the "From: " header maps to a user that has access to the
queue.

As you describe, everything else can be set fine, and nothing looks amiss
in the logs (in fact, the logs show it does see the customfields, but then
doesn't appear to do anything with them.)

So this seems inconsistent.

Example from my web form script to send mail to set up new orders:-

[...]
my $msg = MIME::Lite->new(
        From => 'sales@mydomain.net',
        To => 'rt_queue@mydomain.net',
        Subject => $subject,
        Type => 'multipart/mixed'
);

$msg->add("X-RT-Command: Queue"         => "NewMembers");
$msg->add("X-RT-Command: Requestor"     => "$params{admin_name} <$params{admin_email}>");
$msg->add("X-RT-Command: AddRequestor"  => "$params{tech_name} <$params{tech_email}>");

# Add connection site(s):
foreach my $site (@sites) {
   $msg->add("X-RT-Command" => "AddCustomField.{ConnectionSites}: $site");
}

$msg->attach(
        Type => 'TEXT',
        Data => $text
);

$msg->send;

The Queue and Requestor addresses are set correctly but no AddCustomField.

If I change the From: address to the address of a Privileged user in
RT, it works. (sales@ is in RT, but it is not a Privileged user
with access to the queue.)

For my testing purposes I set it to 'root@' since that user in RT has access to
all the queues. I suppose I could set up a dedicated RT user for it and lock
the access to commands with CommandByMailGroup (which for some reason only works
with the ID of the group, not the group name itself, which is a little annoying.)

RT::Extension::ExtractCustomFieldValues looks more complex to set up, but allows
more flexible actions to be taken and more complex logic to be added using templates.

For my purposes, RT::Extension::CommandByMail does everything I need to do.

R.


This message and its attachments are confidential, may not be disclosed or used by any person other than the addressee and are intended only for the named recipient(s). If you are not the intended recipient, please notify the sender immediately and delete any copies of this message.

LMAX Group is the holding company of LMAX Exchange, LMAX Global and LMAX Digital. Our registered address is Yellow Building, 1A Nicholas Road, London W11 4AN.



This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.