Op 5/24/2013 1:45 PM, Kiran Reddy schreef:
Hi,
If mail headers contains 2 lines Delivered-To and 1 X-Original-To. I want to keep first line of Delivered-To and X-Original-To and delete 2nd line of Delivered-To and rewrite X-Original-To to Delivered-To.
Please find the mail headers as below.
X-Original-To: 98862xxx65@example.in ====> Rewrite this to Delivered-TO Delivered-To: mobilemail@example.in ====> KEEP This Header Delivered-To: example.com-mobilenumbers@example.com =======> Delete This Header
If you can rely on the exact order of these headers, this should work:
require "editheader"; require "variables";
if header :matches "X-Original-To" "*" { deleteheader :index 2 "Delivered-To"; addheader "Delivered-To" "${1}"; deleteheader "X-Original-To"; }
Regards,
Stephan.