Fossil SCM

On the notification setup page, add a Refresh button to Status. Make Relay the first choice.

drh 2025-04-07 05:06 trunk
Commit cad72b796fe4336eb580ece92e0dd19e0361493d10a4491f241fc4cb499d20f9
1 file changed +21 -20
+21 -20
--- src/alerts.c
+++ src/alerts.c
@@ -295,14 +295,14 @@
295295
** Normally accessible via the /Admin/Notification menu.
296296
*/
297297
void setup_notification(void){
298298
static const char *const azSendMethods[] = {
299299
"off", "Disabled",
300
- "pipe", "Pipe to a command",
300
+ "relay", "SMTP relay",
301301
"db", "Store in a database",
302302
"dir", "Store in a directory",
303
- "relay", "SMTP relay"
303
+ "pipe", "Pipe to a command",
304304
};
305305
login_check_credentials();
306306
if( !g.perm.Setup ){
307307
login_needed(0);
308308
return;
@@ -311,22 +311,25 @@
311311
312312
alert_submenu_common();
313313
style_submenu_element("Send Announcement","%R/announce");
314314
style_set_current_feature("alerts");
315315
style_header("Email Notification Setup");
316
- @ <h1>Status</h1>
316
+ @ <form action="%R/setup_notification" method="post"><div>
317
+ @ <h1>Status &ensp; <input type="submit" name="submit" value="Refresh"></h1>
318
+ @ </form>
317319
@ <table class="label-value">
318320
if( alert_enabled() ){
319321
stats_for_email();
320322
}else{
321323
@ <th>Disabled</th>
322324
}
323325
@ </table>
324326
@ <hr>
325
- @ <h1> Configuration </h1>
326327
@ <form action="%R/setup_notification" method="post"><div>
327
- @ <input type="submit" name="submit" value="Apply Changes"><hr>
328
+ @ <h1> Configuration </h1>
329
+ @ <p><input type="submit" name="submit" value="Apply Changes"></p>
330
+ @ <hr>
328331
login_insert_csrf_secret();
329332
330333
entry_attribute("Canonical Server URL", 40, "email-url",
331334
"eurl", "", 0);
332335
@ <p><b>Required.</b>
@@ -391,38 +394,36 @@
391394
@ <p>How to send email. Requires auxiliary information from the fields
392395
@ that follow. Hint: Use the <a href="%R/announce">/announce</a> page
393396
@ to send test message to debug this setting.
394397
@ (Property: "email-send-method")</p>
395398
alert_schema(1);
399
+ entry_attribute("SMTP Relay Host", 60, "email-send-relayhost",
400
+ "esrh", "localhost:25", 0);
401
+ @ <p>When the send method is "SMTP relay", each email message is
402
+ @ transmitted via the SMTP protocol (rfc5321) to a "Mail Submission
403
+ @ Agent" or "MSA" (rfc4409) at the hostname shown here. Optionally
404
+ @ append a colon and TCP port number (ex: smtp.example.com:587).
405
+ @ The default TCP port number is 25.
406
+ @ (Property: "email-send-relayhost")</p>
407
+ entry_attribute("Store Emails In This Database", 60, "email-send-db",
408
+ "esdb", "", 0);
409
+ @ <p>When the send method is "store in a database", each email message is
410
+ @ stored in an SQLite database file with the name given here.
411
+ @ (Property: "email-send-db")</p>
396412
entry_attribute("Pipe Email Text Into This Command", 60, "email-send-command",
397413
"ecmd", "sendmail -ti", 0);
398414
@ <p>When the send method is "pipe to a command", this is the command
399415
@ that is run. Email messages are piped into the standard input of this
400416
@ command. The command is expected to extract the sender address,
401417
@ recipient addresses, and subject from the header of the piped email
402418
@ text. (Property: "email-send-command")</p>
403
-
404
- entry_attribute("Store Emails In This Database", 60, "email-send-db",
405
- "esdb", "", 0);
406
- @ <p>When the send method is "store in a database", each email message is
407
- @ stored in an SQLite database file with the name given here.
408
- @ (Property: "email-send-db")</p>
409
-
410419
entry_attribute("Store Emails In This Directory", 60, "email-send-dir",
411420
"esdir", "", 0);
412421
@ <p>When the send method is "store in a directory", each email message is
413422
@ stored as a separate file in the directory shown here.
414423
@ (Property: "email-send-dir")</p>
415424
416
- entry_attribute("SMTP Relay Host", 60, "email-send-relayhost",
417
- "esrh", "", 0);
418
- @ <p>When the send method is "SMTP relay", each email message is
419
- @ transmitted via the SMTP protocol (rfc5321) to a "Mail Submission
420
- @ Agent" or "MSA" (rfc4409) at the hostname shown here. Optionally
421
- @ append a colon and TCP port number (ex: smtp.example.com:587).
422
- @ The default TCP port number is 25.
423
- @ (Property: "email-send-relayhost")</p>
424425
@ <hr>
425426
426427
@ <p><input type="submit" name="submit" value="Apply Changes"></p>
427428
@ </div></form>
428429
db_end_transaction(0);
429430
--- src/alerts.c
+++ src/alerts.c
@@ -295,14 +295,14 @@
295 ** Normally accessible via the /Admin/Notification menu.
296 */
297 void setup_notification(void){
298 static const char *const azSendMethods[] = {
299 "off", "Disabled",
300 "pipe", "Pipe to a command",
301 "db", "Store in a database",
302 "dir", "Store in a directory",
303 "relay", "SMTP relay"
304 };
305 login_check_credentials();
306 if( !g.perm.Setup ){
307 login_needed(0);
308 return;
@@ -311,22 +311,25 @@
311
312 alert_submenu_common();
313 style_submenu_element("Send Announcement","%R/announce");
314 style_set_current_feature("alerts");
315 style_header("Email Notification Setup");
316 @ <h1>Status</h1>
 
 
317 @ <table class="label-value">
318 if( alert_enabled() ){
319 stats_for_email();
320 }else{
321 @ <th>Disabled</th>
322 }
323 @ </table>
324 @ <hr>
325 @ <h1> Configuration </h1>
326 @ <form action="%R/setup_notification" method="post"><div>
327 @ <input type="submit" name="submit" value="Apply Changes"><hr>
 
 
328 login_insert_csrf_secret();
329
330 entry_attribute("Canonical Server URL", 40, "email-url",
331 "eurl", "", 0);
332 @ <p><b>Required.</b>
@@ -391,38 +394,36 @@
391 @ <p>How to send email. Requires auxiliary information from the fields
392 @ that follow. Hint: Use the <a href="%R/announce">/announce</a> page
393 @ to send test message to debug this setting.
394 @ (Property: "email-send-method")</p>
395 alert_schema(1);
 
 
 
 
 
 
 
 
 
 
 
 
 
396 entry_attribute("Pipe Email Text Into This Command", 60, "email-send-command",
397 "ecmd", "sendmail -ti", 0);
398 @ <p>When the send method is "pipe to a command", this is the command
399 @ that is run. Email messages are piped into the standard input of this
400 @ command. The command is expected to extract the sender address,
401 @ recipient addresses, and subject from the header of the piped email
402 @ text. (Property: "email-send-command")</p>
403
404 entry_attribute("Store Emails In This Database", 60, "email-send-db",
405 "esdb", "", 0);
406 @ <p>When the send method is "store in a database", each email message is
407 @ stored in an SQLite database file with the name given here.
408 @ (Property: "email-send-db")</p>
409
410 entry_attribute("Store Emails In This Directory", 60, "email-send-dir",
411 "esdir", "", 0);
412 @ <p>When the send method is "store in a directory", each email message is
413 @ stored as a separate file in the directory shown here.
414 @ (Property: "email-send-dir")</p>
415
416 entry_attribute("SMTP Relay Host", 60, "email-send-relayhost",
417 "esrh", "", 0);
418 @ <p>When the send method is "SMTP relay", each email message is
419 @ transmitted via the SMTP protocol (rfc5321) to a "Mail Submission
420 @ Agent" or "MSA" (rfc4409) at the hostname shown here. Optionally
421 @ append a colon and TCP port number (ex: smtp.example.com:587).
422 @ The default TCP port number is 25.
423 @ (Property: "email-send-relayhost")</p>
424 @ <hr>
425
426 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
427 @ </div></form>
428 db_end_transaction(0);
429
--- src/alerts.c
+++ src/alerts.c
@@ -295,14 +295,14 @@
295 ** Normally accessible via the /Admin/Notification menu.
296 */
297 void setup_notification(void){
298 static const char *const azSendMethods[] = {
299 "off", "Disabled",
300 "relay", "SMTP relay",
301 "db", "Store in a database",
302 "dir", "Store in a directory",
303 "pipe", "Pipe to a command",
304 };
305 login_check_credentials();
306 if( !g.perm.Setup ){
307 login_needed(0);
308 return;
@@ -311,22 +311,25 @@
311
312 alert_submenu_common();
313 style_submenu_element("Send Announcement","%R/announce");
314 style_set_current_feature("alerts");
315 style_header("Email Notification Setup");
316 @ <form action="%R/setup_notification" method="post"><div>
317 @ <h1>Status &ensp; <input type="submit" name="submit" value="Refresh"></h1>
318 @ </form>
319 @ <table class="label-value">
320 if( alert_enabled() ){
321 stats_for_email();
322 }else{
323 @ <th>Disabled</th>
324 }
325 @ </table>
326 @ <hr>
 
327 @ <form action="%R/setup_notification" method="post"><div>
328 @ <h1> Configuration </h1>
329 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
330 @ <hr>
331 login_insert_csrf_secret();
332
333 entry_attribute("Canonical Server URL", 40, "email-url",
334 "eurl", "", 0);
335 @ <p><b>Required.</b>
@@ -391,38 +394,36 @@
394 @ <p>How to send email. Requires auxiliary information from the fields
395 @ that follow. Hint: Use the <a href="%R/announce">/announce</a> page
396 @ to send test message to debug this setting.
397 @ (Property: "email-send-method")</p>
398 alert_schema(1);
399 entry_attribute("SMTP Relay Host", 60, "email-send-relayhost",
400 "esrh", "localhost:25", 0);
401 @ <p>When the send method is "SMTP relay", each email message is
402 @ transmitted via the SMTP protocol (rfc5321) to a "Mail Submission
403 @ Agent" or "MSA" (rfc4409) at the hostname shown here. Optionally
404 @ append a colon and TCP port number (ex: smtp.example.com:587).
405 @ The default TCP port number is 25.
406 @ (Property: "email-send-relayhost")</p>
407 entry_attribute("Store Emails In This Database", 60, "email-send-db",
408 "esdb", "", 0);
409 @ <p>When the send method is "store in a database", each email message is
410 @ stored in an SQLite database file with the name given here.
411 @ (Property: "email-send-db")</p>
412 entry_attribute("Pipe Email Text Into This Command", 60, "email-send-command",
413 "ecmd", "sendmail -ti", 0);
414 @ <p>When the send method is "pipe to a command", this is the command
415 @ that is run. Email messages are piped into the standard input of this
416 @ command. The command is expected to extract the sender address,
417 @ recipient addresses, and subject from the header of the piped email
418 @ text. (Property: "email-send-command")</p>
 
 
 
 
 
 
 
419 entry_attribute("Store Emails In This Directory", 60, "email-send-dir",
420 "esdir", "", 0);
421 @ <p>When the send method is "store in a directory", each email message is
422 @ stored as a separate file in the directory shown here.
423 @ (Property: "email-send-dir")</p>
424
 
 
 
 
 
 
 
 
425 @ <hr>
426
427 @ <p><input type="submit" name="submit" value="Apply Changes"></p>
428 @ </div></form>
429 db_end_transaction(0);
430

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button