feat(account): Prioritize dedicated name field for IMAP authentication username #28

Refactor account authentication logic to prioritize the `name` field over the `email` field during the IMAP connection phase.

- The `name` field now serves as the primary IMAP login credential and is no longer treated purely as an optional, descriptive field.
- If the `name` field is empty or unset, the system will fall back to using the full `email` address for authentication.
- This change supports IMAP providers that require a username different from the full email address (e.g., employee ID, specific account name).
This commit is contained in:
rustmailer
2025-12-03 03:48:39 +08:00
parent 3a2b42f5c3
commit 454950374f
22 changed files with 25 additions and 7 deletions
@@ -190,7 +190,7 @@ export function NoSyncAccountDialog({ currentRow, open, onOpenChange }: Props) {
</FormItem>
)}
/>
<FormField
{/* <FormField
control={form.control}
name="name"
render={({ field }) => (
@@ -205,7 +205,7 @@ export function NoSyncAccountDialog({ currentRow, open, onOpenChange }: Props) {
<FormMessage />
</FormItem>
)}
/>
/> */}
<FormField
control={form.control}
name='enabled'
@@ -77,7 +77,7 @@ export default function Step1({ isEdit }: StepProps) {
<FormControl>
<Input placeholder={t('accounts.namePlaceholder')} {...field} />
</FormControl>
<FormDescription>{t('accounts.optional')}</FormDescription>
<FormDescription>{t('accounts.nameDescription')}</FormDescription>
<FormMessage />
</FormItem>
)}