nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
107 stars 64 forks source link

Add username prefix option for IMAP authentication #162

Open hschletz opened 3 years ago

hschletz commented 3 years ago

Adds another option to IMAP authentication. If configured, this prefix will be prepended to the username before authenticating against an IMAP server. The prefix is used for authentication only and not part of the Nextcloud username, making it invisible to the end-user.

Use case: Our company's mail provider uses a cryptic prefix for usernames, and there ist nothing we could do about it. For example, a user's mail address would be username@example.com, but the IMAP username would be something like gr5418962-username. To save our users from having to memorize a seemingly random character sequence, this PR allows adding the prefix to the plugin config:

array (
    0 => 'mail.example.com',
    1 => 143,
    2 => 'tls',
    3 => NULL,
    4 => true,
    5 => false,
    6 => 'gr5418962-',
),

This allows logging in as username, which will also be the Nextcloud username. The prefix will never become visible to the user or the application.