Adding cc'd users as ticket CC on create

One of our clients wants everyone cc'd on an e-mail which creates a ticket to also become a cc on the ticket. I found the answer in https://rt-wiki.bestpractical.com/wiki/EmailInterface and https://forum.bestpractical.com/t/adding-new-users-and-cc-users-to-tickets/19980/3, and it is a simple (kinda') change to the configuration file, located in installdir/etc/RT_SiteConfig.pm. In my case, it is /opt/rt5/etc/RT_SiteConfig.pm. Add the following two lines:

Set($ParseNewMessageForTicketCcs, 1);
Set($RTAddressRegexp,insert regex here);

The $RTAddressRegexp line is a regular expression which identifies the e-mail addresses used by your RT installation so they do not get included in the expansion (probably creating a loop). I worked for a while, coming up with the perfect regex for this, then realized that running the script:

/opt/rt5/etc/upgrade/generate-rtaddressregexp

not only did it easier and faster, but fixed some things I had missed. Perfection is variable.

So, easy way:

echo 'Set($ParseNewMessageForTicketCcs, 1);' > /tmp/rtchange
echo 'Set($RTAddressRegexp,'`/opt/rt5/etc/upgrade/generate-rtaddressregexp`');' >> /tmp/rtchange
cat /tmp/rtchange

review, then add to bottom of your RT_SiteConfig.pm file. Note, we do it this way since, generate-rtaddressregexp can produce a warning if the correct parameter already set.