Fossil SCM

Updates the email-sender TCL script so that it appends a "-f" argument to sendmail which is the "From:" email address.

drh 2020-05-28 15:46 trunk
Commit a52499fdc4c9f148120a2f8eca15b82251d320fa41d4764a8c45716f30072053
1 file changed +5 -1
--- tools/email-sender.tcl
+++ tools/email-sender.tcl
@@ -21,11 +21,15 @@
2121
}
2222
while {1} {
2323
db transaction immediate {
2424
set n 0
2525
db eval {SELECT msg FROM email} {
26
- set out [open |$PIPE w]
26
+ set pipe $PIPE
27
+ if {[regexp {\nFrom:[^\n]*<([^>]+)>} $msg all addr]} {
28
+ append pipe " -f $addr"
29
+ }
30
+ set out [open |$pipe w]
2731
puts -nonewline $out $msg
2832
flush $out
2933
close $out
3034
incr n
3135
}
3236
--- tools/email-sender.tcl
+++ tools/email-sender.tcl
@@ -21,11 +21,15 @@
21 }
22 while {1} {
23 db transaction immediate {
24 set n 0
25 db eval {SELECT msg FROM email} {
26 set out [open |$PIPE w]
 
 
 
 
27 puts -nonewline $out $msg
28 flush $out
29 close $out
30 incr n
31 }
32
--- tools/email-sender.tcl
+++ tools/email-sender.tcl
@@ -21,11 +21,15 @@
21 }
22 while {1} {
23 db transaction immediate {
24 set n 0
25 db eval {SELECT msg FROM email} {
26 set pipe $PIPE
27 if {[regexp {\nFrom:[^\n]*<([^>]+)>} $msg all addr]} {
28 append pipe " -f $addr"
29 }
30 set out [open |$pipe w]
31 puts -nonewline $out $msg
32 flush $out
33 close $out
34 incr n
35 }
36

Keyboard Shortcuts

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