Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/Exception/CouldNotConnectException.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ public function getReason(): string {

switch ($this->previous->getCode()) {
case Horde_Imap_Client_Exception::LOGIN_AUTHENTICATIONFAILED:
return 'AUTHENTICATION';
return match ($this->previous->getMessage()) {
'Authentication failed.' => 'AUTHENTICATION_WRONG_PASSWORD',
'Mail server denied authentication.' => 'AUTHENTICATION_DENIED',
default => 'AUTHENTICATION',
};
case Horde_Imap_Client_Exception::SERVER_CONNECT:
case Horde_Imap_Client_Exception::SERVER_READERROR:
return 'CONNECTION_ERROR';
Expand Down
14 changes: 13 additions & 1 deletion src/components/AccountForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<h3>{{ t('mail', 'SMTP Settings') }}</h3>
<NcInputField
id="man-smtp-host"
ref="smtpHost"

Check warning on line 150 in src/components/AccountForm.vue

View workflow job for this annotation

GitHub Actions / NPM lint

'smtpHost' is defined as ref, but never used
:value.sync="manualConfig.smtpHost"
:label="t('mail', 'SMTP Host')"
type="text"
Expand Down Expand Up @@ -683,12 +683,24 @@
} else if (error.data.service === 'SMTP') {
this.feedback = t('mail', 'SMTP server is not reachable')
}
} else if (error.data?.error === 'AUTHENTICATION') {
} else if (error.data?.error === 'AUTHENTICATION_WRONG_PASSWORD') {
if (error.data.service === 'IMAP') {
this.feedback = t('mail', 'IMAP username or password is wrong')
} else if (error.data.service === 'SMTP') {
this.feedback = t('mail', 'SMTP username or password is wrong')
}
} else if (error.data?.error === 'AUTHENTICATION_DENIED') {
if (error.data.service === 'IMAP') {
this.feedback = t('mail', 'IMAP server denied authentication')
} else if (error.data.service === 'SMTP') {
this.feedback = t('mail', 'SMTP server denied authentication')
}
} else if (error.data?.error === 'AUTHENTICATION') {
if (error.data.service === 'IMAP') {
this.feedback = t('mail', 'IMAP authentication error')
} else if (error.data.service === 'SMTP') {
this.feedback = t('mail', 'SMTP authentication error')
}
} else {
if (error.data?.service === 'IMAP') {
this.feedback = t('mail', 'IMAP connection failed')
Expand Down
Loading