Skip to main content

Exim: blocking spam forwarding causes bounces / frozen messages

Comments

14 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

Please sign in to leave a comment.