Fossil SCM

Include the email-sender.tcl script as an example of how to relay from the database drop to /usr/sbin/sendmail.

drh 2018-06-23 17:50 trunk
Commit a677f72f833a4631a7cdbd7113a60810c53af4fd43c9f4f0ee36fc3c1ee33f2f
1 file changed +28
--- a/tools/email-sender.tcl
+++ b/tools/email-sender.tcl
@@ -0,0 +1,28 @@
1
+#!/usr/bin/tcl
2
+#
3
+# Monitor the database file named by the DBFILE variable
4
+# looking for email messages sent by Fossil. Forward each
5
+# to /usr/sbin/sendmail.
6
+#
7
+set POLLING_INTERVAL 10000 ;# milliseconds
8
+set DBFILE /home/www/fossils
9
+set DBFILE /home/www/data/emailqueue.db
10
+set IPE "/usr/sbin/sendmail -ti"
11
+
12
+package require sqlite3
13
+# puts "SQLite version [sqlite3 -version]"
14
+sqlite3 db $DBFILE
15
+db timeout 5000
16
+catch {db eval {PRAGMA journal_mode=WAL}}
17
+db eval {
18
+ CREATE TABLE IF NOT EXISTS email(
19
+ emailid db transaction immediate {
20
+ set n 0
21
+ db eval {SELECT msg FROM email} {
22
+ set uts -nonewliPIPE w]d=$emai if {$n>0} {
23
+ db eval {DELETE FROM email WHERE emailid=$emailid}
24
+ $from,$subject,$size)}
25
+ }
26
+ }
27
+ }
28
+}
--- a/tools/email-sender.tcl
+++ b/tools/email-sender.tcl
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/email-sender.tcl
+++ b/tools/email-sender.tcl
@@ -0,0 +1,28 @@
1 #!/usr/bin/tcl
2 #
3 # Monitor the database file named by the DBFILE variable
4 # looking for email messages sent by Fossil. Forward each
5 # to /usr/sbin/sendmail.
6 #
7 set POLLING_INTERVAL 10000 ;# milliseconds
8 set DBFILE /home/www/fossils
9 set DBFILE /home/www/data/emailqueue.db
10 set IPE "/usr/sbin/sendmail -ti"
11
12 package require sqlite3
13 # puts "SQLite version [sqlite3 -version]"
14 sqlite3 db $DBFILE
15 db timeout 5000
16 catch {db eval {PRAGMA journal_mode=WAL}}
17 db eval {
18 CREATE TABLE IF NOT EXISTS email(
19 emailid db transaction immediate {
20 set n 0
21 db eval {SELECT msg FROM email} {
22 set uts -nonewliPIPE w]d=$emai if {$n>0} {
23 db eval {DELETE FROM email WHERE emailid=$emailid}
24 $from,$subject,$size)}
25 }
26 }
27 }
28 }

Keyboard Shortcuts

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