Fossil SCM
On the notification setup page, add a Refresh button to Status. Make Relay the first choice.
Commit
cad72b796fe4336eb580ece92e0dd19e0361493d10a4491f241fc4cb499d20f9
Parent
5cf4dc82e70aa9c…
1 file changed
+21
-20
+21
-20
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -295,14 +295,14 @@ | ||
| 295 | 295 | ** Normally accessible via the /Admin/Notification menu. |
| 296 | 296 | */ |
| 297 | 297 | void setup_notification(void){ |
| 298 | 298 | static const char *const azSendMethods[] = { |
| 299 | 299 | "off", "Disabled", |
| 300 | - "pipe", "Pipe to a command", | |
| 300 | + "relay", "SMTP relay", | |
| 301 | 301 | "db", "Store in a database", |
| 302 | 302 | "dir", "Store in a directory", |
| 303 | - "relay", "SMTP relay" | |
| 303 | + "pipe", "Pipe to a command", | |
| 304 | 304 | }; |
| 305 | 305 | login_check_credentials(); |
| 306 | 306 | if( !g.perm.Setup ){ |
| 307 | 307 | login_needed(0); |
| 308 | 308 | return; |
| @@ -311,22 +311,25 @@ | ||
| 311 | 311 | |
| 312 | 312 | alert_submenu_common(); |
| 313 | 313 | style_submenu_element("Send Announcement","%R/announce"); |
| 314 | 314 | style_set_current_feature("alerts"); |
| 315 | 315 | style_header("Email Notification Setup"); |
| 316 | - @ <h1>Status</h1> | |
| 316 | + @ <form action="%R/setup_notification" method="post"><div> | |
| 317 | + @ <h1>Status   <input type="submit" name="submit" value="Refresh"></h1> | |
| 318 | + @ </form> | |
| 317 | 319 | @ <table class="label-value"> |
| 318 | 320 | if( alert_enabled() ){ |
| 319 | 321 | stats_for_email(); |
| 320 | 322 | }else{ |
| 321 | 323 | @ <th>Disabled</th> |
| 322 | 324 | } |
| 323 | 325 | @ </table> |
| 324 | 326 | @ <hr> |
| 325 | - @ <h1> Configuration </h1> | |
| 326 | 327 | @ <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> | |
| 328 | 331 | login_insert_csrf_secret(); |
| 329 | 332 | |
| 330 | 333 | entry_attribute("Canonical Server URL", 40, "email-url", |
| 331 | 334 | "eurl", "", 0); |
| 332 | 335 | @ <p><b>Required.</b> |
| @@ -391,38 +394,36 @@ | ||
| 391 | 394 | @ <p>How to send email. Requires auxiliary information from the fields |
| 392 | 395 | @ that follow. Hint: Use the <a href="%R/announce">/announce</a> page |
| 393 | 396 | @ to send test message to debug this setting. |
| 394 | 397 | @ (Property: "email-send-method")</p> |
| 395 | 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> | |
| 396 | 412 | entry_attribute("Pipe Email Text Into This Command", 60, "email-send-command", |
| 397 | 413 | "ecmd", "sendmail -ti", 0); |
| 398 | 414 | @ <p>When the send method is "pipe to a command", this is the command |
| 399 | 415 | @ that is run. Email messages are piped into the standard input of this |
| 400 | 416 | @ command. The command is expected to extract the sender address, |
| 401 | 417 | @ recipient addresses, and subject from the header of the piped email |
| 402 | 418 | @ 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 | 419 | entry_attribute("Store Emails In This Directory", 60, "email-send-dir", |
| 411 | 420 | "esdir", "", 0); |
| 412 | 421 | @ <p>When the send method is "store in a directory", each email message is |
| 413 | 422 | @ stored as a separate file in the directory shown here. |
| 414 | 423 | @ (Property: "email-send-dir")</p> |
| 415 | 424 | |
| 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 | 425 | @ <hr> |
| 425 | 426 | |
| 426 | 427 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 427 | 428 | @ </div></form> |
| 428 | 429 | db_end_transaction(0); |
| 429 | 430 |
| --- 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   <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 |