using amavisd-new 2.10.1 on Debian 8 I want to modify the banned reason as 

%smtp_reason_by_ccat = (
  # currently only used for blocked messages only, status 5xx
  # a multiline message will produce a valid multiline SMTP response
  CC_VIRUS,       'id=%n - INFECTED: %V',
  # CC_BANNED,      'id=%n - BANNED: %F',
  CC_BANNED,      'id=%n - Unwanted attachment (%F)',
  CC_UNCHECKED.',1', 'id=%n - UNCHECKED: encrypted',
  CC_UNCHECKED.',2', 'id=%n - UNCHECKED: over limits',
  CC_UNCHECKED,      'id=%n - UNCHECKED',
  CC_SPAM,        'id=%n - spam',
  CC_SPAMMY.',1', 'id=%n - spammy (tag3)',
  CC_SPAMMY,      'id=%n - spammy',
  CC_BADH.',1',   'id=%n - BAD HEADER: MIME error',
  CC_BADH.',2',   'id=%n - BAD HEADER: nonencoded 8-bit character',
  CC_BADH.',3',   'id=%n - BAD HEADER: contains invalid control character',
  CC_BADH.',4',   'id=%n - BAD HEADER: line made up entirely of whitespace',
  CC_BADH.',5',   'id=%n - BAD HEADER: line longer than RFC 5322 limit',
  CC_BADH.',6',   'id=%n - BAD HEADER: syntax error',
  CC_BADH.',7',   'id=%n - BAD HEADER: missing required header field',
  CC_BADH.',8',   'id=%n - BAD HEADER: duplicate header field',
  CC_BADH,        'id=%n - BAD HEADER',
  CC_OVERSIZED,   'id=%n - Message size exceeds recipient\'s size limit',
  CC_MTA.',1',    'id=%n - Temporary MTA failure on relaying',
  CC_MTA.',2',    'id=%n - Rejected by next-hop MTA on relaying',
  CC_MTA,         'id=%n - Unable to relay message back to MTA',
  CC_CLEAN,       'id=%n - CLEAN',
  CC_CATCHALL,    'id=%n - OTHER',  # should not happen

If I put this whole modified section to /etc/amavis/conf.d/50-user then it 
works, so banned files are rejected with "554 5.7.0 Reject, id=xxxxx-yy - 
Unwanted attachment...".

Is it possible to modify the reason in 50-user with only one line? I already 
tried the following but it didn't work:

$smtp_reason_by_ccat{CC_BANNED} = 'id=%n - Unwanted attachment (%F)';
$smtp_reason_by_ccat{'CC_BANNED'} = 'id=%n - Unwanted attachment (%F)';



Reply via email to