On Fri, 12 Apr 2013, Wietse Venema wrote:

You need to do "postfix reload" after editing master.cf.

I did.  I did it again for good measure - no difference.

The submission_cleanup service will see the Received: header that
was prepended by the submission server.

Is there any way I can be sure that the special cleanup agent is running? I see the socket /var/spool/postfix/public/submission_cleanup

However, if your Milter adds headers then those aren't seen by
header_checks; you would need to use milter_header_checks.

We don't appear to be using any milters, despite the 'milter_macro_daemon_name=ORIGINATING'

Here's what I did in case I messed up:

master.cf:

# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
submission inet n       -       -       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
  # Use a special cleanup service so we can strip headers.
  -o cleanup_service=submission_cleanup

smtps     inet  n       -       -       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
  # Use a special cleanup service so we can strip headers.
  -o cleanup_service=submission_cleanup

submission_cleanup   unix  n       -       -       -       -       cleanup
  # Strip Received: lines from authenticated mail
  -o header_checks=pcre:/etc/postfix/header_checks



/etc/postfix/header_checks:

# Remove any Received: headers from authenticated mail.
/^Received:/    IGNORE



An example message. The line is matched if I run it through postmap. Some details have to be obscured, sorry. I'm on holiday so I'm not worried about letting the hostname through, you can all get it from my headers anyway. Obviously I'm not posting from my work address.

Return-Path: <my.addr...@example.com>
X-Original-To: my.addr...@example.com
Delivered-To: my.addr...@example.com
Received: from [192.168.0.20] (dsl-mlibrasgw2-50de1c-161.dhcp.inet.fi [80.222.28.161])
    by mail.example.com (Postfix) with ESMTPSA id DED281C40E9
for <my.addr...@example.com>; Fri, 12 Apr 2013 14:35:47 +0000 (UTC)
Date: Fri, 12 Apr 2013 17:35:44 +0300 (EEST)
From: Geoff Shang <my.addr...@example.com>
X-X-Sender: ge...@my-pc.home
To: my.addr...@example.com
Subject: test
Message-ID: <alpine.deb.2.02.1304121735310.14...@my-pc.home>
User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

 Geoff.\

Reply via email to