Skip to main content

Exim: blocking spam forwarding causes bounces / frozen messages

Answered

Comments

22 comments

  • imorandin

    After some digging if I modify this file like so:

    /usr/local/cpanel/etc/exim/replacecf/no_forward_outbound_spam_over_int/reject_forwarded_mail_marked_as_spam:
    Diffs:

    • remove "allow_fail"
    • change line data = .... to transport = blackhole
    #
    # no_forward_outbound_spam enabled
    #
    #
    #
    reject_forwarded_mail_marked_as_spam:
      driver = accept
      domains = ! +local_domains
      condition = ${if eq {$spam_score_int}{}{0}{${if >{$spam_score_int}{[% exim_config.no_forward_outbound_spam_over_int %]}{1}{0}}}}
      #ignore verisign to prevent waste of bandwidth
      ignore_target_hosts = +loopback : 64.94.110.0/24
      transport = blackhole

    and add this transport in TRANSPORTSTART:

    blackhole:
      driver = appendfile
    file = /dev/null

    it works. Will this file be overwritten with updates?

    Thanks

    0
  • cPRex Jurassic Moderator

    Hey there!  When I check the file itself it doesn't show that it is linked to a package:

    # rpm -qf /usr/local/cpanel/etc/exim/replacecf/no_forward_outbound_spam_over_int/reject_forwarded_mail_marked_as_spam
    file /usr/local/cpanel/etc/exim/replacecf/no_forward_outbound_spam_over_int/reject_forwarded_mail_marked_as_spam is not owned by any package

    so normally I would expect that to survive updates.

    Just so we have it recorded, here is the default value for the "data" option:

    data = :fail: This mail cannot be forwarded because it was detected as spam.
    0
  • imorandin

    Great thanks!

    0
  • imorandin

    I confirm that the file gets overwritten after a cPanel update. I will make a hook or something to rewrite it then.

    Thanks.

     

    0
  • cPRex Jurassic Moderator

    Interesting - we must specifically force that file outside of an RPM.

    Do you think we should offer users a way to edit this specific function in the UI somewhere?

    0
  • imorandin

    Yes, I confirm it gets overwritten by the updater:

     grep "no_forward_outbound_spam_over_int" /var/cpanel/updatelogs/*
    /var/cpanel/updatelogs/update.2405960.1140678737.1756925052.log:[2026-01-13 16:18:28 -0300]   Retrieving and staging /cpanelsync/11.134.0.2/cpanel/etc/exim/replacecf/no_forward_outbound_spam_over_int/reject_forwarded_mail_marked_as_spam.xz

    It would be nice to have 2 extra options like these:

    • Do not bounce mail to external recipients when forwarding if it matches the Apache SpamAssassin™ internal spam_score setting (On or Off)
    • Do not bounce mail to external recipients when forwarding based on the defined Apache SpamAssassin™ score (On or Off)

    PS: I’ve just edited the previous post because the code was incorrect.

    0
  • cPRex Jurassic Moderator

    I've created a feature request and I'll talk to the team about this tomorrow.  I'll let you know what we discuss, likely early next week!

    0
  • imorandin

    Thanks!

    0
  • cPRex Jurassic Moderator

    We're looking into this on our end now.  I wonder instead of a toggle if we just changed it to create the file with the option that doesn't introduce backscatter - why would anyone want to send a bounce to a spam message?

    I'll post again once I have more details.

    1
  • Jeff

    cPRex +1 to this.

    We also raised a ticket #95865928 last month regarding the issue if it helps.

    0
  • imorandin

    I agree!

    0
  • cPRex Jurassic Moderator

    Alright, I talked with the team and we decided to make a case to see if the developers can tackle this one.  I've created case CPANEL-51267 and linked this thread to it, so if I hear any updates on my end I'll be sure to post!

    0
  • imorandin

    Great thanks!

    0
  • cPRex Jurassic Moderator

    Sure thing!

    0
  • Lyubomir Rusanov

    Hi cPRex,
    We are also running into this exact issue on our servers. 

    Is there any update on case CPANEL-51267? We’d love to know if a fix or an official configuration toggle is planned for an upcoming release.
    Thanks!

    0
  • cPRex Jurassic Moderator

    I know the issue is resolved in version 138, but I don't see that it's going to be backported to any previous versions.

    0
  • Lyubomir Rusanov

    Hello,

    Thank you for your response. Version 138 does not appear to exist at the moment, so I assume you may have meant version 136.

    However, I believe many users are currently using the LTS version, which is 134. We would really appreciate it if this fix could be backported to the LTS release.

    Thank you.

    0
  • cPRex Jurassic Moderator

    Nope, I meant version 138, it just hasn't been released yet.  It's my understanding that this is too big of a change to backport at this point.

    0
  • Lyubomir Rusanov

    Thank you for clarifying.

    I understand that version 138 has not been released yet, but that is exactly the concern. This means the issue is known, confirmed, and fixed internally, while production users on current stable/LTS versions are still left exposed with no official workaround.

    For hosting providers, this is not a theoretical issue. It affects real mail servers, sender reputation, queue management, and can result in RBL blocks due to backscatter.

    If this is not backported, does that mean providers using the LTS release will be forced to continue generating backscatter for another year or more until version 138 becomes available as LTS? That is a very concerning position for a confirmed production-impacting mail issue.

    If the change is too large to backport, can cPanel at least provide an officially supported temporary workaround or configuration recommendation for version 134/136 systems?

    Thank you.

    0
  • cPRex Jurassic Moderator

    Lyubomir Rusanov - the specific person I want to ask about this today isn't here.  I'll see if I can get you more details on this one tomorrow and I'll post once I have them!

    0
  • cPRex Jurassic Moderator

    I've been told that no decisions have been made about backporting on this issue just yet.  Since it hasn't been included in version 136 is also isn't scheduled for version 134 just yet.

    If I hear another update on my end I'll be sure to post.

    0
  • cPRex Jurassic Moderator

    The team looked at this and confirmed they aren't able to backport this to version 136 or 134, so it will only be fixed in version 138 and higher.

    While the LTS versions are stable, one of the downsides is that you won't receive all the fixes and updates, as that is just the nature of running on the LTS tier.

    0

Please sign in to leave a comment.