51ee27f514
Fetches user_full_name (givenname + sn) and user_email from FreeIPA via ipalib and writes them into the Thunderbird IMAP account prefs. Adds ipalib availability check to logon_script.sh. Drops TB_MAIL_FULLNAME config variable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
429 B
Bash
Executable File
15 lines
429 B
Bash
Executable File
#!/usr/bin/env python3
|
|
from ipalib import api
|
|
from os import environ
|
|
|
|
api.bootstrap(context="cli", in_server=False)
|
|
api.finalize()
|
|
api.Backend.rpcclient.connect()
|
|
|
|
result = api.Command.user_show(environ['USER'])
|
|
user_email = result['result']['mail'][0]
|
|
user_full_name = result['result']['givenname'][0] + " " + result['result']['sn'][0]
|
|
print(result)
|
|
print(f"user_email: {user_email}")
|
|
print(f"user_full_name: {user_full_name}")
|