# Mautic 7.1.2: HTTP 500 Error When Sending Email if EmailBundle\_bounces Address is Blank

**URL:** <https://forum.mautic.org/t/mautic-7-1-2-http-500-error-when-sending-email-if-emailbundle-bounces-address-is-blank/38271>\
**Category:** Mautic 7 Install / Upgrade Support\
**Created:** [June 10, 2026, 5:49pm UTC](https://forum.mautic.org/t/mautic-7-1-2-http-500-error-when-sending-email-if-emailbundle-bounces-address-is-blank/38271 "2026-06-10T17:49:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcglinn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mcglinn/32/15081_2.png) [@mcglinn](https://forum.mautic.org/u/mcglinn)\
**Post date:** [June 10, 2026, 5:49pm UTC](https://forum.mautic.org/t/mautic-7-1-2-http-500-error-when-sending-email-if-emailbundle-bounces-address-is-blank/38271/1 "2026-06-10T17:49:26Z")

</div>

## Environment

- Mautic 7.1.2 (fresh installation)
- AlmaLinux 9.8
- Plesk Obsidian 18.0.77.5
- PHP-FPM
- MariaDB 11.8.8
- Fastmail SMTP

## Problem

A fresh installation of Mautic 7.1.2 was successfully configured and connected to Fastmail SMTP. However, every attempt to send a test email resulted in a HTTP 500 error.

The Apache and Mautic logs showed:

```plaintext
PHP Warning: Undefined array key 1 in app/bundles/EmailBundle/Helper/MailHelper.php on line 1789

Symfony\Component\Mime\Exception\RfcComplianceException:
Email "+bounce_xxxxxxxxx@" does not comply with addr-spec of RFC 2822.

```

## Investigation

The problem was traced to the following code in:

```plaintext
app/bundles/EmailBundle/Helper/MailHelper.php

```

Around line 1789:

```php
if ($settings = $this->isMontoringEnabled('EmailBundle', 'bounces')) {
    [$email, $domain] = explode('@', $settings['address']);
    $email .= '+bounce';
}

```

The installation had the following configuration in `config/local.php`:

```php
'EmailBundle_bounces' => array(
    'address' => '',
    'host' => '',
    'port' => '993',
    'encryption' => '/ssl',
    'user' => '',
    'password' => '',
    'override_settings' => '0',
    'folder' => ''
)

```

Because the address field was blank, the call to:

```php
explode('@', $settings['address']);

```

returned only a single array element, resulting in an undefined domain value.

Mautic then attempted to generate an address such as:

```plaintext
+bounce_6a2919c933580329878193@

```

which Symfony correctly rejected as an invalid RFC 2822 email address.

## Temporary Fix

The following modification was made:

```php
$settings = $this->isMontoringEnabled('EmailBundle', 'bounces');

if (!empty($settings['address']) && str_contains($settings['address'], '@')) {
    [$email, $domain] = explode('@', $settings['address']);
}

```

After clearing the cache and restarting PHP-FPM, email sending worked correctly.

## Question

Is this a known issue in Mautic 7.1.2?

It appears that when bounce monitoring settings exist but the monitored address is blank, Mautic still attempts to generate a bounce address and ultimately throws a fatal exception.

Should Mautic be validating that the monitored bounce address is populated and contains a valid email address before attempting to generate the bounce address?

Hopefully this helps anyone else encountering unexplained HTTP 500 errors when testing email delivery on a fresh installation.

---

<div class="post-metadata">

**Author:** ![ricfreire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricfreire/32/14973_2.png) [@ricfreire](https://forum.mautic.org/u/ricfreire)\
**Post date:** [June 11, 2026, 12:13pm UTC](https://forum.mautic.org/t/mautic-7-1-2-http-500-error-when-sending-email-if-emailbundle-bounces-address-is-blank/38271/2 "2026-06-11T12:13:25Z")

</div>

Hello @mcglinn,

Thank you for reporting this. It does indeed look like a bug!

I have **created a bug report** so the community can review it and move forward with a possible fix:

> <https://github.com/mautic/mautic/issues/16242>
>
> \### Mautic Series
> 
> 7.1.x series
> 
> \### Mautic installed version
> 
> 7.1.2
> 
> \### Way of… installing
> 
> I downloaded a release from https://www.mautic.org/mautic-releases
> 
> \### PHP version
> 
> 8
> 
> \### What browsers are you seeing the problem on?
> 
> Not relevant
> 
> \### What happened?
> 
> \> This bug was originally reported here: \[Original report\](https://forum.mautic.org/t/mautic-7-1-2-http-500-error-when-sending-email-if-emailbundle-bounces-address-is-blank/38271).  
> \> Author: \[McGlinn\](https://forum.mautic.org/u/mcglinn)
> \> I am not the original author of the report. I am sharing it here because it may affect other Mautic users and seems worth validating.
> 
> \### Environment
> 
> \- \*\*Mautic:\*\* 7.1.2 - fresh installation
> \- \*\*OS:\*\* AlmaLinux 9.8
> \- \*\*Server panel:\*\* Plesk Obsidian 18.0.77.5
> \- \*\*PHP:\*\* PHP-FPM
> \- \*\*Database:\*\* MariaDB 11.8.8
> \- \*\*SMTP:\*\* Fastmail
> 
> \### Problem
> 
> A fresh installation of Mautic 7.1.2 was successfully configured and connected to Fastmail SMTP.
> 
> However, every attempt to send a test email resulted in an HTTP 500 error.
> 
> The Apache and Mautic logs showed the following:
> 
> \`\`\`text
> PHP Warning: Undefined array key 1 in app/bundles/EmailBundle/Helper/MailHelper.php on line 1789
> 
> Symfony\\Component\\Mime\\Exception\\RfcComplianceException:
> Email "+bounce\_xxxxxxxxx@" does not comply with addr-spec of RFC 2822.
> \`\`\`
> 
> \### Investigation
> 
> The issue appears to be related to the following code in:
> 
> \`\`\`text
> app/bundles/EmailBundle/Helper/MailHelper.php
> \`\`\`
> 
> Around line 1789:
> 
> \`\`\`php
> if ($settings = $this-\>isMontoringEnabled('EmailBundle', 'bounces')) {
> \[$email, $domain\] = explode('@', $settings\['address'\]);
> $email .= '+bounce';
> }
> \`\`\`
> 
> The installation had the following configuration in \`config/local.php\`:
> 
> \`\`\`php
> 'EmailBundle\_bounces' =\> array(
> 'address' =\> '',
> 'host' =\> '',
> 'port' =\> '993',
> 'encryption' =\> '/ssl',
> 'user' =\> '',
> 'password' =\> '',
> 'override\_settings' =\> '0',
> 'folder' =\> ''
> )
> \`\`\`
> 
> Because the \`address\` field was blank, this line:
> 
> \`\`\`php
> explode('@', $settings\['address'\]);
> \`\`\`
> 
> returns only a single array element. As a result, the domain value is undefined.
> 
> Mautic then attempts to generate a bounce address similar to:
> 
> \`\`\`text
> +bounce\_6a2919c933580329878193@
> \`\`\`
> 
> Symfony correctly rejects this as an invalid RFC 2822 email address, which causes the HTTP 500 error.
> 
> \### Temporary workaround
> 
> The original reporter tested the following modification:
> 
> \`\`\`php
> $settings = $this-\>isMontoringEnabled('EmailBundle', 'bounces');
> 
> if (!empty($settings\['address'\]) && str\_contains($settings\['address'\], '@')) {
> \[$email, $domain\] = explode('@', $settings\['address'\]);
> }
> \`\`\`
> 
> After clearing the cache and restarting PHP-FPM, email sending worked correctly.
> 
> \### Expected behaviour
> 
> Mautic should not attempt to generate a bounce address when the bounce monitoring address is blank or invalid.
> 
> Before calling:
> 
> \`\`\`php
> explode('@', $settings\['address'\]);
> \`\`\`
> 
> Mautic should validate that:
> 
> \- the bounce monitoring address is not empty
> \- the value contains a valid email address
> \- the domain part exists before generating the bounce address
> 
> \### Actual behaviour
> 
> If bounce monitoring settings exist in \`config/local.php\`, but the \`address\` field is blank, Mautic still attempts to generate a bounce address.
> 
> This results in an invalid address such as:
> 
> \`\`\`text
> +bounce\_xxxxxxxxx@
> \`\`\`
> 
> and triggers a fatal exception when sending a test email.
> 
> \### Question
> 
> Is this a known issue in Mautic 7.1.2?
> 
> It looks like Mautic treats the bounce monitoring settings as enabled or available because the configuration array exists, even though the actual monitored email address is blank.
> 
> Should Mautic validate the monitored bounce address before attempting to generate the bounce address?
> 
> This may help other users experiencing unexplained HTTP 500 errors when testing email delivery on fresh Mautic 7.1.2 installations.
> 
> \### How can we reproduce this issue?
> 
> \-
> 
> \### Relevant log output
> 
> \`\`\`shell
> 
> \`\`\`
> 
> \### Code of Conduct
> 
> \- \[x\] I confirm that I have read and agree to follow this project's Code of Conduct
> 
> \<br /\>\<hr\>
> Care about this issue? Want to get it resolved sooner? If you are a \<a href='https://www.mautic.org/become-a-member-of-mautic'\>member of Mautic\</a\>, you can add some funds to the \<a href='https://opencollective.com/mautic/projects/bounties'\>Bounties Project\</a\> so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs \<a href='https://contribute.mautic.org/product-team/mautic-bounty-programme'\>here.\</a\>

If you have a GitHub account, I recommend **subscribing to the issue** so you can follow the progress and continue contributing if needed!

Thanks a lot for your help! 😃

Best,  
Ricardo
