How can I change the reject message when a message is rejected from the spam kill level?

Overview

By default, when Amavis rejects an email due to exceeding the configured spam kill level, it returns a generic response:

554 5.7.0 Reject, id=27440-12 - spam (in reply to end of DATA command)

This article provides instructions for customizing this rejection message with a more descriptive policy-based response on supported Linux distributions.

Prerequisites

  • Root or sudo access to the mail server
  • Amavis installed and actively processing mail

Procedure

To modify the spam rejection response, complete the following steps:

  1. Open the appropriate configuration file for your operating system using a text editor:
    • AlmaLinux/CloudLinux/RHEL: /etc/amavisd/warden.conf
    • Debian/Ubuntu: /etc/amavis/conf.d/99-warden
  2. Add the following configuration line to the file:
    $smtp_reason_by_ccat{&CC_SPAM} = 'id=%n - rejected for policy reasons';
  3. Save and close the configuration file.
  4. Restart the Amavis service to apply the changes:
    • AlmaLinux/CloudLinux/RHEL:
      systemctl restart amavisd
    • Debian/Ubuntu:
      systemctl restart amavis

Troubleshooting

If the custom rejection message does not appear after restarting the service, verify the following:

  • Confirm that the configuration file was saved correctly and contains no syntax errors.
  • Check the Amavis service status to ensure it restarted successfully without errors.
  • spam kill level
  • 0 用戶發現這個有用
這篇文章有幫助嗎?

相關文章

How can I install or upgrade the extension?

We provide free installation and configuration for all our paid licenses. Open a support ticket...

How can I add stronger Postfix restrictions so that the bulk of spam is rejected at the SMTPD level before it gets processed by Amavis?

Overview Warden enables administrators to enforce stricter Postfix SMTPD restrictions. These...

How can I change the interface language of the extension?

Overview This article provides instructions on how to change the interface language within the...

How can I configure greylisting with Warden Anti-spam and Virus protection?

Overview Greylisting is an email filtering mechanism designed to mitigate spam by temporarily...