Hello,

Here's my setup:
* Ubuntu 18.04 LTS
* Postfix 3.3.0
* Mailutils 3.4
* Samba 4.7.6
* Active Directory (provided by Samba)

My usernames are of the format:
* DOMAIN\username

I can separately maintain a list of mappings between DOMAIN\username
and username.

Here are the problems I'm looking to solve appropriately:
* mail - sends the origination user as "DOMAIN\username", which
postfix provides onto the destination mail exchanger, which rejects it
as being an incorrect format
* postfix - is configured with:
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
which flattens the return address to "domain\username", and creates a
mailbox in /var/mail as "domain\username". When the user types "mail"
to read their email, it opens "DOMAIN\username", so they never see
their newly received messages.

Things I have tried:
* Using
sender_canonical_maps = hash:\etc\postfix\sender_canonical
to change a specific DOMAIN\username to username. It didn't work,
although I could see it parsing sender_canonical.db when sending. The
exact line was
DOMAIN\\username : username
Postfix still provided "DOMAIN\username" as the originator to the
destination mail exchanger.
* Using
recipient_canonical_maps = hash:\etc\postfix\recipient_canonical
to convert a specific username back to DOMAIN\username. That failed
because the output is still casefolded to domain\username before
writing to the mailbox file.

Questions:
* Am I trying the right approach to rewriting the originating email
address from DOMAIN\username to username? What am I potentially
missing to get it working?
* As postfix will always fold the return address to lowercase (because
of the local_recipient_maps filter), should I just softlink together
the mailbox files DOMAIN\username and domain\username in /var/mail, or
is there a solution I can put into postfix to revert back to
DOMAIN\username before outputting to the mail file?

Thanks in advance,

-- 
Nick

Reply via email to