Fossil

Check-in [8c0ec30b]
Login

Check-in [8c0ec30b]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changed all of the "sendmail -t" commands to "sendmail -ti" to make it ignore lines containing only a dot; we use EOF to signal "end of message," so we don't need the second signal. This is separate from the smtp.c fix in [51740ce45f]: that's only used when Fossil speaks directly to an SMTP server, where a leading dot is treated somewhat differently than the lone dot rule for sendmail(1)'s stdin.

This problem with leading dots was diagnosed by gumblex, /forumpost/4290f75ba1.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8c0ec30bc3e84013b63447f8ea0c92ea5ac34297e487e72b1c671442d9e7fae3
User & Date: wyoung 2018-08-14 05:59:45
Original Comment: Changed all of the "sendmail -t" commands to "sendmail -ti" to make it ignore lines containing only a dot. This is separate from the smtp.c fix checked in just prior: that's about the SMTP level, where a leading dot is treated somewhat differently than the lone dot rule for sendmail(1)'s stdin. Need for fix noticed by gumblex on the forums.
References
2018-08-14
03:55
The blob-to-SMTP encoding logic was not strictly following RFC 5321 in that it was only dealing with the lone dot on the line case, doubling it to prevent the SMTP server from interpreting that as end-of-message. It missed the case where, if anything follows the dot, SMTP drops the leading dot, so you must also double the leading dot in that case. Basically, you always double a leading dot, regardless of line length.

This only affects Fossil's direct-to-SMTP email sending case, not those that send via a piped command or via DB. That is dealt with later in [8c0ec30bc3]. ... (check-in: 51740ce4 user: wyoung tags: trunk)

Context
2018-08-14
13:05
Don't use "file nativename" in makemake.tcl, because it gives a different win/Makefile.msc when run on UNIX ... (check-in: af80be5c user: jan.nijtmans tags: trunk)
05:59
Changed all of the "sendmail -t" commands to "sendmail -ti" to make it ignore lines containing only a dot; we use EOF to signal "end of message," so we don't need the second signal. This is separate from the smtp.c fix in [51740ce45f]: that's only used when Fossil speaks directly to an SMTP server, where a leading dot is treated somewhat differently than the lone dot rule for sendmail(1)'s stdin.

This problem with leading dots was diagnosed by gumblex, /forumpost/4290f75ba1. ... (check-in: 8c0ec30b user: wyoung tags: trunk)

04:39
URL fix ... (check-in: 6787aac9 user: wyoung tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/email.c.

262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
       "off", count(azSendMethods)/2, azSendMethods);
  @ <p>How to send email.  Requires auxiliary information from the fields
  @ that follow.  Hint: Use the <a href="%R/announce">/announce</a> page
  @ to send test message to debug this setting.
  @ (Property: "email-send-method")</p>
  email_schema(1);
  entry_attribute("Pipe Email Text Into This Command", 60, "email-send-command",
                   "ecmd", "sendmail -t", 0);
  @ <p>When the send method is "pipe to a command", this is the command
  @ that is run.  Email messages are piped into the standard input of this
  @ command.  The command is expected to extract the sender address,
  @ recepient addresses, and subject from the header of the piped email
  @ text.  (Property: "email-send-command")</p>

  entry_attribute("Store Emails In This Database", 60, "email-send-db",







|







262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
       "off", count(azSendMethods)/2, azSendMethods);
  @ <p>How to send email.  Requires auxiliary information from the fields
  @ that follow.  Hint: Use the <a href="%R/announce">/announce</a> page
  @ to send test message to debug this setting.
  @ (Property: "email-send-method")</p>
  email_schema(1);
  entry_attribute("Pipe Email Text Into This Command", 60, "email-send-command",
                   "ecmd", "sendmail -ti", 0);
  @ <p>When the send method is "pipe to a command", this is the command
  @ that is run.  Email messages are piped into the standard input of this
  @ command.  The command is expected to extract the sender address,
  @ recepient addresses, and subject from the header of the piped email
  @ text.  (Property: "email-send-command")</p>

  entry_attribute("Store Emails In This Database", 60, "email-send-db",

Changes to tools/email-sender.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/tcl
#
# Monitor the database file named by the DBFILE variable
# looking for email messages sent by Fossil.  Forward each
# to /usr/sbin/sendmail.
#
set POLLING_INTERVAL 10000   ;# milliseconds
set DBFILE /home/www/fossil/emailqueue.db
set PIPE "/usr/sbin/sendmail -t"

package require sqlite3
# puts "SQLite version [sqlite3 -version]"
sqlite3 db $DBFILE
db timeout 5000
catch {db eval {PRAGMA journal_mode=WAL}}
db eval {








|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/tcl
#
# Monitor the database file named by the DBFILE variable
# looking for email messages sent by Fossil.  Forward each
# to /usr/sbin/sendmail.
#
set POLLING_INTERVAL 10000   ;# milliseconds
set DBFILE /home/www/fossil/emailqueue.db
set PIPE "/usr/sbin/sendmail -ti"

package require sqlite3
# puts "SQLite version [sqlite3 -version]"
sqlite3 db $DBFILE
db timeout 5000
catch {db eval {PRAGMA journal_mode=WAL}}
db eval {

Changes to www/forum.wiki.

332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366

Give this command:

<verbatim>
    $ fossil set email-send-command
</verbatim>

If that gives a blank value instead of <tt>sendmail -t</tt>, say

<verbatim>
    $ fossil set email-send-command "sendmail -t"
</verbatim>

to force the setting. That's a
[https://fossil-scm.org/forum/forumpost/840b676410 | known bug] which
should be squished soon.

This is the correct command even if you're running Postfix or Exim
rather than Sendmail. These mail servers (and perhaps others) provide a
<tt>sendmail</tt> command for this very sort of reason: it lets programs
send email without having to care exactly which server implementation is
running at a given site.

<a id="status"></a>If you reload the Email Notification Setup page, the
Status section at the top should show:

<verbatim>
    Outgoing Email: Piped to command "sendmail -t"
    Pending Alerts: 0 normal, 0 digest
    Subscribers:    0 active, 0 total
</verbatim>


<h4 id="subscribe">Subscribe to Alerts</h4>








|


|
















|







332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366

Give this command:

<verbatim>
    $ fossil set email-send-command
</verbatim>

If that gives a blank value instead of <tt>sendmail -ti</tt>, say

<verbatim>
    $ fossil set email-send-command "sendmail -ti"
</verbatim>

to force the setting. That's a
[https://fossil-scm.org/forum/forumpost/840b676410 | known bug] which
should be squished soon.

This is the correct command even if you're running Postfix or Exim
rather than Sendmail. These mail servers (and perhaps others) provide a
<tt>sendmail</tt> command for this very sort of reason: it lets programs
send email without having to care exactly which server implementation is
running at a given site.

<a id="status"></a>If you reload the Email Notification Setup page, the
Status section at the top should show:

<verbatim>
    Outgoing Email: Piped to command "sendmail -ti"
    Pending Alerts: 0 normal, 0 digest
    Subscribers:    0 active, 0 total
</verbatim>


<h4 id="subscribe">Subscribe to Alerts</h4>