On Sat, Dec 22, 2018 at 07:32:37PM -0600, Matt Saladna wrote:

> 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

No, for this you also a separate Postfix instance for each logical
container.  By the time the mail leaves the container it is too
late.

-- 
        Viktor.

Reply via email to