1

My mailserver is receiving spam with an empty Subject line, and I want to modify the subject line to have some text in it so applications can filter on it - however I am struggling to do this.

One of the things I've attempted, unsuccessfully, is to use a header_checks directive to do this - can anyone provide advice why this may not be be working.

main.cf has a line:

  header_checks = regexp:/etc/postfix/header_checks

/etc/postfix/header_checks includes:

  /^Subject:$/          REPLACE Subject: No Subject Line
  /^Subject: $/         REPLACE Subject: No Subject Line

I've restarted postfix after making this change.

I do note I have an entry in master.cf for AV filtering as follows (but don't think its relevant - I only mention it because it is the only place the phrase "header" exists in that file :

  127.0.0.1:10026 inet  n -       n       -       16      smtpd
    -o content_filter=
    -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    -o smtpd_helo_restrictions=
    -o smtpd_client_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks_style=host
    -o smtpd_authorized_xforward_hosts=127.0.0.0/8

When I look at copies of the spam, it appears as best I can tell that the subject line reads

  Subject:

(With no space after the colon.)

davidgo
  • 6,222
  • 3
  • 23
  • 41
  • Your AV software might be rewriting the subject line, removing [superfluous encoding](https://serverfault.com/questions/876540/how-can-i-reject-base64-encoded-spam-email). Use `WARN` (similar to `REPLACE`) to see the raw header as it enters your system. – anx Feb 24 '19 at 08:30

0 Answers0