# How do you decode the contact id from the return email address?

**URL:** <https://forum.mautic.org/t/how-do-you-decode-the-contact-id-from-the-return-email-address/15152>\
**Category:** Development\
**Created:** [July 9, 2020, 8:38pm UTC](https://forum.mautic.org/t/how-do-you-decode-the-contact-id-from-the-return-email-address/15152 "2020-07-09T20:38:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricksimnett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricksimnett/32/1578_2.png) [@ricksimnett](https://forum.mautic.org/u/ricksimnett)\
**Post date:** [July 9, 2020, 8:38pm UTC](https://forum.mautic.org/t/how-do-you-decode-the-contact-id-from-the-return-email-address/15152/1 "2020-07-09T20:38:23Z")

</div>

Hello,  
Im building a custom bounce handler to allow PowerMTA to report bounces via the Mautic API. On the surface its easy to do - ONCE YOU HAVE THE CONTACT ID. What Im struggling to figure out is how to get the contact id from the bounce email address… here is what the bounce email address looks like:

[example+bounce\_5f0661c5b6427601221206@example.com](mailto:example+bounce_5f0661c5b6427601221206@example.com)

What I cant seem to track down in the mautic code (Im not familiar with Symfony at all so that probably has alot to do with it) - is how to decode the “5f0661c5b6427601221206” into usable data such as the contact id.

I tried just base64\_decoding it but that resulted in garbage - so Im hoping one of you out there can tell me how to decode the data into the contact id via PHP. With that I can then mark the contact as bounced via the Mautic API.

Thanks in advance.

Rick
