Skip to content

Commit d5bcc14

Browse files
committed
feat(imap): added parity, tested
1 parent 5f8d769 commit d5bcc14

File tree

9 files changed

+239
-108
lines changed

9 files changed

+239
-108
lines changed

apps/docs/components/icons.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ export function MailServerIcon(props: SVGProps<SVGSVGElement>) {
305305
fill='none'
306306
xmlns='http://www.w3.org/2000/svg'
307307
>
308-
{/* Server/inbox icon with mail symbol */}
309308
<rect
310309
x='3'
311310
y='4'

apps/sim/app/api/tools/imap/mailboxes/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export async function POST(request: NextRequest) {
4242
try {
4343
await client.connect()
4444

45-
// List all mailboxes
4645
const listResult = await client.list()
4746
const mailboxes = listResult.map((mailbox) => ({
4847
path: mailbox.path,
@@ -52,7 +51,6 @@ export async function POST(request: NextRequest) {
5251

5352
await client.logout()
5453

55-
// Sort mailboxes: INBOX first, then alphabetically
5654
mailboxes.sort((a, b) => {
5755
if (a.path === 'INBOX') return -1
5856
if (b.path === 'INBOX') return 1
@@ -64,7 +62,6 @@ export async function POST(request: NextRequest) {
6462
mailboxes,
6563
})
6664
} catch (error) {
67-
// Make sure to close connection on error
6865
try {
6966
await client.logout()
7067
} catch {
@@ -76,7 +73,6 @@ export async function POST(request: NextRequest) {
7673
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
7774
logger.error('Error fetching IMAP mailboxes:', errorMessage)
7875

79-
// Provide user-friendly error messages
8076
let userMessage = 'Failed to connect to IMAP server'
8177
if (
8278
errorMessage.includes('AUTHENTICATIONFAILED') ||

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ export function Dropdown({
113113
const value = isPreview ? previewValue : propValue !== undefined ? propValue : storeValue
114114

115115
const singleValue = multiSelect ? null : (value as string | null | undefined)
116-
const multiValues = multiSelect ? (value as string[] | null | undefined) || [] : null
116+
const multiValues = multiSelect
117+
? Array.isArray(value)
118+
? value
119+
: value
120+
? [value as string]
121+
: []
122+
: null
117123

118124
const fetchOptionsIfNeeded = useCallback(async () => {
119125
if (!fetchOptions || isPreview || disabled) return

apps/sim/blocks/blocks/imap.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const ImapBlock: BlockConfig = {
3535
},
3636
outputs: {
3737
// Trigger outputs (from email)
38-
uid: { type: 'string', description: 'IMAP message UID' },
3938
messageId: { type: 'string', description: 'RFC Message-ID header' },
4039
subject: { type: 'string', description: 'Email subject line' },
4140
from: { type: 'string', description: 'Sender email address' },

apps/sim/components/icons.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ export function MailServerIcon(props: SVGProps<SVGSVGElement>) {
305305
fill='none'
306306
xmlns='http://www.w3.org/2000/svg'
307307
>
308-
{/* Server/inbox icon with mail symbol */}
309308
<rect
310309
x='3'
311310
y='4'

0 commit comments

Comments
 (0)