Fossil SCM
Typo fix and EOL whitespace cleanups. No functional changes.
Commit
e0576ea919cd8052a00c849f1ee2f5325d18a4c6aa89752d15d5e00bd8730f29
Parent
bca95cbf9c2bf23…
2 files changed
+18
-18
+18
-18
+18
-18
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -87,11 +87,11 @@ | ||
| 87 | 87 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 88 | 88 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 89 | 89 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 90 | 90 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 91 | 91 | @ ) WITHOUT ROWID; |
| 92 | -@ | |
| 92 | +@ | |
| 93 | 93 | @ -- Obsolete table. No longer used. |
| 94 | 94 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 95 | 95 | ; |
| 96 | 96 | |
| 97 | 97 | /* |
| @@ -876,11 +876,11 @@ | ||
| 876 | 876 | int nTo = 0; |
| 877 | 877 | char **azTo = 0; |
| 878 | 878 | Blob v; |
| 879 | 879 | char *z, *zAddr; |
| 880 | 880 | int i; |
| 881 | - | |
| 881 | + | |
| 882 | 882 | email_header_value(pMsg, "to", &v); |
| 883 | 883 | z = blob_str(&v); |
| 884 | 884 | for(i=0; z[i]; i++){ |
| 885 | 885 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 886 | 886 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -890,11 +890,11 @@ | ||
| 890 | 890 | *pnTo = nTo; |
| 891 | 891 | *pazTo = azTo; |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | /* |
| 895 | -** Free a list of To addresses obtained from a prior call to | |
| 895 | +** Free a list of To addresses obtained from a prior call to | |
| 896 | 896 | ** email_header_to() |
| 897 | 897 | */ |
| 898 | 898 | void email_header_to_free(int nTo, char **azTo){ |
| 899 | 899 | int i; |
| 900 | 900 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -916,11 +916,11 @@ | ||
| 916 | 916 | ** Message-Id: |
| 917 | 917 | ** Content-Type: |
| 918 | 918 | ** Content-Transfer-Encoding: |
| 919 | 919 | ** MIME-Version: |
| 920 | 920 | ** Sender: |
| 921 | -** | |
| 921 | +** | |
| 922 | 922 | ** The caller maintains ownership of the input Blobs. This routine will |
| 923 | 923 | ** read the Blobs and send them onward to the email system, but it will |
| 924 | 924 | ** not free them. |
| 925 | 925 | ** |
| 926 | 926 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -929,11 +929,11 @@ | ||
| 929 | 929 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 930 | 930 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 931 | 931 | ** email address based on a hash of zFromName and the domain of email-self, |
| 932 | 932 | ** and an additional "Sender:" field is inserted with the email-self |
| 933 | 933 | ** address. Downstream software might use the Sender header to set |
| 934 | -** the envelope-from address of the email. If zFromName is a NULL pointer, | |
| 934 | +** the envelope-from address of the email. If zFromName is a NULL pointer, | |
| 935 | 935 | ** then the "From:" is set to the email-self value and Sender is |
| 936 | 936 | ** omitted. |
| 937 | 937 | */ |
| 938 | 938 | void alert_send( |
| 939 | 939 | AlertSender *p, /* Emailer context */ |
| @@ -1046,11 +1046,11 @@ | ||
| 1046 | 1046 | ** a long-running server and will not be sending email notifications, |
| 1047 | 1047 | ** then leave this setting blank. |
| 1048 | 1048 | */ |
| 1049 | 1049 | /* |
| 1050 | 1050 | ** SETTING: email-admin width=40 |
| 1051 | -** This is the email address for the human administrator for the system. | |
| 1051 | +** This is the email address for the human administrator for the system. | |
| 1052 | 1052 | ** Abuse and trouble reports and password reset requests are send here. |
| 1053 | 1053 | */ |
| 1054 | 1054 | /* |
| 1055 | 1055 | ** SETTING: email-subname width=16 |
| 1056 | 1056 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1081,19 +1081,19 @@ | ||
| 1081 | 1081 | ** |
| 1082 | 1082 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1083 | 1083 | ** last batch of "your subscription is about to expire" emails were |
| 1084 | 1084 | ** sent out. |
| 1085 | 1085 | ** |
| 1086 | -** email-renew-cutoff is normally 7 days behind email-renew-warning. | |
| 1086 | +** email-renew-cutoff is normally 7 days behind email-renew-warning. | |
| 1087 | 1087 | */ |
| 1088 | 1088 | /* |
| 1089 | 1089 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1090 | 1090 | ** Determine the method used to send email. Allowed values are |
| 1091 | 1091 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1092 | 1092 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1093 | 1093 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1094 | -** The "pipe" value means email messages are piped into a command | |
| 1094 | +** The "pipe" value means email messages are piped into a command | |
| 1095 | 1095 | ** determined by the email-send-command setting. The "dir" value means |
| 1096 | 1096 | ** emails are written to individual files in a directory determined |
| 1097 | 1097 | ** by the email-send-dir setting. The "db" value means that emails |
| 1098 | 1098 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1099 | 1099 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1134,11 +1134,11 @@ | ||
| 1134 | 1134 | */ |
| 1135 | 1135 | |
| 1136 | 1136 | |
| 1137 | 1137 | /* |
| 1138 | 1138 | ** COMMAND: alerts* |
| 1139 | -** | |
| 1139 | +** | |
| 1140 | 1140 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1141 | 1141 | ** |
| 1142 | 1142 | ** Subcommands: |
| 1143 | 1143 | ** |
| 1144 | 1144 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1805,11 +1805,11 @@ | ||
| 1805 | 1805 | ** that constitutes verification of the email address. |
| 1806 | 1806 | ** |
| 1807 | 1807 | ** * The sid= query parameter contains an integer subscriberId. |
| 1808 | 1808 | ** This only works for the administrator. It allows the |
| 1809 | 1809 | ** administrator to edit any subscription. |
| 1810 | -** | |
| 1810 | +** | |
| 1811 | 1811 | ** * The user is logged into an account other than "nobody" or |
| 1812 | 1812 | ** "anonymous". In that case the notification settings |
| 1813 | 1813 | ** associated with that account can be edited without needing |
| 1814 | 1814 | ** to know the subscriber code. |
| 1815 | 1815 | ** |
| @@ -1937,11 +1937,11 @@ | ||
| 1937 | 1937 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1938 | 1938 | " unsubscribe"); |
| 1939 | 1939 | }else{ |
| 1940 | 1940 | alert_unsubscribe(sid, 1); |
| 1941 | 1941 | db_commit_transaction(); |
| 1942 | - return; | |
| 1942 | + return; | |
| 1943 | 1943 | } |
| 1944 | 1944 | } |
| 1945 | 1945 | style_set_current_feature("alerts"); |
| 1946 | 1946 | style_header("Update Subscription"); |
| 1947 | 1947 | db_prepare(&q, |
| @@ -2198,11 +2198,11 @@ | ||
| 2198 | 2198 | |
| 2199 | 2199 | |
| 2200 | 2200 | /* This is the message that gets sent to describe how to change |
| 2201 | 2201 | ** or modify a subscription |
| 2202 | 2202 | */ |
| 2203 | -static const char zUnsubMsg[] = | |
| 2203 | +static const char zUnsubMsg[] = | |
| 2204 | 2204 | @ To changes your subscription settings at %s visit this link: |
| 2205 | 2205 | @ |
| 2206 | 2206 | @ %s/alerts/%s |
| 2207 | 2207 | @ |
| 2208 | 2208 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2243,13 +2243,13 @@ | ||
| 2243 | 2243 | int sid = 0; |
| 2244 | 2244 | |
| 2245 | 2245 | if( zName==0 ) zName = P("scode"); |
| 2246 | 2246 | |
| 2247 | 2247 | /* If a valid subscriber code is supplied, then either present the user |
| 2248 | - ** with a comformation, or if already confirmed, unsubscribe immediately. | |
| 2248 | + ** with a confirmation, or if already confirmed, unsubscribe immediately. | |
| 2249 | 2249 | */ |
| 2250 | - if( zName | |
| 2250 | + if( zName | |
| 2251 | 2251 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2252 | 2252 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2253 | 2253 | ){ |
| 2254 | 2254 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2255 | 2255 | if( P(zUnsubName)!=0 ){ |
| @@ -2334,11 +2334,11 @@ | ||
| 2334 | 2334 | @ unsubscribe and/or modify your subscription settings</p> |
| 2335 | 2335 | } |
| 2336 | 2336 | alert_sender_free(pSender); |
| 2337 | 2337 | style_finish_page(); |
| 2338 | 2338 | return; |
| 2339 | - } | |
| 2339 | + } | |
| 2340 | 2340 | |
| 2341 | 2341 | /* Non-logged-in users have to enter an email address to which is |
| 2342 | 2342 | ** sent a message containing the unsubscribe link. |
| 2343 | 2343 | */ |
| 2344 | 2344 | style_header("Unsubscribe Request"); |
| @@ -2743,11 +2743,11 @@ | ||
| 2743 | 2743 | if( p->needMod ){ |
| 2744 | 2744 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2745 | 2745 | zSub, zTitle); |
| 2746 | 2746 | }else{ |
| 2747 | 2747 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2748 | - blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", | |
| 2748 | + blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", | |
| 2749 | 2749 | zUuid, alert_hostname(zFrom)); |
| 2750 | 2750 | zIrt = db_column_text(&q, 4); |
| 2751 | 2751 | if( zIrt && zIrt[0] ){ |
| 2752 | 2752 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2753 | 2753 | zIrt, alert_hostname(zFrom)); |
| @@ -3252,11 +3252,11 @@ | ||
| 3252 | 3252 | ); |
| 3253 | 3253 | while( db_step(&q)==SQLITE_ROW ){ |
| 3254 | 3254 | Blob hdr, body; |
| 3255 | 3255 | blob_init(&hdr, 0, 0); |
| 3256 | 3256 | blob_init(&body, 0, 0); |
| 3257 | - alert_renewal_msg(&hdr, &body, | |
| 3257 | + alert_renewal_msg(&hdr, &body, | |
| 3258 | 3258 | db_column_text(&q,0), |
| 3259 | 3259 | db_column_int(&q,1), |
| 3260 | 3260 | db_column_text(&q,2), |
| 3261 | 3261 | db_column_text(&q,3), |
| 3262 | 3262 | zRepoName, zUrl); |
| @@ -3322,11 +3322,11 @@ | ||
| 3322 | 3322 | style_header("Outbound Email Disabled"); |
| 3323 | 3323 | @ <p>Outbound email is disabled on this repository |
| 3324 | 3324 | style_finish_page(); |
| 3325 | 3325 | return; |
| 3326 | 3326 | } |
| 3327 | - if( P("submit")!=0 | |
| 3327 | + if( P("submit")!=0 | |
| 3328 | 3328 | && P("subject")!=0 |
| 3329 | 3329 | && P("msg")!=0 |
| 3330 | 3330 | && P("from")!=0 |
| 3331 | 3331 | && cgi_csrf_safe(2) |
| 3332 | 3332 | && captcha_is_correct(0) |
| 3333 | 3333 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -87,11 +87,11 @@ | |
| 87 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 88 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 89 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 90 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 91 | @ ) WITHOUT ROWID; |
| 92 | @ |
| 93 | @ -- Obsolete table. No longer used. |
| 94 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 95 | ; |
| 96 | |
| 97 | /* |
| @@ -876,11 +876,11 @@ | |
| 876 | int nTo = 0; |
| 877 | char **azTo = 0; |
| 878 | Blob v; |
| 879 | char *z, *zAddr; |
| 880 | int i; |
| 881 | |
| 882 | email_header_value(pMsg, "to", &v); |
| 883 | z = blob_str(&v); |
| 884 | for(i=0; z[i]; i++){ |
| 885 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 886 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -890,11 +890,11 @@ | |
| 890 | *pnTo = nTo; |
| 891 | *pazTo = azTo; |
| 892 | } |
| 893 | |
| 894 | /* |
| 895 | ** Free a list of To addresses obtained from a prior call to |
| 896 | ** email_header_to() |
| 897 | */ |
| 898 | void email_header_to_free(int nTo, char **azTo){ |
| 899 | int i; |
| 900 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -916,11 +916,11 @@ | |
| 916 | ** Message-Id: |
| 917 | ** Content-Type: |
| 918 | ** Content-Transfer-Encoding: |
| 919 | ** MIME-Version: |
| 920 | ** Sender: |
| 921 | ** |
| 922 | ** The caller maintains ownership of the input Blobs. This routine will |
| 923 | ** read the Blobs and send them onward to the email system, but it will |
| 924 | ** not free them. |
| 925 | ** |
| 926 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -929,11 +929,11 @@ | |
| 929 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 930 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 931 | ** email address based on a hash of zFromName and the domain of email-self, |
| 932 | ** and an additional "Sender:" field is inserted with the email-self |
| 933 | ** address. Downstream software might use the Sender header to set |
| 934 | ** the envelope-from address of the email. If zFromName is a NULL pointer, |
| 935 | ** then the "From:" is set to the email-self value and Sender is |
| 936 | ** omitted. |
| 937 | */ |
| 938 | void alert_send( |
| 939 | AlertSender *p, /* Emailer context */ |
| @@ -1046,11 +1046,11 @@ | |
| 1046 | ** a long-running server and will not be sending email notifications, |
| 1047 | ** then leave this setting blank. |
| 1048 | */ |
| 1049 | /* |
| 1050 | ** SETTING: email-admin width=40 |
| 1051 | ** This is the email address for the human administrator for the system. |
| 1052 | ** Abuse and trouble reports and password reset requests are send here. |
| 1053 | */ |
| 1054 | /* |
| 1055 | ** SETTING: email-subname width=16 |
| 1056 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1081,19 +1081,19 @@ | |
| 1081 | ** |
| 1082 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1083 | ** last batch of "your subscription is about to expire" emails were |
| 1084 | ** sent out. |
| 1085 | ** |
| 1086 | ** email-renew-cutoff is normally 7 days behind email-renew-warning. |
| 1087 | */ |
| 1088 | /* |
| 1089 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1090 | ** Determine the method used to send email. Allowed values are |
| 1091 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1092 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1093 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1094 | ** The "pipe" value means email messages are piped into a command |
| 1095 | ** determined by the email-send-command setting. The "dir" value means |
| 1096 | ** emails are written to individual files in a directory determined |
| 1097 | ** by the email-send-dir setting. The "db" value means that emails |
| 1098 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1099 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1134,11 +1134,11 @@ | |
| 1134 | */ |
| 1135 | |
| 1136 | |
| 1137 | /* |
| 1138 | ** COMMAND: alerts* |
| 1139 | ** |
| 1140 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1141 | ** |
| 1142 | ** Subcommands: |
| 1143 | ** |
| 1144 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1805,11 +1805,11 @@ | |
| 1805 | ** that constitutes verification of the email address. |
| 1806 | ** |
| 1807 | ** * The sid= query parameter contains an integer subscriberId. |
| 1808 | ** This only works for the administrator. It allows the |
| 1809 | ** administrator to edit any subscription. |
| 1810 | ** |
| 1811 | ** * The user is logged into an account other than "nobody" or |
| 1812 | ** "anonymous". In that case the notification settings |
| 1813 | ** associated with that account can be edited without needing |
| 1814 | ** to know the subscriber code. |
| 1815 | ** |
| @@ -1937,11 +1937,11 @@ | |
| 1937 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1938 | " unsubscribe"); |
| 1939 | }else{ |
| 1940 | alert_unsubscribe(sid, 1); |
| 1941 | db_commit_transaction(); |
| 1942 | return; |
| 1943 | } |
| 1944 | } |
| 1945 | style_set_current_feature("alerts"); |
| 1946 | style_header("Update Subscription"); |
| 1947 | db_prepare(&q, |
| @@ -2198,11 +2198,11 @@ | |
| 2198 | |
| 2199 | |
| 2200 | /* This is the message that gets sent to describe how to change |
| 2201 | ** or modify a subscription |
| 2202 | */ |
| 2203 | static const char zUnsubMsg[] = |
| 2204 | @ To changes your subscription settings at %s visit this link: |
| 2205 | @ |
| 2206 | @ %s/alerts/%s |
| 2207 | @ |
| 2208 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2243,13 +2243,13 @@ | |
| 2243 | int sid = 0; |
| 2244 | |
| 2245 | if( zName==0 ) zName = P("scode"); |
| 2246 | |
| 2247 | /* If a valid subscriber code is supplied, then either present the user |
| 2248 | ** with a comformation, or if already confirmed, unsubscribe immediately. |
| 2249 | */ |
| 2250 | if( zName |
| 2251 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2252 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2253 | ){ |
| 2254 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2255 | if( P(zUnsubName)!=0 ){ |
| @@ -2334,11 +2334,11 @@ | |
| 2334 | @ unsubscribe and/or modify your subscription settings</p> |
| 2335 | } |
| 2336 | alert_sender_free(pSender); |
| 2337 | style_finish_page(); |
| 2338 | return; |
| 2339 | } |
| 2340 | |
| 2341 | /* Non-logged-in users have to enter an email address to which is |
| 2342 | ** sent a message containing the unsubscribe link. |
| 2343 | */ |
| 2344 | style_header("Unsubscribe Request"); |
| @@ -2743,11 +2743,11 @@ | |
| 2743 | if( p->needMod ){ |
| 2744 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2745 | zSub, zTitle); |
| 2746 | }else{ |
| 2747 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2748 | blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", |
| 2749 | zUuid, alert_hostname(zFrom)); |
| 2750 | zIrt = db_column_text(&q, 4); |
| 2751 | if( zIrt && zIrt[0] ){ |
| 2752 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2753 | zIrt, alert_hostname(zFrom)); |
| @@ -3252,11 +3252,11 @@ | |
| 3252 | ); |
| 3253 | while( db_step(&q)==SQLITE_ROW ){ |
| 3254 | Blob hdr, body; |
| 3255 | blob_init(&hdr, 0, 0); |
| 3256 | blob_init(&body, 0, 0); |
| 3257 | alert_renewal_msg(&hdr, &body, |
| 3258 | db_column_text(&q,0), |
| 3259 | db_column_int(&q,1), |
| 3260 | db_column_text(&q,2), |
| 3261 | db_column_text(&q,3), |
| 3262 | zRepoName, zUrl); |
| @@ -3322,11 +3322,11 @@ | |
| 3322 | style_header("Outbound Email Disabled"); |
| 3323 | @ <p>Outbound email is disabled on this repository |
| 3324 | style_finish_page(); |
| 3325 | return; |
| 3326 | } |
| 3327 | if( P("submit")!=0 |
| 3328 | && P("subject")!=0 |
| 3329 | && P("msg")!=0 |
| 3330 | && P("from")!=0 |
| 3331 | && cgi_csrf_safe(2) |
| 3332 | && captcha_is_correct(0) |
| 3333 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -87,11 +87,11 @@ | |
| 87 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 88 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 89 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 90 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 91 | @ ) WITHOUT ROWID; |
| 92 | @ |
| 93 | @ -- Obsolete table. No longer used. |
| 94 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 95 | ; |
| 96 | |
| 97 | /* |
| @@ -876,11 +876,11 @@ | |
| 876 | int nTo = 0; |
| 877 | char **azTo = 0; |
| 878 | Blob v; |
| 879 | char *z, *zAddr; |
| 880 | int i; |
| 881 | |
| 882 | email_header_value(pMsg, "to", &v); |
| 883 | z = blob_str(&v); |
| 884 | for(i=0; z[i]; i++){ |
| 885 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 886 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -890,11 +890,11 @@ | |
| 890 | *pnTo = nTo; |
| 891 | *pazTo = azTo; |
| 892 | } |
| 893 | |
| 894 | /* |
| 895 | ** Free a list of To addresses obtained from a prior call to |
| 896 | ** email_header_to() |
| 897 | */ |
| 898 | void email_header_to_free(int nTo, char **azTo){ |
| 899 | int i; |
| 900 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -916,11 +916,11 @@ | |
| 916 | ** Message-Id: |
| 917 | ** Content-Type: |
| 918 | ** Content-Transfer-Encoding: |
| 919 | ** MIME-Version: |
| 920 | ** Sender: |
| 921 | ** |
| 922 | ** The caller maintains ownership of the input Blobs. This routine will |
| 923 | ** read the Blobs and send them onward to the email system, but it will |
| 924 | ** not free them. |
| 925 | ** |
| 926 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -929,11 +929,11 @@ | |
| 929 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 930 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 931 | ** email address based on a hash of zFromName and the domain of email-self, |
| 932 | ** and an additional "Sender:" field is inserted with the email-self |
| 933 | ** address. Downstream software might use the Sender header to set |
| 934 | ** the envelope-from address of the email. If zFromName is a NULL pointer, |
| 935 | ** then the "From:" is set to the email-self value and Sender is |
| 936 | ** omitted. |
| 937 | */ |
| 938 | void alert_send( |
| 939 | AlertSender *p, /* Emailer context */ |
| @@ -1046,11 +1046,11 @@ | |
| 1046 | ** a long-running server and will not be sending email notifications, |
| 1047 | ** then leave this setting blank. |
| 1048 | */ |
| 1049 | /* |
| 1050 | ** SETTING: email-admin width=40 |
| 1051 | ** This is the email address for the human administrator for the system. |
| 1052 | ** Abuse and trouble reports and password reset requests are send here. |
| 1053 | */ |
| 1054 | /* |
| 1055 | ** SETTING: email-subname width=16 |
| 1056 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1081,19 +1081,19 @@ | |
| 1081 | ** |
| 1082 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1083 | ** last batch of "your subscription is about to expire" emails were |
| 1084 | ** sent out. |
| 1085 | ** |
| 1086 | ** email-renew-cutoff is normally 7 days behind email-renew-warning. |
| 1087 | */ |
| 1088 | /* |
| 1089 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1090 | ** Determine the method used to send email. Allowed values are |
| 1091 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1092 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1093 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1094 | ** The "pipe" value means email messages are piped into a command |
| 1095 | ** determined by the email-send-command setting. The "dir" value means |
| 1096 | ** emails are written to individual files in a directory determined |
| 1097 | ** by the email-send-dir setting. The "db" value means that emails |
| 1098 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1099 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1134,11 +1134,11 @@ | |
| 1134 | */ |
| 1135 | |
| 1136 | |
| 1137 | /* |
| 1138 | ** COMMAND: alerts* |
| 1139 | ** |
| 1140 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1141 | ** |
| 1142 | ** Subcommands: |
| 1143 | ** |
| 1144 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1805,11 +1805,11 @@ | |
| 1805 | ** that constitutes verification of the email address. |
| 1806 | ** |
| 1807 | ** * The sid= query parameter contains an integer subscriberId. |
| 1808 | ** This only works for the administrator. It allows the |
| 1809 | ** administrator to edit any subscription. |
| 1810 | ** |
| 1811 | ** * The user is logged into an account other than "nobody" or |
| 1812 | ** "anonymous". In that case the notification settings |
| 1813 | ** associated with that account can be edited without needing |
| 1814 | ** to know the subscriber code. |
| 1815 | ** |
| @@ -1937,11 +1937,11 @@ | |
| 1937 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1938 | " unsubscribe"); |
| 1939 | }else{ |
| 1940 | alert_unsubscribe(sid, 1); |
| 1941 | db_commit_transaction(); |
| 1942 | return; |
| 1943 | } |
| 1944 | } |
| 1945 | style_set_current_feature("alerts"); |
| 1946 | style_header("Update Subscription"); |
| 1947 | db_prepare(&q, |
| @@ -2198,11 +2198,11 @@ | |
| 2198 | |
| 2199 | |
| 2200 | /* This is the message that gets sent to describe how to change |
| 2201 | ** or modify a subscription |
| 2202 | */ |
| 2203 | static const char zUnsubMsg[] = |
| 2204 | @ To changes your subscription settings at %s visit this link: |
| 2205 | @ |
| 2206 | @ %s/alerts/%s |
| 2207 | @ |
| 2208 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2243,13 +2243,13 @@ | |
| 2243 | int sid = 0; |
| 2244 | |
| 2245 | if( zName==0 ) zName = P("scode"); |
| 2246 | |
| 2247 | /* If a valid subscriber code is supplied, then either present the user |
| 2248 | ** with a confirmation, or if already confirmed, unsubscribe immediately. |
| 2249 | */ |
| 2250 | if( zName |
| 2251 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2252 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2253 | ){ |
| 2254 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2255 | if( P(zUnsubName)!=0 ){ |
| @@ -2334,11 +2334,11 @@ | |
| 2334 | @ unsubscribe and/or modify your subscription settings</p> |
| 2335 | } |
| 2336 | alert_sender_free(pSender); |
| 2337 | style_finish_page(); |
| 2338 | return; |
| 2339 | } |
| 2340 | |
| 2341 | /* Non-logged-in users have to enter an email address to which is |
| 2342 | ** sent a message containing the unsubscribe link. |
| 2343 | */ |
| 2344 | style_header("Unsubscribe Request"); |
| @@ -2743,11 +2743,11 @@ | |
| 2743 | if( p->needMod ){ |
| 2744 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2745 | zSub, zTitle); |
| 2746 | }else{ |
| 2747 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2748 | blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", |
| 2749 | zUuid, alert_hostname(zFrom)); |
| 2750 | zIrt = db_column_text(&q, 4); |
| 2751 | if( zIrt && zIrt[0] ){ |
| 2752 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2753 | zIrt, alert_hostname(zFrom)); |
| @@ -3252,11 +3252,11 @@ | |
| 3252 | ); |
| 3253 | while( db_step(&q)==SQLITE_ROW ){ |
| 3254 | Blob hdr, body; |
| 3255 | blob_init(&hdr, 0, 0); |
| 3256 | blob_init(&body, 0, 0); |
| 3257 | alert_renewal_msg(&hdr, &body, |
| 3258 | db_column_text(&q,0), |
| 3259 | db_column_int(&q,1), |
| 3260 | db_column_text(&q,2), |
| 3261 | db_column_text(&q,3), |
| 3262 | zRepoName, zUrl); |
| @@ -3322,11 +3322,11 @@ | |
| 3322 | style_header("Outbound Email Disabled"); |
| 3323 | @ <p>Outbound email is disabled on this repository |
| 3324 | style_finish_page(); |
| 3325 | return; |
| 3326 | } |
| 3327 | if( P("submit")!=0 |
| 3328 | && P("subject")!=0 |
| 3329 | && P("msg")!=0 |
| 3330 | && P("from")!=0 |
| 3331 | && cgi_csrf_safe(2) |
| 3332 | && captcha_is_correct(0) |
| 3333 |
+18
-18
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -87,11 +87,11 @@ | ||
| 87 | 87 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 88 | 88 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 89 | 89 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 90 | 90 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 91 | 91 | @ ) WITHOUT ROWID; |
| 92 | -@ | |
| 92 | +@ | |
| 93 | 93 | @ -- Obsolete table. No longer used. |
| 94 | 94 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 95 | 95 | ; |
| 96 | 96 | |
| 97 | 97 | /* |
| @@ -876,11 +876,11 @@ | ||
| 876 | 876 | int nTo = 0; |
| 877 | 877 | char **azTo = 0; |
| 878 | 878 | Blob v; |
| 879 | 879 | char *z, *zAddr; |
| 880 | 880 | int i; |
| 881 | - | |
| 881 | + | |
| 882 | 882 | email_header_value(pMsg, "to", &v); |
| 883 | 883 | z = blob_str(&v); |
| 884 | 884 | for(i=0; z[i]; i++){ |
| 885 | 885 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 886 | 886 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -890,11 +890,11 @@ | ||
| 890 | 890 | *pnTo = nTo; |
| 891 | 891 | *pazTo = azTo; |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | /* |
| 895 | -** Free a list of To addresses obtained from a prior call to | |
| 895 | +** Free a list of To addresses obtained from a prior call to | |
| 896 | 896 | ** email_header_to() |
| 897 | 897 | */ |
| 898 | 898 | void email_header_to_free(int nTo, char **azTo){ |
| 899 | 899 | int i; |
| 900 | 900 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -916,11 +916,11 @@ | ||
| 916 | 916 | ** Message-Id: |
| 917 | 917 | ** Content-Type: |
| 918 | 918 | ** Content-Transfer-Encoding: |
| 919 | 919 | ** MIME-Version: |
| 920 | 920 | ** Sender: |
| 921 | -** | |
| 921 | +** | |
| 922 | 922 | ** The caller maintains ownership of the input Blobs. This routine will |
| 923 | 923 | ** read the Blobs and send them onward to the email system, but it will |
| 924 | 924 | ** not free them. |
| 925 | 925 | ** |
| 926 | 926 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -929,11 +929,11 @@ | ||
| 929 | 929 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 930 | 930 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 931 | 931 | ** email address based on a hash of zFromName and the domain of email-self, |
| 932 | 932 | ** and an additional "Sender:" field is inserted with the email-self |
| 933 | 933 | ** address. Downstream software might use the Sender header to set |
| 934 | -** the envelope-from address of the email. If zFromName is a NULL pointer, | |
| 934 | +** the envelope-from address of the email. If zFromName is a NULL pointer, | |
| 935 | 935 | ** then the "From:" is set to the email-self value and Sender is |
| 936 | 936 | ** omitted. |
| 937 | 937 | */ |
| 938 | 938 | void alert_send( |
| 939 | 939 | AlertSender *p, /* Emailer context */ |
| @@ -1046,11 +1046,11 @@ | ||
| 1046 | 1046 | ** a long-running server and will not be sending email notifications, |
| 1047 | 1047 | ** then leave this setting blank. |
| 1048 | 1048 | */ |
| 1049 | 1049 | /* |
| 1050 | 1050 | ** SETTING: email-admin width=40 |
| 1051 | -** This is the email address for the human administrator for the system. | |
| 1051 | +** This is the email address for the human administrator for the system. | |
| 1052 | 1052 | ** Abuse and trouble reports and password reset requests are send here. |
| 1053 | 1053 | */ |
| 1054 | 1054 | /* |
| 1055 | 1055 | ** SETTING: email-subname width=16 |
| 1056 | 1056 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1081,19 +1081,19 @@ | ||
| 1081 | 1081 | ** |
| 1082 | 1082 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1083 | 1083 | ** last batch of "your subscription is about to expire" emails were |
| 1084 | 1084 | ** sent out. |
| 1085 | 1085 | ** |
| 1086 | -** email-renew-cutoff is normally 7 days behind email-renew-warning. | |
| 1086 | +** email-renew-cutoff is normally 7 days behind email-renew-warning. | |
| 1087 | 1087 | */ |
| 1088 | 1088 | /* |
| 1089 | 1089 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1090 | 1090 | ** Determine the method used to send email. Allowed values are |
| 1091 | 1091 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1092 | 1092 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1093 | 1093 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1094 | -** The "pipe" value means email messages are piped into a command | |
| 1094 | +** The "pipe" value means email messages are piped into a command | |
| 1095 | 1095 | ** determined by the email-send-command setting. The "dir" value means |
| 1096 | 1096 | ** emails are written to individual files in a directory determined |
| 1097 | 1097 | ** by the email-send-dir setting. The "db" value means that emails |
| 1098 | 1098 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1099 | 1099 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1134,11 +1134,11 @@ | ||
| 1134 | 1134 | */ |
| 1135 | 1135 | |
| 1136 | 1136 | |
| 1137 | 1137 | /* |
| 1138 | 1138 | ** COMMAND: alerts* |
| 1139 | -** | |
| 1139 | +** | |
| 1140 | 1140 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1141 | 1141 | ** |
| 1142 | 1142 | ** Subcommands: |
| 1143 | 1143 | ** |
| 1144 | 1144 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1805,11 +1805,11 @@ | ||
| 1805 | 1805 | ** that constitutes verification of the email address. |
| 1806 | 1806 | ** |
| 1807 | 1807 | ** * The sid= query parameter contains an integer subscriberId. |
| 1808 | 1808 | ** This only works for the administrator. It allows the |
| 1809 | 1809 | ** administrator to edit any subscription. |
| 1810 | -** | |
| 1810 | +** | |
| 1811 | 1811 | ** * The user is logged into an account other than "nobody" or |
| 1812 | 1812 | ** "anonymous". In that case the notification settings |
| 1813 | 1813 | ** associated with that account can be edited without needing |
| 1814 | 1814 | ** to know the subscriber code. |
| 1815 | 1815 | ** |
| @@ -1937,11 +1937,11 @@ | ||
| 1937 | 1937 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1938 | 1938 | " unsubscribe"); |
| 1939 | 1939 | }else{ |
| 1940 | 1940 | alert_unsubscribe(sid, 1); |
| 1941 | 1941 | db_commit_transaction(); |
| 1942 | - return; | |
| 1942 | + return; | |
| 1943 | 1943 | } |
| 1944 | 1944 | } |
| 1945 | 1945 | style_set_current_feature("alerts"); |
| 1946 | 1946 | style_header("Update Subscription"); |
| 1947 | 1947 | db_prepare(&q, |
| @@ -2198,11 +2198,11 @@ | ||
| 2198 | 2198 | |
| 2199 | 2199 | |
| 2200 | 2200 | /* This is the message that gets sent to describe how to change |
| 2201 | 2201 | ** or modify a subscription |
| 2202 | 2202 | */ |
| 2203 | -static const char zUnsubMsg[] = | |
| 2203 | +static const char zUnsubMsg[] = | |
| 2204 | 2204 | @ To changes your subscription settings at %s visit this link: |
| 2205 | 2205 | @ |
| 2206 | 2206 | @ %s/alerts/%s |
| 2207 | 2207 | @ |
| 2208 | 2208 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2243,13 +2243,13 @@ | ||
| 2243 | 2243 | int sid = 0; |
| 2244 | 2244 | |
| 2245 | 2245 | if( zName==0 ) zName = P("scode"); |
| 2246 | 2246 | |
| 2247 | 2247 | /* If a valid subscriber code is supplied, then either present the user |
| 2248 | - ** with a comformation, or if already confirmed, unsubscribe immediately. | |
| 2248 | + ** with a confirmation, or if already confirmed, unsubscribe immediately. | |
| 2249 | 2249 | */ |
| 2250 | - if( zName | |
| 2250 | + if( zName | |
| 2251 | 2251 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2252 | 2252 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2253 | 2253 | ){ |
| 2254 | 2254 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2255 | 2255 | if( P(zUnsubName)!=0 ){ |
| @@ -2334,11 +2334,11 @@ | ||
| 2334 | 2334 | @ unsubscribe and/or modify your subscription settings</p> |
| 2335 | 2335 | } |
| 2336 | 2336 | alert_sender_free(pSender); |
| 2337 | 2337 | style_finish_page(); |
| 2338 | 2338 | return; |
| 2339 | - } | |
| 2339 | + } | |
| 2340 | 2340 | |
| 2341 | 2341 | /* Non-logged-in users have to enter an email address to which is |
| 2342 | 2342 | ** sent a message containing the unsubscribe link. |
| 2343 | 2343 | */ |
| 2344 | 2344 | style_header("Unsubscribe Request"); |
| @@ -2743,11 +2743,11 @@ | ||
| 2743 | 2743 | if( p->needMod ){ |
| 2744 | 2744 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2745 | 2745 | zSub, zTitle); |
| 2746 | 2746 | }else{ |
| 2747 | 2747 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2748 | - blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", | |
| 2748 | + blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", | |
| 2749 | 2749 | zUuid, alert_hostname(zFrom)); |
| 2750 | 2750 | zIrt = db_column_text(&q, 4); |
| 2751 | 2751 | if( zIrt && zIrt[0] ){ |
| 2752 | 2752 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2753 | 2753 | zIrt, alert_hostname(zFrom)); |
| @@ -3252,11 +3252,11 @@ | ||
| 3252 | 3252 | ); |
| 3253 | 3253 | while( db_step(&q)==SQLITE_ROW ){ |
| 3254 | 3254 | Blob hdr, body; |
| 3255 | 3255 | blob_init(&hdr, 0, 0); |
| 3256 | 3256 | blob_init(&body, 0, 0); |
| 3257 | - alert_renewal_msg(&hdr, &body, | |
| 3257 | + alert_renewal_msg(&hdr, &body, | |
| 3258 | 3258 | db_column_text(&q,0), |
| 3259 | 3259 | db_column_int(&q,1), |
| 3260 | 3260 | db_column_text(&q,2), |
| 3261 | 3261 | db_column_text(&q,3), |
| 3262 | 3262 | zRepoName, zUrl); |
| @@ -3322,11 +3322,11 @@ | ||
| 3322 | 3322 | style_header("Outbound Email Disabled"); |
| 3323 | 3323 | @ <p>Outbound email is disabled on this repository |
| 3324 | 3324 | style_finish_page(); |
| 3325 | 3325 | return; |
| 3326 | 3326 | } |
| 3327 | - if( P("submit")!=0 | |
| 3327 | + if( P("submit")!=0 | |
| 3328 | 3328 | && P("subject")!=0 |
| 3329 | 3329 | && P("msg")!=0 |
| 3330 | 3330 | && P("from")!=0 |
| 3331 | 3331 | && cgi_csrf_safe(2) |
| 3332 | 3332 | && captcha_is_correct(0) |
| 3333 | 3333 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -87,11 +87,11 @@ | |
| 87 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 88 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 89 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 90 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 91 | @ ) WITHOUT ROWID; |
| 92 | @ |
| 93 | @ -- Obsolete table. No longer used. |
| 94 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 95 | ; |
| 96 | |
| 97 | /* |
| @@ -876,11 +876,11 @@ | |
| 876 | int nTo = 0; |
| 877 | char **azTo = 0; |
| 878 | Blob v; |
| 879 | char *z, *zAddr; |
| 880 | int i; |
| 881 | |
| 882 | email_header_value(pMsg, "to", &v); |
| 883 | z = blob_str(&v); |
| 884 | for(i=0; z[i]; i++){ |
| 885 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 886 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -890,11 +890,11 @@ | |
| 890 | *pnTo = nTo; |
| 891 | *pazTo = azTo; |
| 892 | } |
| 893 | |
| 894 | /* |
| 895 | ** Free a list of To addresses obtained from a prior call to |
| 896 | ** email_header_to() |
| 897 | */ |
| 898 | void email_header_to_free(int nTo, char **azTo){ |
| 899 | int i; |
| 900 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -916,11 +916,11 @@ | |
| 916 | ** Message-Id: |
| 917 | ** Content-Type: |
| 918 | ** Content-Transfer-Encoding: |
| 919 | ** MIME-Version: |
| 920 | ** Sender: |
| 921 | ** |
| 922 | ** The caller maintains ownership of the input Blobs. This routine will |
| 923 | ** read the Blobs and send them onward to the email system, but it will |
| 924 | ** not free them. |
| 925 | ** |
| 926 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -929,11 +929,11 @@ | |
| 929 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 930 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 931 | ** email address based on a hash of zFromName and the domain of email-self, |
| 932 | ** and an additional "Sender:" field is inserted with the email-self |
| 933 | ** address. Downstream software might use the Sender header to set |
| 934 | ** the envelope-from address of the email. If zFromName is a NULL pointer, |
| 935 | ** then the "From:" is set to the email-self value and Sender is |
| 936 | ** omitted. |
| 937 | */ |
| 938 | void alert_send( |
| 939 | AlertSender *p, /* Emailer context */ |
| @@ -1046,11 +1046,11 @@ | |
| 1046 | ** a long-running server and will not be sending email notifications, |
| 1047 | ** then leave this setting blank. |
| 1048 | */ |
| 1049 | /* |
| 1050 | ** SETTING: email-admin width=40 |
| 1051 | ** This is the email address for the human administrator for the system. |
| 1052 | ** Abuse and trouble reports and password reset requests are send here. |
| 1053 | */ |
| 1054 | /* |
| 1055 | ** SETTING: email-subname width=16 |
| 1056 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1081,19 +1081,19 @@ | |
| 1081 | ** |
| 1082 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1083 | ** last batch of "your subscription is about to expire" emails were |
| 1084 | ** sent out. |
| 1085 | ** |
| 1086 | ** email-renew-cutoff is normally 7 days behind email-renew-warning. |
| 1087 | */ |
| 1088 | /* |
| 1089 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1090 | ** Determine the method used to send email. Allowed values are |
| 1091 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1092 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1093 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1094 | ** The "pipe" value means email messages are piped into a command |
| 1095 | ** determined by the email-send-command setting. The "dir" value means |
| 1096 | ** emails are written to individual files in a directory determined |
| 1097 | ** by the email-send-dir setting. The "db" value means that emails |
| 1098 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1099 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1134,11 +1134,11 @@ | |
| 1134 | */ |
| 1135 | |
| 1136 | |
| 1137 | /* |
| 1138 | ** COMMAND: alerts* |
| 1139 | ** |
| 1140 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1141 | ** |
| 1142 | ** Subcommands: |
| 1143 | ** |
| 1144 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1805,11 +1805,11 @@ | |
| 1805 | ** that constitutes verification of the email address. |
| 1806 | ** |
| 1807 | ** * The sid= query parameter contains an integer subscriberId. |
| 1808 | ** This only works for the administrator. It allows the |
| 1809 | ** administrator to edit any subscription. |
| 1810 | ** |
| 1811 | ** * The user is logged into an account other than "nobody" or |
| 1812 | ** "anonymous". In that case the notification settings |
| 1813 | ** associated with that account can be edited without needing |
| 1814 | ** to know the subscriber code. |
| 1815 | ** |
| @@ -1937,11 +1937,11 @@ | |
| 1937 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1938 | " unsubscribe"); |
| 1939 | }else{ |
| 1940 | alert_unsubscribe(sid, 1); |
| 1941 | db_commit_transaction(); |
| 1942 | return; |
| 1943 | } |
| 1944 | } |
| 1945 | style_set_current_feature("alerts"); |
| 1946 | style_header("Update Subscription"); |
| 1947 | db_prepare(&q, |
| @@ -2198,11 +2198,11 @@ | |
| 2198 | |
| 2199 | |
| 2200 | /* This is the message that gets sent to describe how to change |
| 2201 | ** or modify a subscription |
| 2202 | */ |
| 2203 | static const char zUnsubMsg[] = |
| 2204 | @ To changes your subscription settings at %s visit this link: |
| 2205 | @ |
| 2206 | @ %s/alerts/%s |
| 2207 | @ |
| 2208 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2243,13 +2243,13 @@ | |
| 2243 | int sid = 0; |
| 2244 | |
| 2245 | if( zName==0 ) zName = P("scode"); |
| 2246 | |
| 2247 | /* If a valid subscriber code is supplied, then either present the user |
| 2248 | ** with a comformation, or if already confirmed, unsubscribe immediately. |
| 2249 | */ |
| 2250 | if( zName |
| 2251 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2252 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2253 | ){ |
| 2254 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2255 | if( P(zUnsubName)!=0 ){ |
| @@ -2334,11 +2334,11 @@ | |
| 2334 | @ unsubscribe and/or modify your subscription settings</p> |
| 2335 | } |
| 2336 | alert_sender_free(pSender); |
| 2337 | style_finish_page(); |
| 2338 | return; |
| 2339 | } |
| 2340 | |
| 2341 | /* Non-logged-in users have to enter an email address to which is |
| 2342 | ** sent a message containing the unsubscribe link. |
| 2343 | */ |
| 2344 | style_header("Unsubscribe Request"); |
| @@ -2743,11 +2743,11 @@ | |
| 2743 | if( p->needMod ){ |
| 2744 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2745 | zSub, zTitle); |
| 2746 | }else{ |
| 2747 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2748 | blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", |
| 2749 | zUuid, alert_hostname(zFrom)); |
| 2750 | zIrt = db_column_text(&q, 4); |
| 2751 | if( zIrt && zIrt[0] ){ |
| 2752 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2753 | zIrt, alert_hostname(zFrom)); |
| @@ -3252,11 +3252,11 @@ | |
| 3252 | ); |
| 3253 | while( db_step(&q)==SQLITE_ROW ){ |
| 3254 | Blob hdr, body; |
| 3255 | blob_init(&hdr, 0, 0); |
| 3256 | blob_init(&body, 0, 0); |
| 3257 | alert_renewal_msg(&hdr, &body, |
| 3258 | db_column_text(&q,0), |
| 3259 | db_column_int(&q,1), |
| 3260 | db_column_text(&q,2), |
| 3261 | db_column_text(&q,3), |
| 3262 | zRepoName, zUrl); |
| @@ -3322,11 +3322,11 @@ | |
| 3322 | style_header("Outbound Email Disabled"); |
| 3323 | @ <p>Outbound email is disabled on this repository |
| 3324 | style_finish_page(); |
| 3325 | return; |
| 3326 | } |
| 3327 | if( P("submit")!=0 |
| 3328 | && P("subject")!=0 |
| 3329 | && P("msg")!=0 |
| 3330 | && P("from")!=0 |
| 3331 | && cgi_csrf_safe(2) |
| 3332 | && captcha_is_correct(0) |
| 3333 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -87,11 +87,11 @@ | |
| 87 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 88 | @ sentSep BOOLEAN DEFAULT false, -- individual alert sent |
| 89 | @ sentDigest BOOLEAN DEFAULT false, -- digest alert sent |
| 90 | @ sentMod BOOLEAN DEFAULT false -- pending moderation alert sent |
| 91 | @ ) WITHOUT ROWID; |
| 92 | @ |
| 93 | @ -- Obsolete table. No longer used. |
| 94 | @ DROP TABLE IF EXISTS repository.alert_bounce; |
| 95 | ; |
| 96 | |
| 97 | /* |
| @@ -876,11 +876,11 @@ | |
| 876 | int nTo = 0; |
| 877 | char **azTo = 0; |
| 878 | Blob v; |
| 879 | char *z, *zAddr; |
| 880 | int i; |
| 881 | |
| 882 | email_header_value(pMsg, "to", &v); |
| 883 | z = blob_str(&v); |
| 884 | for(i=0; z[i]; i++){ |
| 885 | if( z[i]=='<' && (zAddr = email_copy_addr(&z[i+1],'>'))!=0 ){ |
| 886 | azTo = fossil_realloc(azTo, sizeof(azTo[0])*(nTo+1) ); |
| @@ -890,11 +890,11 @@ | |
| 890 | *pnTo = nTo; |
| 891 | *pazTo = azTo; |
| 892 | } |
| 893 | |
| 894 | /* |
| 895 | ** Free a list of To addresses obtained from a prior call to |
| 896 | ** email_header_to() |
| 897 | */ |
| 898 | void email_header_to_free(int nTo, char **azTo){ |
| 899 | int i; |
| 900 | for(i=0; i<nTo; i++) fossil_free(azTo[i]); |
| @@ -916,11 +916,11 @@ | |
| 916 | ** Message-Id: |
| 917 | ** Content-Type: |
| 918 | ** Content-Transfer-Encoding: |
| 919 | ** MIME-Version: |
| 920 | ** Sender: |
| 921 | ** |
| 922 | ** The caller maintains ownership of the input Blobs. This routine will |
| 923 | ** read the Blobs and send them onward to the email system, but it will |
| 924 | ** not free them. |
| 925 | ** |
| 926 | ** The Message-Id: field is added if there is not already a Message-Id |
| @@ -929,11 +929,11 @@ | |
| 929 | ** If the zFromName argument is not NULL, then it should be a human-readable |
| 930 | ** name or handle for the sender. In that case, "From:" becomes a made-up |
| 931 | ** email address based on a hash of zFromName and the domain of email-self, |
| 932 | ** and an additional "Sender:" field is inserted with the email-self |
| 933 | ** address. Downstream software might use the Sender header to set |
| 934 | ** the envelope-from address of the email. If zFromName is a NULL pointer, |
| 935 | ** then the "From:" is set to the email-self value and Sender is |
| 936 | ** omitted. |
| 937 | */ |
| 938 | void alert_send( |
| 939 | AlertSender *p, /* Emailer context */ |
| @@ -1046,11 +1046,11 @@ | |
| 1046 | ** a long-running server and will not be sending email notifications, |
| 1047 | ** then leave this setting blank. |
| 1048 | */ |
| 1049 | /* |
| 1050 | ** SETTING: email-admin width=40 |
| 1051 | ** This is the email address for the human administrator for the system. |
| 1052 | ** Abuse and trouble reports and password reset requests are send here. |
| 1053 | */ |
| 1054 | /* |
| 1055 | ** SETTING: email-subname width=16 |
| 1056 | ** This is a short name used to identifies the repository in the Subject: |
| @@ -1081,19 +1081,19 @@ | |
| 1081 | ** |
| 1082 | ** email-renew-warning is the time (in days since 1970-01-01) when the |
| 1083 | ** last batch of "your subscription is about to expire" emails were |
| 1084 | ** sent out. |
| 1085 | ** |
| 1086 | ** email-renew-cutoff is normally 7 days behind email-renew-warning. |
| 1087 | */ |
| 1088 | /* |
| 1089 | ** SETTING: email-send-method width=5 default=off sensitive |
| 1090 | ** Determine the method used to send email. Allowed values are |
| 1091 | ** "off", "relay", "pipe", "dir", "db", and "stdout". The "off" value |
| 1092 | ** means no email is ever sent. The "relay" value means emails are sent |
| 1093 | ** to an Mail Sending Agent using SMTP located at email-send-relayhost. |
| 1094 | ** The "pipe" value means email messages are piped into a command |
| 1095 | ** determined by the email-send-command setting. The "dir" value means |
| 1096 | ** emails are written to individual files in a directory determined |
| 1097 | ** by the email-send-dir setting. The "db" value means that emails |
| 1098 | ** are added to an SQLite database named by the* email-send-db setting. |
| 1099 | ** The "stdout" value writes email text to standard output, for debugging. |
| @@ -1134,11 +1134,11 @@ | |
| 1134 | */ |
| 1135 | |
| 1136 | |
| 1137 | /* |
| 1138 | ** COMMAND: alerts* |
| 1139 | ** |
| 1140 | ** Usage: %fossil alerts SUBCOMMAND ARGS... |
| 1141 | ** |
| 1142 | ** Subcommands: |
| 1143 | ** |
| 1144 | ** pending Show all pending alerts. Useful for debugging. |
| @@ -1805,11 +1805,11 @@ | |
| 1805 | ** that constitutes verification of the email address. |
| 1806 | ** |
| 1807 | ** * The sid= query parameter contains an integer subscriberId. |
| 1808 | ** This only works for the administrator. It allows the |
| 1809 | ** administrator to edit any subscription. |
| 1810 | ** |
| 1811 | ** * The user is logged into an account other than "nobody" or |
| 1812 | ** "anonymous". In that case the notification settings |
| 1813 | ** associated with that account can be edited without needing |
| 1814 | ** to know the subscriber code. |
| 1815 | ** |
| @@ -1937,11 +1937,11 @@ | |
| 1937 | zErr = mprintf("Select this checkbox and press \"Unsubscribe\" again to" |
| 1938 | " unsubscribe"); |
| 1939 | }else{ |
| 1940 | alert_unsubscribe(sid, 1); |
| 1941 | db_commit_transaction(); |
| 1942 | return; |
| 1943 | } |
| 1944 | } |
| 1945 | style_set_current_feature("alerts"); |
| 1946 | style_header("Update Subscription"); |
| 1947 | db_prepare(&q, |
| @@ -2198,11 +2198,11 @@ | |
| 2198 | |
| 2199 | |
| 2200 | /* This is the message that gets sent to describe how to change |
| 2201 | ** or modify a subscription |
| 2202 | */ |
| 2203 | static const char zUnsubMsg[] = |
| 2204 | @ To changes your subscription settings at %s visit this link: |
| 2205 | @ |
| 2206 | @ %s/alerts/%s |
| 2207 | @ |
| 2208 | @ To completely unsubscribe from %s, visit the following link: |
| @@ -2243,13 +2243,13 @@ | |
| 2243 | int sid = 0; |
| 2244 | |
| 2245 | if( zName==0 ) zName = P("scode"); |
| 2246 | |
| 2247 | /* If a valid subscriber code is supplied, then either present the user |
| 2248 | ** with a confirmation, or if already confirmed, unsubscribe immediately. |
| 2249 | */ |
| 2250 | if( zName |
| 2251 | && (sid = db_int(0, "SELECT subscriberId FROM subscriber" |
| 2252 | " WHERE subscriberCode=hextoblob(%Q)", zName))!=0 |
| 2253 | ){ |
| 2254 | char *zUnsubName = mprintf("confirm%04x", sid); |
| 2255 | if( P(zUnsubName)!=0 ){ |
| @@ -2334,11 +2334,11 @@ | |
| 2334 | @ unsubscribe and/or modify your subscription settings</p> |
| 2335 | } |
| 2336 | alert_sender_free(pSender); |
| 2337 | style_finish_page(); |
| 2338 | return; |
| 2339 | } |
| 2340 | |
| 2341 | /* Non-logged-in users have to enter an email address to which is |
| 2342 | ** sent a message containing the unsubscribe link. |
| 2343 | */ |
| 2344 | style_header("Unsubscribe Request"); |
| @@ -2743,11 +2743,11 @@ | |
| 2743 | if( p->needMod ){ |
| 2744 | blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", |
| 2745 | zSub, zTitle); |
| 2746 | }else{ |
| 2747 | blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); |
| 2748 | blob_appendf(&p->hdr, "Message-Id: <%.32s@%s>\r\n", |
| 2749 | zUuid, alert_hostname(zFrom)); |
| 2750 | zIrt = db_column_text(&q, 4); |
| 2751 | if( zIrt && zIrt[0] ){ |
| 2752 | blob_appendf(&p->hdr, "In-Reply-To: <%.32s@%s>\r\n", |
| 2753 | zIrt, alert_hostname(zFrom)); |
| @@ -3252,11 +3252,11 @@ | |
| 3252 | ); |
| 3253 | while( db_step(&q)==SQLITE_ROW ){ |
| 3254 | Blob hdr, body; |
| 3255 | blob_init(&hdr, 0, 0); |
| 3256 | blob_init(&body, 0, 0); |
| 3257 | alert_renewal_msg(&hdr, &body, |
| 3258 | db_column_text(&q,0), |
| 3259 | db_column_int(&q,1), |
| 3260 | db_column_text(&q,2), |
| 3261 | db_column_text(&q,3), |
| 3262 | zRepoName, zUrl); |
| @@ -3322,11 +3322,11 @@ | |
| 3322 | style_header("Outbound Email Disabled"); |
| 3323 | @ <p>Outbound email is disabled on this repository |
| 3324 | style_finish_page(); |
| 3325 | return; |
| 3326 | } |
| 3327 | if( P("submit")!=0 |
| 3328 | && P("subject")!=0 |
| 3329 | && P("msg")!=0 |
| 3330 | && P("from")!=0 |
| 3331 | && cgi_csrf_safe(2) |
| 3332 | && captcha_is_correct(0) |
| 3333 |