Is there a way we can parse and get the value of "X-Original-From" from the header of an email which got forwarded/redirected to Servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 07:36 PM
HI All,
Our instance has too many forwarded/redirected emails coming in and we want to fetch the "X-Original-From" from the header, is there a way to do that via scripts ?. email.origemail does not give the right sender address hence we want to do it manually.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 08:46 PM
Did you try using "email.origemail" ?
Read more here:
https://community.servicenow.com/community?id=community_blog&sys_id=8fecae65dbd0dbc01dcaf3231f9619d3
https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/administer/notification/reference/r_AccessingEmailObjsWithVars.html
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 08:58 PM
Hi Vignesh,
yes i have tried it, but "email.origemail" also does not give us the right email sender as it goes through 2-3 redirections.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 09:26 PM
Try this
var str= email.headers;
var mySubString = str.substring(
str.lastIndexOf("X-Original-Sender:") + 18,
str.lastIndexOf("X-Original-Authentication")
);
gs.log("from inbound " +mySubString);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2021 01:46 PM
It worked for me but why u used +18 ,didnt understand