{"id":590,"date":"2024-07-15T16:59:01","date_gmt":"2024-07-15T14:59:01","guid":{"rendered":"https:\/\/lendl.priv.at\/blog\/?p=590"},"modified":"2026-01-05T23:06:41","modified_gmt":"2026-01-05T22:06:41","slug":"rt-different-from-for-a-certain-user","status":"publish","type":"post","link":"https:\/\/lendl.priv.at\/blog\/2024\/07\/15\/rt-different-from-for-a-certain-user\/","title":{"rendered":"RT: Different From: for a certain user"},"content":{"rendered":"\n<p>At CERT.at, we recently changed the way we send out bulk email notifications with RT: All Correspondence from the Automation user will have a different From: address compared to constituency interactions done manually by one of our analysts.<\/p>\n\n\n\n<p>How did I implement this?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The first idea was to use a different queue to send the mails, and then move the ticket to the normal one: The From: address is one of the things that can be configured on a queue-level.<\/li>\n\n\n\n<li>Then I tried whether I can override the From: header by including it in the Correspondence Template. Yep, that works. Thus idea two: modify the Scrips in a way to have different ones trigger based on who is running the transaction.<\/li>\n\n\n\n<li>But it&#8217;s even simpler: the Template itself can contain Perl code, so I can just do the &#8220;if then else&#8221; thingy inside the Template.<\/li>\n<\/ul>\n\n\n\n<p>In the end, it was just a one-liner in the right spot. Our &#8220;Correspondence&#8221;-Template looks like this now:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-plain is-layout-flow wp-block-quote-is-layout-flow\">\n<tt>RT-Attach-Message: yes<br>\nContent-Transfer-Encoding: 8bit{($Transaction-&gt;CreatorObj-&gt;Name eq 'intelmq') ? \"\\nFrom: noreply\\@example.at\" : \"\"}\n<br>\n<br>\n{$Transaction-&gt;Content()}<\/tt>\n\n\n\n<p><\/p>\n<\/blockquote>\n\n\n\n<p>The &#8220;Content-Transfer-Encoding: 8bit&#8221; was needed because of the CipherMail instance, without it we could get strange MIME encoding errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At CERT.at, we recently changed the way we send out bulk email notifications with RT: All Correspondence from the Automation user will have a different From: address compared to constituency interactions done manually by one of our analysts. How did I implement this? In the end, it was just a one-liner in the right spot. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,11],"tags":[],"class_list":["post-590","post","type-post","status-publish","format-standard","hentry","category-cert","category-system-administration"],"_links":{"self":[{"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/posts\/590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/comments?post=590"}],"version-history":[{"count":1,"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/posts\/590\/revisions"}],"predecessor-version":[{"id":805,"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/posts\/590\/revisions\/805"}],"wp:attachment":[{"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/media?parent=590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/categories?post=590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lendl.priv.at\/blog\/wp-json\/wp\/v2\/tags?post=590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}