mail page imap connection mime 5 bis rest 9
This commit is contained in:
parent
485ce9d624
commit
2a607b20fd
@ -3,15 +3,20 @@ import Imap from 'imap';
|
||||
import { simpleParser } from 'mailparser';
|
||||
|
||||
// IMAP configuration
|
||||
const imapConfig = {
|
||||
user: process.env.IMAP_USER || 'alma@governance-labs.org',
|
||||
password: process.env.IMAP_PASSWORD || '',
|
||||
host: 'mail.infomaniak.com',
|
||||
port: 993,
|
||||
const imapConfig: Imap.Config = {
|
||||
user: process.env.IMAP_USER as string,
|
||||
password: process.env.IMAP_PASSWORD as string,
|
||||
host: process.env.IMAP_HOST || 'mail.infomaniak.com',
|
||||
port: parseInt(process.env.IMAP_PORT || '993', 10),
|
||||
tls: true,
|
||||
tlsOptions: { rejectUnauthorized: false }
|
||||
};
|
||||
|
||||
// Validate IMAP configuration
|
||||
if (!imapConfig.user || !imapConfig.password) {
|
||||
throw new Error('IMAP credentials are not properly configured. Please check your .env file.');
|
||||
}
|
||||
|
||||
interface ImapMessage {
|
||||
header: {
|
||||
from?: string[];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user