check to see if attachment exists in email

georgechen
Kilo Guru

Hi folks,

just wondering if there is a way to check if any attachments exists in an email if the attachment size is greater than the default size, 18874368 bytes (limit glide.email.inbound.max_total_attachment_size_bytes)

if the attachment is excessive in size, it seems not to be attached to the sys_attachment table, but the email appears to come through.

I was wondering if in the email header or some property of the email could reveal the attachment details like name, size, or etc.

Any advice would be appreciated.

Kind regards,

4 REPLIES 4

Abbas7
Tera Contributor

This might be helpfull to you:


Administering Attachments - ServiceNow Wiki



You can also create an event on the warning of excessive attachment size and process the email


Brian Dailey1
Kilo Sage

Hi George,



In your Inbound Email Action script, you can check "email.headers" to see if it contains something like "X-MS-Has-Attach:".



The name of the attachment attribute listed in the headers may vary depending on what email system they came from.   But if you have a list of standard attribute names (like the one above), you could reference them as a property in this way:



        e.g.,           email.header.x-ms-has-attach




This will at least tell you whether or not the original email had attachments (i.e., if they got stripped)




-Brian


Thanks Brain, this reply is pretty much helpful, I am changing my Inbound action script to rectify this.


Your response is much appreciated.


Kind regards,
George


You are very welcome.



-Brian