Skip to content

Avoid an error if ipadefaultemaildomain is not defined#1289

Open
proxyconcept wants to merge 1 commit intofreeipa:masterfrom
proxyconcept:fix-ipauser-without-default-email-domain
Open

Avoid an error if ipadefaultemaildomain is not defined#1289
proxyconcept wants to merge 1 commit intofreeipa:masterfrom
proxyconcept:fix-ipauser-without-default-email-domain

Conversation

@proxyconcept
Copy link
Copy Markdown

The IPA configuration ipadefaultemaildomain is optional (in this case, the key don't exist).

It's usefull to unset the default email domain, because it disables the auto-generation of an email address when creating a new user. But when we have this type of configuration, the module ipauser always failed (with or without email) :

msg: '''ipadefaultemaildomain'''

While it's permitted by the FreeIPA server to have no default email domain, the module assumes that there must be one configured.

This PR simply check if this parameter exists. If not, AND if ever the module is called with a "short" email address that needs to be extended, so no miracle : it will failed with a message like this

msg: 'user_mod: testuser: invalid ''email'': invalid e-mail format: testuser@None'

But in this case I think it is a legitimate failure (the request is not compatible with the server configuration) and the message remains relatively understandable.

The IPA configuration "ipadefaultemaildomain" is optional (in this case the key don't exist)
@t-woerner
Copy link
Copy Markdown
Member

@proxyconcept Thanks for the PR.
Yes, the current behaviour of the module is wrong. Additionally to your change there needs to be an extra check to ensure that the task fails with an invalid email address and not defaultemaildomain set.

@rjeffman
Copy link
Copy Markdown
Member

In my opinion, the default e-mail domain configuration is broken on FreeIPA side (https://pagure.io/freeipa/issue/9680).

I suggest we wait for a decision/fix there before we change anything.

@rjeffman rjeffman added the FreeIPA Depends an a FreeIPA issue. label Nov 4, 2024
@rjeffman rjeffman changed the title Avoid an error if ipadefaultemaildomain if not defined Avoid an error if ipadefaultemaildomain is not defined Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug FreeIPA Depends an a FreeIPA issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants