email: Local delivery: use full email address

If the domain part was not provided, $myhostname will be used.
In case $myhostname is not in $mydestinations, the email will be relayed.
In case $myhostname is invalid, the email will be bounced.

The next hop should always be LMTP (local: transport)
and hence the `@localhost`
This commit is contained in:
fliu 2021-08-10 23:40:56 +00:00 committed by Sunil Mohan Adapa
parent 2f77d99899
commit b172b0b1cd
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 3 additions and 1 deletions

View File

@ -125,7 +125,8 @@ def schedule_hash_update():
alias = models.Alias(**row)
key = alias.email_name.encode('ascii') + b'\0'
if alias.enabled:
value = str(alias.uid_number).encode('ascii') + b'\0'
value = str(alias.uid_number).encode('ascii')
value += b'@localhost\0'
else:
value = b'/dev/null\0'
db[key] = value

View File

@ -7,3 +7,4 @@ server_host = ldap://127.0.0.1
search_base = dc=thisbox
query_filter = (&(objectClass=posixAccount)(uid=%s))
result_attribute = uidNumber
result_format = %s@localhost