Hello,

I have been investigating some issues I have with a few machines and
envelope senders.
Since I want to keep envelopes intact inside my local network, I want to
do the cleaning up on my outgoing smarthost.

So after adding an entry to a check_sender_restricting, I get to see
that the smarthost receives e.g. x...@shell1.local.dohd.org as envelope
sender, and I want to change that to x...@dohd.org, the simplest case I
want to rewrite.

What have I done so far:

add the follow config to my main.cf (for Postfix 3.8.4, installed from FreeBSD 
pkg):

# some debugging to hopefully see what happens
debug_peer_level = 3
debug_peer_list = 10.0.0.170,10.0.0.220,[2a06:2602:1d:40::25]
# the adding of the envelope sender to a header
smtpd_sender_restrictions = check_sender_access 
regexp:$config_directory/sender_access
# the canonical mapping part
sender_canonical_classes = envelope_sender
sender_canonical_maps = regexp:$config_directory/sender_canonical


I have tested with and without, just to be sure.
  local_header_rewrite_clients=permit_mynetworks

The files here:

* sender_access:
/(.*)/  prepend X-Envelope-From: $1

* sender_canonical:
/^(.*)@shell1\.local\.dohd\.org$/i      $1...@dohd.org
/^<(.*)@shell1\.local\.dohd\.org>$/i    $1...@dohd.org

The second line was just an attempt based on what I saw in log files. Checked 
it with postmap -q to see what it does.

If I then send mail going through the relay, and check the maillog for 
canonical lines and the envelope lines:

Sep 16 08:15:58 s-mailrelay2 postfix/smtpd[95962]: < 
shell1.local.dohd.org[10.0.0.170]: MAIL FROM:<x...@shell1.local.dohd.org> 
SIZE=528
Sep 16 08:15:58 s-mailrelay2 postfix/smtpd[95962]: < 
shell1.local.dohd.org[10.0.0.170]: RCPT TO:<x...@dohd.org> 
ORCPT=rfc822;x...@dohd.org
Sep 16 08:15:58 s-mailrelay2 postfix/smtpd[95962]: maps_find: 
recipient_canonical_maps: x...@dohd.org: not found
Sep 16 08:15:58 s-mailrelay2 postfix/smtpd[95962]: maps_find: 
recipient_canonical_maps: @dohd.org: not found
Sep 16 08:15:58 s-mailrelay2 postfix/smtpd[95962]: maps_find: canonical_maps: 
x...@dohd.org: not found
Sep 16 08:15:58 s-mailrelay2 postfix/smtpd[95962]: maps_find: canonical_maps: 
@dohd.org: not found

So I don't see any action being taken for sender canonical mapping.

Does anyone have a slight hint what logging I should be looking for, or even 
better: what I'm doing wrong?

Kind regards,

Mark
-- 
 Ah, women.  They make the highs higher and the lows more frequent.     
        -- Friedrich Nietzsche                                          
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to