fix(07): SMTP test warns when connection passes but no auth configured
Server reachable without credentials (port 25 open relay) returns
{ success: true, warning: 'no_auth' } instead of green success.
Frontend shows red warning: server reachable but emails will fail.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -115,7 +115,9 @@ export function SmtpSettingsForm() {
|
||||
setTestFeedback({ type: 'loading', message: t('smtp.testTesting') });
|
||||
try {
|
||||
const result = await testSmtp(buildPayload());
|
||||
if (result.success) {
|
||||
if (result.success && result.warning === 'no_auth') {
|
||||
setTestFeedback({ type: 'error', message: t('smtp.testNoAuth') });
|
||||
} else if (result.success) {
|
||||
setTestFeedback({ type: 'success', message: t('smtp.testSuccess') });
|
||||
} else {
|
||||
setTestFeedback({ type: 'error', message: t('smtp.testFailed') });
|
||||
|
||||
@@ -77,7 +77,7 @@ export async function saveSmtp(payload: SaveSmtpPayload): Promise<SmtpConfig> {
|
||||
*/
|
||||
export async function testSmtp(
|
||||
payload: SaveSmtpPayload,
|
||||
): Promise<{ success: boolean }> {
|
||||
): Promise<{ success: boolean; warning?: string }> {
|
||||
const res = await fetch(`${API_URL}/settings/smtp/test`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
||||
@@ -135,7 +135,8 @@
|
||||
"hidePassword": "Passwort verbergen",
|
||||
"testTesting": "Verbindung wird getestet...",
|
||||
"testSuccess": "Verbindung erfolgreich",
|
||||
"testFailed": "Verbindung fehlgeschlagen"
|
||||
"testFailed": "Verbindung fehlgeschlagen",
|
||||
"testNoAuth": "Server erreichbar, aber keine Zugangsdaten konfiguriert — E-Mail-Versand wird fehlschlagen"
|
||||
}
|
||||
},
|
||||
"widgets": {
|
||||
|
||||
Reference in New Issue
Block a user