expose imap username field (#15866)

Had an edge with a customer where they had a custom username.
This commit is contained in:
neo773
2025-11-18 21:42:02 +05:30
committed by GitHub
parent 347e855b1f
commit cbb5bce500
3 changed files with 22 additions and 2 deletions
@@ -120,6 +120,23 @@ export const SettingsAccountsConnectionForm = ({
)}
/>
<Controller
name="IMAP.username"
control={control}
render={({ field, fieldState }) => (
<SettingsTextInput
instanceId="imap-username-connection-form"
label={t`IMAP Username (Optional)`}
placeholder={t`john.doe`}
type="text"
value={field.value || ''}
required={false}
onChange={field.onChange}
error={fieldState.error?.message}
/>
)}
/>
<Controller
name="IMAP.password"
control={control}
@@ -31,7 +31,7 @@ export class ImapSmtpCaldavService {
port: params.port,
secure: params.secure ?? true,
auth: {
user: handle,
user: params.username ?? handle,
pass: params.password,
},
logger: false,
@@ -1,5 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import { isNonEmptyString } from '@sniptt/guards';
import { ImapFlow } from 'imapflow';
import { ConnectedAccountProvider } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -88,7 +89,9 @@ export class ImapClientProvider {
port: connectionParameters.IMAP?.port || 993,
secure: connectionParameters.IMAP?.secure,
auth: {
user: connectedAccount.handle,
user: isNonEmptyString(connectionParameters.IMAP?.username)
? connectionParameters.IMAP?.username
: connectedAccount.handle,
pass: connectionParameters.IMAP?.password || '',
},
logger: false,