Hi all,
I have an odd setup in which each base directory contains a complete
virtual filesystem with potentially overlapping usernames (UIDs are
unique). domain1.com could consist of system user user1 (UID: 500),
user2 (UID: 501). domain2.com could consist of user1 (UID: 502), user12
(UID: 503), and so on. Any mail generated from shell that depends upon
Postfix to append $myorigin will append the server name instead of the
local virtual domain.
Setting $myhostname and $append_at_myorigin backfires with this setup,
because that happens after pickup in trivial-rewrite that operates
outside the virtual filesystem, so the real server name is always used.
Mapping these users via /etc/aliases won't work either since usernames
are not guaranteed to be unique across accounts.
Is there a way to either:
- Log the UID of pickup and rewrite sender based upon it
- Convert the sender into a FQDN before pickup, for example if mail
generates via cron
Here's a sample from a locally generated message,
*** ENVELOPE RECORDS active/5735B1C15862F ***
message_size: 480 298 1
0 480 0
message_arrival_time: Sat Dec 22 20:29:22 2018
create_time: Sat Dec 22 20:29:22 2018
named_attribute: rewrite_context=local
sender_fullname:
sender: msala...@my.server.name
named_attribute: dsn_orig_rcpt=rfc822;exam...@example.com
original_recipient: exam...@example.com
recipient: exam...@example.com
Ideally my.server.name would be converted to apisnetworks.com at or
before pickup so that any DSN can route back.
- Matt