Fossil SCM
Add a note to the email-listid setting help text and editor entry that this value is required for unsubscribe links to work. In /secaudit0, emit a warning if notifications are enabled but email-listid is empty. This is in response to [forum post 1245b69c](forum:1245b69cfa09c26e).
Commit
015101838341ce1f50b9d4a785312085ee5db5cf3f2d687925ee8b03a46a147a
Parent
fb173ae1a86bc71…
2 files changed
+4
-1
+6
+4
-1
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -363,11 +363,12 @@ | ||
| 363 | 363 | |
| 364 | 364 | entry_attribute("List-ID", 40, "email-listid", |
| 365 | 365 | "elistid", "", 0); |
| 366 | 366 | @ <p> |
| 367 | 367 | @ If this is not an empty string, then it becomes the argument to |
| 368 | - @ a "List-ID:" header on all out-bound notification emails. | |
| 368 | + @ a "List-ID:" header on all out-bound notification emails. A list ID | |
| 369 | + @ is required for the generation of unsubscribe links in notifications. | |
| 369 | 370 | @ (Property: "email-listid")</p> |
| 370 | 371 | @ <hr> |
| 371 | 372 | |
| 372 | 373 | entry_attribute("Repository Nickname", 16, "email-subname", |
| 373 | 374 | "enn", "", 0); |
| @@ -1144,10 +1145,12 @@ | ||
| 1144 | 1145 | */ |
| 1145 | 1146 | /* |
| 1146 | 1147 | ** SETTING: email-listid width=40 |
| 1147 | 1148 | ** If this setting is not an empty string, then it becomes the argument to |
| 1148 | 1149 | ** a "List-ID:" header that is added to all out-bound notification emails. |
| 1150 | +** A list ID is required for the generation of unsubscribe links in | |
| 1151 | +** notifications. | |
| 1149 | 1152 | */ |
| 1150 | 1153 | /* |
| 1151 | 1154 | ** SETTING: email-send-relayhost width=40 sensitive default=127.0.0.1 |
| 1152 | 1155 | ** This is the hostname and TCP port to which output email messages |
| 1153 | 1156 | ** are sent when email-send-method is "relay". There should be an |
| 1154 | 1157 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -363,11 +363,12 @@ | |
| 363 | |
| 364 | entry_attribute("List-ID", 40, "email-listid", |
| 365 | "elistid", "", 0); |
| 366 | @ <p> |
| 367 | @ If this is not an empty string, then it becomes the argument to |
| 368 | @ a "List-ID:" header on all out-bound notification emails. |
| 369 | @ (Property: "email-listid")</p> |
| 370 | @ <hr> |
| 371 | |
| 372 | entry_attribute("Repository Nickname", 16, "email-subname", |
| 373 | "enn", "", 0); |
| @@ -1144,10 +1145,12 @@ | |
| 1144 | */ |
| 1145 | /* |
| 1146 | ** SETTING: email-listid width=40 |
| 1147 | ** If this setting is not an empty string, then it becomes the argument to |
| 1148 | ** a "List-ID:" header that is added to all out-bound notification emails. |
| 1149 | */ |
| 1150 | /* |
| 1151 | ** SETTING: email-send-relayhost width=40 sensitive default=127.0.0.1 |
| 1152 | ** This is the hostname and TCP port to which output email messages |
| 1153 | ** are sent when email-send-method is "relay". There should be an |
| 1154 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -363,11 +363,12 @@ | |
| 363 | |
| 364 | entry_attribute("List-ID", 40, "email-listid", |
| 365 | "elistid", "", 0); |
| 366 | @ <p> |
| 367 | @ If this is not an empty string, then it becomes the argument to |
| 368 | @ a "List-ID:" header on all out-bound notification emails. A list ID |
| 369 | @ is required for the generation of unsubscribe links in notifications. |
| 370 | @ (Property: "email-listid")</p> |
| 371 | @ <hr> |
| 372 | |
| 373 | entry_attribute("Repository Nickname", 16, "email-subname", |
| 374 | "enn", "", 0); |
| @@ -1144,10 +1145,12 @@ | |
| 1145 | */ |
| 1146 | /* |
| 1147 | ** SETTING: email-listid width=40 |
| 1148 | ** If this setting is not an empty string, then it becomes the argument to |
| 1149 | ** a "List-ID:" header that is added to all out-bound notification emails. |
| 1150 | ** A list ID is required for the generation of unsubscribe links in |
| 1151 | ** notifications. |
| 1152 | */ |
| 1153 | /* |
| 1154 | ** SETTING: email-send-relayhost width=40 sensitive default=127.0.0.1 |
| 1155 | ** This is the hostname and TCP port to which output email messages |
| 1156 | ** are sent when email-send-method is "relay". There should be an |
| 1157 |
+6
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -677,11 +677,17 @@ | ||
| 677 | 677 | @ </ol> |
| 678 | 678 | } |
| 679 | 679 | fossil_free(azCSP); |
| 680 | 680 | |
| 681 | 681 | if( alert_enabled() ){ |
| 682 | + char * zListId = db_get("email-listid", 0); | |
| 682 | 683 | @ <li><p> Email alert configuration summary: |
| 684 | + if( !zListId || !zListId[0] ){ | |
| 685 | + @ <br><strong>WARNING:</strong> <code>email-listid</code> is not set, | |
| 686 | + @ so notifications will not include unsubscribe links. | |
| 687 | + } | |
| 688 | + fossil_free(zListId); | |
| 683 | 689 | @ <table class="label-value"> |
| 684 | 690 | stats_for_email(); |
| 685 | 691 | @ </table> |
| 686 | 692 | }else{ |
| 687 | 693 | @ <li><p> Email alerts are disabled |
| 688 | 694 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -677,11 +677,17 @@ | |
| 677 | @ </ol> |
| 678 | } |
| 679 | fossil_free(azCSP); |
| 680 | |
| 681 | if( alert_enabled() ){ |
| 682 | @ <li><p> Email alert configuration summary: |
| 683 | @ <table class="label-value"> |
| 684 | stats_for_email(); |
| 685 | @ </table> |
| 686 | }else{ |
| 687 | @ <li><p> Email alerts are disabled |
| 688 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -677,11 +677,17 @@ | |
| 677 | @ </ol> |
| 678 | } |
| 679 | fossil_free(azCSP); |
| 680 | |
| 681 | if( alert_enabled() ){ |
| 682 | char * zListId = db_get("email-listid", 0); |
| 683 | @ <li><p> Email alert configuration summary: |
| 684 | if( !zListId || !zListId[0] ){ |
| 685 | @ <br><strong>WARNING:</strong> <code>email-listid</code> is not set, |
| 686 | @ so notifications will not include unsubscribe links. |
| 687 | } |
| 688 | fossil_free(zListId); |
| 689 | @ <table class="label-value"> |
| 690 | stats_for_email(); |
| 691 | @ </table> |
| 692 | }else{ |
| 693 | @ <li><p> Email alerts are disabled |
| 694 |