Inbound Email Actions - ServiceNow Wiki
Inbound Email Actions - ServiceNow Wiki
CustomSearch
InboundEmailActions
Home>Administer>ServiceAdministration>Notifications>InboundEmailActions
Contents
1Overview
2CreatinganInboundEmailAction
3MatchingIncomingEmailtoanInboundActionType
3.1SpecifyingRecognizedReplyPrefixes
3.2SpecifyingRecognizedForwardPrefixes
3.3ProcessingForwardsasReplies
3.4MatchingIncomingEmailtoExistingRecords
3.4.1ExamplesofMatchingWatermarksintheSubjectLineorBody
3.4.2ExamplesofMatchingRecordNumbersintheSubjectLine
4MatchingEmailtoExistingUsers
4.1ImpersonatingUserstoRunInboundActions
5CreatingUsersfromIncomingEmail
5.1EnablingAutomaticUserCreation
5.2UpgradingtheUserCreationMethodtoUsetheFullEmailAddress
6AccessingEmailObjectswithVariables
6.1ProcessingRecipientsinInboundEmail
7SettingFieldValuesfromtheEmailBody
7.1MatchingtheSender'sEmailAddresstoaUser
8AssignmentofTasksviaEmail
9RedirectingEmailstoDifferentAssignmentGroups
10Attachments
11CharacterEncoding
12SettingMaximumBodySize
13PreventingUntrustedUsersfromTriggeringInboundActions
14AllowingLockedOutUserstoTriggerInboundEmailActions
15Usingsys_email
16Troubleshooting
16.1Logging
1Overview
InboundemailactionsenableanadministratortodefinetheactionsServiceNowtakeswhenreceivingemail.Inboundemailactionsaresimilarto
businessrules,usingbothconditionsandscripts.Theinboundemailactioncheckstheemailforawatermarkthatassociatesitwithataskandchecks
forotherconditions.Iftheconditionsaremet,theinboundemailactionrunsthescript.
Bydefault,ifanemailhasnoidentifiablewatermark,aninboundemailactionattemptstocreateanewincidentfromthemessage.Iftheemailhasa
watermarkofanexistingincident,aninboundemailactionupdatestheexistingincidentaccordingtotheaction'sscript.Fordetailedexamplesofemail
actionsthatinteractwithincidents,problems,andchangerequests,seeExamplesofInboundEmailActions.
Thesystemignoresthedomainthattheinboundemailactionrecordisinwhenitcreatesarecordbasedontheinboundemailaction.Keepinbound
actionsintheglobaldomain.Forexample,ifyourinboundemailactioncreatesanincident,thesystemcreatestheincidentinthesamedomainasthe
userintheCallerfield.IfthatuserisnotintheUser[sys_user]table,theincidentisintheglobaldomain.
2CreatinganInboundEmailAction
Toaddaninboundemailaction:
1.NavigatetoSystemPolicy>Email>InboundActions.
2.ClickNew.
3.Completethefieldsontheform(seetable).
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 1/10
3/28/2017 InboundEmailActionsServiceNowWiki
TheCreateIncidentinboundaction
Note:Youmightneedtopersonalizetheformtoseeallthefieldsbelow.
Field Description
Name Enteradescriptivenameforthisemailaction.
Target Selectthetablewheretheactionwilladdorupdaterecords.
table
Type Selectthemessagetyperequiredtoruntheaction.Theactionrunsonlyiftheinboundemailisoftheselectedtype.Availabletypes
are:
New:Anemailthatisnotrecognizedasareplyorforward.
Reply:AnemailwithawatermarkwithanInReplyToemailheader,orwhosesubjectlinebeginswitharecognizedreply
prefix.
Forward:Anemailwhosesubjectlinebeginswitharecognizedforwardprefix,eveniftheemailalsocontainsawatermarkor
InReplyToheader.
Note:Bydefault,inboundemailsoftheForwardtypealwaysgeneratenewincidentsregardlessofthepresenceofa
watermark.Ifthisbehaviordoesnotmatchyourbusinesslogic,youcanchangetherecognizedreplyandforwardprefixesto
treatforwardslikereplies.
Condition [Optional]Enterastatementthatdetermineswhentheinboundemailactionruns.Ifaconditionisentered,theactionrunsonlywhen
theconditionstatementevaluatestotrue.Forexample:
email.subject.startsWith("chg:")
Active Selectthischeckboxtoenabletheaction.Clearthecheckboxtodisabletheaction.
From [Optional]Selecttheuserrequiredtoruntheaction.Ifauserisselected,theactionrunsonlywhentheemailsendermatchestheuser
name.Leavethisfieldblanktoperformtheactionforallusers.
Script Enterthescripttheactionruns.Typically,thisscriptusesthevalidatorsscriptincludeandemailvariables.
Description Enteradetailedexplanationofwhatthisinboundemailactiondoes.
Otherfields
Order Enteranumbertodefinetheorderinwhichthisemailactionshouldbeprocessed.Actionswithlowernumbersareprocessedfirst.
Formoreinformation,seeOrderedEmailProcessing.ThisfieldisnotinstalledbytheOrderedEmailProcessingplugin.
Note:Forsamplescripts,seetheUsefulScriptsportal.
3MatchingIncomingEmailtoanInboundActionType
ServiceNowusesthefollowinglogictomatchanemailtoaspecificinboundactiontype.
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 2/10
3/28/2017 InboundEmailActionsServiceNowWiki
HowServiceNowmatchesemailtoaninboundactiontype
Ifmorethanoneinboundactionisavailableforaparticulartype,ServiceNowusestheTablefieldtomatchtheemailtoaparticulartable.Ifthereisalso
morethanoneactionfortheinboundaction'stable,ServiceNowusestheOrderfieldtodeterminetheorderinwhichtheactionsrun.
3.1SpecifyingRecognizedReplyPrefixes
WhennowatermarkorInReplyToemailheaderispresent,ServiceNowrecognizesemailcontainingaprefixfromthe
glide.email.reply_subject_prefixpropertyasreplyemail.Emailswiththeseprefixestriggerinboundemailactionsofthetypereply.Setthis
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 3/10
3/28/2017 InboundEmailActionsServiceNowWiki
glide.email.reply_subject_prefixpropertyasreplyemail.Emailswiththeseprefixestriggerinboundemailactionsofthetypereply.Setthis
propertyifyouremailsystemusesnonstandardreplyprefixes.
Property Description
glide.email.reply_subject_prefix Specifiesthelistofprefixes(commaseparated)inthesubjectlinethatidentifyanemailreply.
Type:string
Defaultvalue:re:,aw:,r:
Location:AddtotheSystemProperties[sys_properties]table
Note:Prefixesarecaseinsensitive.
3.2SpecifyingRecognizedForwardPrefixes
ServiceNowrecognizesanyemailwhosesubjectlinecontainsaprefixfromtheglide.email.reply_subject_prefixpropertyasforwardedemail.
Emailswiththeseprefixestriggerinboundemailactionsofthetypeforward.Setthispropertyifyouremailsystemusesnonstandardforwardprefixesor
youwantforwardstobehavelikereplies.
Property Description
glide.email.forward_subject_prefix Specifiesthelistofprefixes(commaseparated)inthesubjectlinethatidentifyaforwardedemail.
Type:string
Defaultvalue:fw:,fwd:
Location:AddtotheSystemProperties[sys_properties]table
Note:Prefixesarecaseinsensitive.
3.3ProcessingForwardsasReplies
Youcanforceinboundactionstoprocessforwardedmailasrepliedmailbymodifyingthesubjectprefixpropertiesasfollows.
Property ValueNeeded
glide.email.reply_subject_prefix re:,aw:,r:,fw:,fwd:
glide.email.forward_subject_prefix [anytextthatisnotaforwardprefix]
ThiscausesallforwardedandrepliedtomailtobeprocessedbytheUpdateIncidentinboundaction.
Theglide.email.forward_subject_prefixpropertymustcontainsometextinorderfortheforwardedemailtobeprocessedasaReply.Itcanbe
anytextexceptaforwardprefix(thatis,fw:,fwd:).
3.4MatchingIncomingEmailtoExistingRecords
Tounderstandhowtheinstancematchingincomingemailtoexistingrecords,seethisgraphic.
Theinstancesearchesforwatermarksintheemailsubjectlinefirst,thenintheemailbody.Ifnowatermarkispresent,theinstancessearchesforanIn
ReplyToemailheaderthatmatchesanexistingrecord.Ifthatisnotfound,theinstancessearchesthesubjectlineforarecognizedreplyprefix.
Note:SomeversionsofMicrosoftExchangeServerrequireahotfixtosupportthe"InReplyTo"headerwhenreplyingtoemailthatoriginates
fromoutsidetheorganization.
3.4.1ExamplesofMatchingWatermarksintheSubjectLineorBody
ThefollowingexamplesillustratehowServiceNowmatcheswatermarksinanemail'ssubjectlineorbody.
SubjectLineorBodyContents Matchingresults
Ref:MSG0000008 ServiceNowrecognizesthisasawatermarkandsearchestheEmailWatermarks[sys_watermarks]tablefora
recordwiththenumberMSG0000008.Ifthiswatermarkexists,ServiceNowmatchestheemailtotheassociated
record.Ifthiswatermarkdoesnotexist,ServiceNowusestheinboundactionfornewemailstocreateanew
incident,andassociatesthenewincidentwiththeemail.
Ref:MSGWTR0000008 ServiceNowrecognizesthisasawatermarkandsearchestheEmailWatermarks[sys_watermarks]tablefora
recordwiththenumberMSGWTR0000008.Ifthiswatermarkexists,ServiceNowmatchestheemailtothe
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 4/10
3/28/2017 InboundEmailActionsServiceNowWiki
recordwiththenumberMSGWTR0000008.Ifthiswatermarkexists,ServiceNowmatchestheemailtothe
associatedrecord.Ifthiswatermarkdoesnotexist,ServiceNowusestheinboundactionfornewemailsto
createanewincident,andassociatesthenewincidentwiththeemail.
Ref:WTR0000008 ServiceNowrecognizesthisasawatermarkandsearchestheEmailWatermarks[sys_watermarks]tablefora
recordwiththenumberWTR0000008.Ifthiswatermarkexists,ServiceNowmatchestheemailtotheassociated
record.Ifthiswatermarkdoesnotexist,ServiceNowusestheinboundactionfornewemailstocreateanew
incident,andassociatesthenewincidentwiththeemail.
MSG0000008 ServiceNowdoesnotrecognizethisasawatermarkbecauseitdoesnotstartwiththeRef:prefix.Itusesthe
inboundactionfornewemailstocreateanewincident,andassociatesthenewincidentwiththeemail.
3.4.2ExamplesofMatchingRecordNumbersintheSubjectLine
ThefollowingexamplesillustratehowServiceNowmatchesrecordnumbersinanemail'ssubjectlinetoanexistingrecordwhennowatermarkis
present.
SubjectLineContents MatchingResults
RE:Example ServiceNowrecognizesthissubjectlineasareplyandrecognizestheINCprefixasbelongingtotheincidenttable.
INC0005574 ServiceNowsearchestheincidenttableforanexistingrecordINC0005574.Ifthisincidentexists,theemailisassociated
withthisincident.Ifthisincidentrecorddoesnotexist,ServiceNowusestheinboundactionfornewemailstocreatea
newincident,andassociatesthenewincidentwiththeemail.
RE:Example Theinstancerecognizesthissubjectlineasareplybutdoesrecognizesthe"INCprefixasbelongingtotheIncidenttable
"INC0005574" becauseofthequotationmark.Thesameerroroccursforanycharacterotherthanaspacebeforetherecordnumber.
RE:Example Theinstanceinsteadusestheinboundactionfornewemailstocreateanincident,andassociatesthenewincidentwith
*INC0005574 theemail.
RE:"Example TheinstancerecognizesthissubjectlineasareplyandrecognizestheINCprefixasbelongingtotheIncidenttable.The
INC0005574" instancesearchestheIncidenttableforanexistingrecordINC0005574",whichitwillnotfindbecauseofthequotation
RE:Example mark.Thesameerroroccursforanycharacterotherthanaspaceattheendoftherecordnumber.Theinstanceinstead
INC0005574* usestheinboundactionfornewemailstocreateanincident,andassociatesthenewincidentwiththeemail.
RE:CHG0008593and ServiceNowrecognizesthissubjectlineasareplyandrecognizesone,butnotboth,ofthenumberprefixes.Thereisno
INC000576 waytopredictwhichprefixServiceNowwillmatchfirst.Whicheverprefixitmatches,itsearchesthecorrespondingtable
foramatchingrecord.Iftherecordexists,theemailisassociatedwiththetable.Iftherecorddoesnotexist,ServiceNow
usestheinboundactionfornewemailstocreateanewincidentandassociatesthenewincidentwiththeemail.
Note:ServiceNowdoesnotsupportprocessingemailwithmultiplenumbersinthesubjectlinebecausethereisnoway
topredictwhichrecordServiceNowwillmatchfirst.Forthisreason,ServiceNowdoesnotrecommendcreating
notificationsthatincludemorethanone$numbervariable.
FW:Example ServiceNowrecognizesthissubjectlineasaforwardbecauseoftheFW:prefixandusestheinboundactionfor
INC0005574 forwardedemailstocreateanewincident,andassociatesthenewincidentwiththeemail.
ExampleINC0005574 ServiceNowrecognizesthissubjectasanewemailbecauseitdoesnotcontainamatchingreplyorforwardprefix.Ituses
theinboundactionfornewemailstocreateanewincident,andassociatesthenewincidentwiththeemail.
4MatchingEmailtoExistingUsers
WhenServiceNowreceivesanemailmessage,thesystemsearchesforanexistinguserrecordwiththesameemailaddressasthesender.For
example:
Note:ThisfunctionalityrequiresthatyouactivatetheEmailAutomaticUserCreationplugin.Formoreinformationontheplugin,see
UpgradingtheUserCreationMethodtoUsetheFullEmailAddress.
InboundEmailActionscriptsnolongersupportthegs.createUser()method.Useeithertheautomaticallygeneratedemailvariablesorthe
gs.GetUserID()methodinstead.
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 5/10
3/28/2017 InboundEmailActionsServiceNowWiki
gs.GetUserID()methodinstead.
4.1ImpersonatingUserstoRunInboundActions
Ifthesenderofanincomingemailmatchesanexistinguser,theinstanceimpersonatesthematchingusertocompleteanyinboundemailactions.Ifthe
senderdoesnotmatchanexistinguser,theinstanceimpersonatestheGuestusertocompleteanyinboundemailactions.Iftheimpersonateduseris
lockedout,theinboundemailactionfails.
Note:Ifinboundemailcomesfromanuntrusteddomain,theinstanceimpersonatestheGuestuserunlessyouexplicitlypreventusersfrom
untrusteddomainsfromtriggeringinboundactions.
5CreatingUsersfromIncomingEmail
ServiceNowcanautomaticallycreateusersfromincomingemail.Ifthesearchdoesnotfindauserwithamatchingemailaddress,ServiceNowcan
createanewuserwiththeUserID[sys_user.user_name]settothesender'sfullemailaddress.
5.1EnablingAutomaticUserCreation
Toenabletheautomaticcreationofuserrecordsfromemail,youmustsettwoemailproperties.
1.NavigatetoSystemProperties>Email.
2.SelectthecheckboxforAutomaticallycreateusersforincomingemailfromtrusteddomains(glide.pop3readerjob.create_caller).
Enablethepropertytocreateusersfromemail
3.EnterthelistoftrusteddomainsinTrusteddomainsforcreatingusersfromincomingemails(glide.user.trusted_domain).
Listoftrusteddomains
4.ClickSave.
Note:Whenthepropertyglide.pop3readerjob.create_callerissettofalse,ServiceNowrunsinboundactionsfromuserswhodonot
matchanexistinguserbyimpersonatingtheGuestuser.Youmaywanttopreventuntrustedusersfromtriggeringinboundactionsbylocking
outtheGuestuser.
5.2UpgradingtheUserCreationMethodtoUsetheFullEmailAddress
YoucanupgradethemethodServiceNowusestocreateusersbyactivatingtheEmailAutomaticUserCreationplugin.Thepluginmakesthefollowing
changes:
Setsthepropertyglide.email.create_userid_from_emailtotrue.
IncreasesthewidthoftheUserID[sys_user.user_name]columntoaccommodateemailaddresses.
Afteractivatingtheplugin,enableautomaticusercreationfromemail.
Warning:ServiceNow,Inc.stronglyrecommendsreviewingyourexistinguserrecordsto
reconcileanythatcontainidenticalemailaddresses.Ifyouactivatethepluginpriorto
reconcilingemailaddresses,yourinstancecannotdistinguishbetweenuserswithidentical
emailaddressesandwillrandomlyselectoneoftheuserswiththematchingemailaddress.
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 6/10
3/28/2017 InboundEmailActionsServiceNowWiki
emailaddressesandwillrandomlyselectoneoftheuserswiththematchingemailaddress.
6AccessingEmailObjectswithVariables
Aninboundemailactionscripthasaccesstovariouspiecesofaninboundemailthroughscriptvariables.
Variable Contents
email.to ContainsacommaseparatedlistofemailaddressesintheTo:andCc:boxes.
email.direct ContainsacommaseparatedlistofemailaddressesintheTo:box.
email.copied ContainsacommaseparatedlistofemailaddressesintheCc:box.
email.body_text Containsthebodyoftheemailasaplaintextstring.
email.body_html ContainsthebodyoftheemailasanHTMLstring.
email.from Containsanemailaddressaccordingtothefollowingconditions.IftheaddresslistedintheemailHeadersfieldmatchesan
existinguser'sEmailaddress,thisvariablecontainstheuser'sEmailaddress.IftheaddresslistedintheemailHeaders
fielddoesnotmatchanexistinguser'sEmailaddress,thisvariablecontainstheaddresslistedintheemailHeadersfield
(startingwithEurekaPatch5)ortheGuestuser'sEmailaddress(inversionspriortoEurekaPatch5).
email.from_sys_id ContainstheSysIDoftheuserwhosenttheemailtotheinstance.
email.origemail Containstheemailsender'saddressaslistedintheemailHeaders.
email.subject Containstheemail'ssubjectasaplaintextstring.
email.recipients Containsacommaseparatedlistofrecipientaddresses.
email.recipients_array Containstherecipientaddressesasanarray.
email.content_type ContainstheMIMEcontenttypeoftheemail(forexample,text/plaincharset="usascii"ortext/htmlcharset="us
ascii").
email.headers Containsdetailsaboutthesender,route,andreceiverasaplaintextstringintheformatofthesendingemailclient.
Note:ServiceNowfollowsRFC2822(http://www.rfceditor.org/info/rfc2822)(InternetMessageFormat),whichrequiresmultipleemail
addressesinagrouptobeseparatedbycommas,notsemicolons.ServiceNowcansetthevaluesoftheemail.to,email.direct,and
email.copiedvariablesonlyifemailaddressedtogroupsfollowtheexpectedRFCformat.
6.1ProcessingRecipientsinInboundEmail
Therecipientsvariablesallowprocessingofinboundemailbasedontheemailrecipients:
email.recipients:returnsacommaseparatedlistofrecipientaddressesasaplaintextstring.
email.recipients_array:returnstherecipientaddressesasanarray.
Forexample,createascripttoprocessemailbasedonthearrayvalues:
varrarray=email.recipients_array;
for(vari=0;i<rarray.length;i++){
varrecipient=rarray[i];
//dosomethingwithit
}
7SettingFieldValuesfromtheEmailBody
Valuesinaninboundemailcansetfieldvaluesinataskrecord.Anyname:valuepairinaninboundemailbodygetsparsedintoavariable/valuepairin
theinboundemailscript.Thename:valuepairmustbeonitsownline.Notethatmostemailclientslimitthenumberofcharactersallowedperlineand
maytruncateexcessivelylongname:valuepairs.TopopulateareferencefieldusesetDisplayValue()instead.SeeRedirectingEmailsforanexample
ofusingsetDisplayValue()inaninboundemailaction.
Note:Theactionalwaysgeneratesalowercasevariablename.Notealsothatthisfunctionalitydoesnotworkonreferencefields.
Forexample,ifanemailbodycontainsthisline:
Foo:bar
Theinboundemailscriptcreatesthevariableemail.body.foowiththevalueofbar.Youcanusethesevariablestocreateconditionssuchas:
if(email.body.foo!=undefined){
current.[field]=email.body.foo;
}
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 7/10
3/28/2017 InboundEmailActionsServiceNowWiki
}
Inthisexample,thescriptsetsthevalueof[field]tothevaluebar.
7.1MatchingtheSender'sEmailAddresstoaUser
Whenprocessinganemail,ServiceNowsetsthecurrentusertotheuserwhoseemailaddressmatchesemail.from.Inboundactionscanthenreference
thatcurrentuser.Forexample,thebasesysteminboundactionCreateIncidentsetstheincident'scaller_idtothevaluereturnedbygs.getUserID().
Ifmultipleusershavethesameemailaddress,theinstancefirstsearchesforanactiveuserwiththeemailaddress.Theinstancedoesnotmatch
inactiveusers.
Warning:Youshouldhaveauniqueemailaddressesforeachuserrecord.Otherwise,the
instancecannotreliablymatchtheemailtothecorrectuserandunpredictablematchesmay
occur.
Ifprovidingauniqueemailaddresstoeachuserisnotpossible,ServiceNowrecommendsonlyhavingoneactiveuserwiththesharedemailaddress.
ThisconfigurationguaranteesthatServiceNowalwaysmatchesincomingemailfromthisaddresstotheactiveuser.
Note:TheEmailAutomaticUserCreationpluginmustbeactive.
8AssignmentofTasksviaEmail
Thename:valueexampleshowsausefulemailcapabilitythatis,theabilitytosetafieldinarecord.Forexample,thechange.itil.approve.roleemail
templatelistsseveralfieldsintheoutboundnotification.
NoticethelineinthetemplatethatshowsPriority:${sysapproval.priority}.Whenreplyingtothisemail,theapprovercanchangethevalueofthe
Priorityfielddirectlyfromtheemail.Forexample,theapprovercouldsetthepriorityto4Low:
Priority:4
9RedirectingEmailstoDifferentAssignmentGroups
Bydefault,thePOPReaderscheduledjobchecksfornewemailevery2minutes.Itconnectstothemailserverandaccountspecifiedinemail
properties.ThePOPReaderdownloadsanyemailwaitingonthemailserverandcreatesemail.readevents.Aftertheinstanceprocessestheevents,
theinboundemailactionsrun.
ThePOPReadershowsthenumberofemailsprocessedduringthereader'slastrun.Themessageshowsthenumberofemailsthereaderprocessed
or0processedifnoemailswereavailable.Thereaderresetsthestatuseachtimeitruns.
WhileitisnotpossibletospecifymorethanonePOP3accountfortheinstance,youcanhaveothermailboxesforwardtothedesignatedPOP3account.
AddthisscripttotheCreateIncidentinboundemailactiontodifferentiatethecontentbasedontheoriginalrecipientandthensetan
assignment_groupvalue.
if(email.direct.indexOf('[email protected]')>1)
current.assignment_group.setDisplayValue('FacilitiesManagement');
Updatetheemailaddress,originalrecipient,andassignmentgroupnameaccordingly.
10Attachments
Ifaninboundemailcontainsoneormoreemailattachments,theinboundemailactionaddstheattachmentstothefirstrecordtheactionproduces.
11CharacterEncoding
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 8/10
3/28/2017 InboundEmailActionsServiceNowWiki
ServiceNowcheckstheMIMEtypeofincomingemailtoverifythecharacterencoding.IftheemailencodingisASCII7orUTF8,inboundemailactions
preservethecharacterencodinginanyassociatedtaskrecordstheyproduce.IftheemailencodingisISO88591,theinboundemailactionattemptsto
converttheemailtoWindows1252.Inboundemailactionsconvertanyotherencodings(forexample,MacOSRoman)toplaintext,whichmayormay
notbereadable.
12SettingMaximumBodySize
Insomesituations,anemailmessagemaycontainmoreinformationinthebodythantheinstance'sdatapolicypermitsafieldtowritetothedatabase.
Bydefault,aninboundemailactioncanprocessonlyupto16MBworthofinformationinthemessagebody.Iftheemailbodyexceedsthislimit,the
instancetruncatesthemessagebody.
Asystempropertycontrolsthemaximumsizeofamessagebodybeforetheinstancestopsprocessinginboundemailactions.Thedefaultvalueissetto
matchthedatapolicywritelimitof16MB.Youcannotsetahighervaluewithoutconflictingwiththewritedatapolicylimit.Ifyouwanttosetalowerlimit,
youcanaddthissystemproperty.Ensurethelimitiswellbelowthemaximumtotalemailsize.
Property Value
Name com.glide.email.max_body_bytes
Description Specifythemaximumsizeofanemailmessagebodyinbytes.Thesizecannotexceedthedefaultvalueof16MB.
Type Integer
Value 16777216
Note:Emailattachmentshaveseparatesizelimits.Formoreinformation,seeEmailAttachmentLimits.
13PreventingUntrustedUsersfromTriggeringInboundActions
Administratorscanpreventusersfromuntrusteddomainsfromtriggeringinboundactions.Forexample,youcanpreventemailfromusersoutsideyour
companydomainfromcreatingincidents.
1.Enableautomaticusercreationandaddalistoftrusteddomains.Forexample,addyourcompanydomainexample.com.
2.NavigatetoUserAdministration>Users.
3.Selecttheuserguest.
4.SelecttheLockedoutfieldtodisabletheguestaccount.LockingoutauserrecordpreventsServiceNowfromprocessinginboundactions.
Whenauserfromatrusteddomainsendsanemailtotheinstance,ServiceNoweithermatchestheemailtoanexistinguserorcreatesanewuser.
Sincetheincomingemailmatchesauserrecord(eitheranexistingornewone),theemailcantriggeraninboundaction.
Whenauserfromanuntrusteddomainsendsanemailtotheinstance,ServiceNowattemptstoimpersonatetheguestuser.Sincetheguestuseris
lockedout,theimpersonationfailsandtheincomingemailcannottriggeraninboundaction.
Warning:Allowinglockedoutuserstotriggerinboundactionsalsoallowsuntrustedusersto
triggerinboundactions.
14AllowingLockedOutUserstoTriggerInboundEmailActions
Administratorscanallowlockedoutuserstotriggerinboundactionsbysettingthesystempropertyglide.pop3.process_locked_out.Thisallows
userswhoneedtoresettheirpasswordtosendanemailmessagetoaninstanceaskingforassistance.
Warning:Enablingthisfeaturealsoenablesusersfromuntrusteddomainstotriggerinbound
actions.
Property Description
glide.pop3.process_locked_out Enables(true)ordisables(false)theabilityforlockedoutuserstotriggerinboundactions.
Type:true|false
Defaultvalue:false
Location:AddtotheSystemProperties[sys_properties]table
15Usingsys_email
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 9/10
3/28/2017 InboundEmailActionsServiceNowWiki
Youcanusetheglobalvariablesys_emailwithinboundemailactions.Thisletsyouaccessthereceivedsys_emailrecordthattriggeredtheinbound
emailaction.Itcanbeusedtoreferencefieldsontheemailrecord,suchasuid,sys_id,content_type,andsoon.
16Troubleshooting
Thefollowingsolutiontothiscommoninboundemailerrorisusefulfortroubleshootingemailactions.Formoreinformation,opentheServiceNow
KnowledgeBaseandaccessthefollowingtwoarticles:
Fortroubleshootinginboundemail,seeKB0524472(https://hi.servicenow.com/kb_view.do?sysparm_article=KB0524472).
Fortroubleshootingoutboundemail,seeKB0521382(https://hi.servicenow.com/kb_view.do?sysparm_article=KB0521382).
ErrororSymptom Solution
EmailfromOutlook ConfigurethelocalOutlookclientorExchangeservertonotsendRichTextformatted(RTF)datatoServiceNow
producesanemptyIncident instances.TopreventWindowsemailfromcontainingawinmail.datfile,seeMicrosoftKB278061
recordcontainingan (http://support.microsoft.com/kb/278061)forinformationonconfiguringOutlookorMicrosoftKB138053
attachmentnamed (http://support.microsoft.com/kb/138053)forinformationonconfiguringExchange.
winmail.dat.
16.1Logging
Seetheemaillogsforadescriptionofwhatyoucanseeinthesystemlog.
StartingwiththeDublinrelease,youcanusetheseGlideSystemerrormessagestodisplaymessages:
Foraninformationmessage:
gs.log("<INSERTLOGMESSAGEHERE>","EMAIL."+sys_email.sys_id)
Forawarningmessage:
gs.logWarning("<INSERTLOGMESSAGEHERE>","EMAIL."+sys_email.sys_id)
Foranerrormessage:
gs.logError("<INSERTLOGMESSAGEHERE>","EMAIL."+sys_email.sys_id)
Category: NotificationAdministration
Contents>Administer>ServiceAdministration>NotificationAdministration
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Attachments&gsc.tab=0 10/10