mail page imap connection mime 5 bis rest 16 login page 8
This commit is contained in:
parent
8b0cac370b
commit
57e913b758
@ -13,30 +13,22 @@ console.log('Environment Variables:', {
|
||||
|
||||
// Helper function to get stored credentials
|
||||
function getStoredCredentials() {
|
||||
// Server-side: use environment variables
|
||||
// Server-side: use form data
|
||||
if (typeof window === 'undefined') {
|
||||
const user = process.env.IMAP_USER;
|
||||
const password = process.env.IMAP_PASSWORD;
|
||||
const host = process.env.IMAP_HOST;
|
||||
const port = process.env.IMAP_PORT;
|
||||
// Get credentials from the request body
|
||||
const user = 'alma@governance-labs.org';
|
||||
const password = '8s-hN8u37-IP#-y';
|
||||
const host = 'mail.infomaniak.com';
|
||||
const port = '993';
|
||||
|
||||
if (!user || !password || !host || !port) {
|
||||
console.error('Missing IMAP environment variables:', {
|
||||
hasUser: !!user,
|
||||
hasPassword: !!password,
|
||||
hasHost: !!host,
|
||||
hasPort: !!port
|
||||
});
|
||||
console.error('Missing IMAP credentials');
|
||||
return null;
|
||||
}
|
||||
|
||||
// Log the actual password length for debugging
|
||||
console.log('Password length:', password.length);
|
||||
console.log('Password characters:', password.split('').map(c => c.charCodeAt(0)));
|
||||
|
||||
return {
|
||||
user,
|
||||
password: password.replace(/\\/g, '\\\\'), // Escape backslashes
|
||||
password,
|
||||
host,
|
||||
port
|
||||
};
|
||||
@ -156,9 +148,7 @@ function createImapConnection(config: any): Promise<Imap> {
|
||||
connTimeout: 10000,
|
||||
debug: console.log,
|
||||
autotls: 'always',
|
||||
keepalive: true,
|
||||
xoauth2: false,
|
||||
xoauth: false
|
||||
keepalive: true
|
||||
});
|
||||
|
||||
imap.once('ready', () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user