Skip to content

Commit

Permalink
fix: caldav fix for alias
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Oct 8, 2024
1 parent d2c73b4 commit a553366
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions helpers/on-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,13 @@ async function onAuth(auth, session, fn) {
if (
this.server instanceof IMAPServer ||
this.server instanceof POP3Server ||
this?.constructor?.name === 'CalDAV'
(alias && this?.constructor?.name === 'CalDAV')
) {
if (typeof alias.is_rekey === 'boolean' && alias.is_rekey === true)
if (
alias &&
typeof alias.is_rekey === 'boolean' &&
alias.is_rekey === true
)
throw new SMTPError(
'Alias is undergoing a rekey operation, please try again once completed',
{
Expand All @@ -219,7 +223,10 @@ async function onAuth(auth, session, fn) {
}
);

if (!Array.isArray(alias.tokens) || alias?.tokens?.length === 0)
if (
(alias && !Array.isArray(alias.tokens)) ||
alias?.tokens?.length === 0
)
throw new SMTPError(
`Alias does not have a generated password yet, go to ${
config.urls.web
Expand Down

0 comments on commit a553366

Please sign in to comment.