Näytä SMTP-portti ja salaus aina mailbox-lomakkeessa

Portti ja salaus tarvitaan aina (IMAP=993/SSL vs SMTP=587/TLS),
joten ne näkyvät nyt checkboxin tilasta riippumatta.
"Käytä samoja tunnuksia" piilottaa vain palvelimen, käyttäjän
ja salasanan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 23:14:20 +02:00
parent eaf47d5b78
commit 2da63262a7
2 changed files with 10 additions and 10 deletions

View File

@@ -832,9 +832,10 @@
</div>
<div id="smtp-custom-fields">
<div class="form-group"><label>Palvelin</label><input type="text" id="mailbox-form-smtp-host" placeholder="mail.yritys.fi"></div>
<div class="form-group"><label>Portti</label><input type="number" id="mailbox-form-smtp-port" value="587" placeholder="587"></div>
<div class="form-group"><label>Käyttäjätunnus</label><input type="text" id="mailbox-form-smtp-user" placeholder="asiakaspalvelu@yritys.fi"></div>
<div class="form-group"><label>Salasana</label><input type="password" id="mailbox-form-smtp-pass" placeholder="••••••••"></div>
</div>
<div class="form-group"><label>Portti</label><input type="number" id="mailbox-form-smtp-port" value="587" placeholder="587"></div>
<div class="form-group"><label>Salaus</label>
<select id="mailbox-form-smtp-encryption">
<option value="tls">STARTTLS</option>
@@ -844,7 +845,6 @@
</div>
</div>
</div>
</div>
<!-- Lähettäjätiedot -->
<div class="form-grid" style="margin-top:0.75rem;">
<div class="form-group">

View File

@@ -2583,10 +2583,10 @@ document.getElementById('btn-save-mailbox').addEventListener('click', async () =
smtp_from_email: document.getElementById('mailbox-form-smtp-email').value,
smtp_from_name: document.getElementById('mailbox-form-smtp-name').value,
smtp_host: useSame ? imapHost : document.getElementById('mailbox-form-smtp-host').value,
smtp_port: useSame ? 587 : (parseInt(document.getElementById('mailbox-form-smtp-port').value) || 587),
smtp_port: parseInt(document.getElementById('mailbox-form-smtp-port').value) || 587,
smtp_user: useSame ? imapUser : document.getElementById('mailbox-form-smtp-user').value,
smtp_password: useSame ? imapPass : document.getElementById('mailbox-form-smtp-pass').value,
smtp_encryption: useSame ? 'tls' : document.getElementById('mailbox-form-smtp-encryption').value,
smtp_encryption: document.getElementById('mailbox-form-smtp-encryption').value,
aktiivinen: true,
};
try {