Fossil SCM
Updates the email-sender TCL script so that it appends a "-f" argument to sendmail which is the "From:" email address.
Commit
a52499fdc4c9f148120a2f8eca15b82251d320fa41d4764a8c45716f30072053
Parent
b17aba9e20d8237…
1 file changed
+5
-1
+5
-1
| --- tools/email-sender.tcl | ||
| +++ tools/email-sender.tcl | ||
| @@ -21,11 +21,15 @@ | ||
| 21 | 21 | } |
| 22 | 22 | while {1} { |
| 23 | 23 | db transaction immediate { |
| 24 | 24 | set n 0 |
| 25 | 25 | 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] | |
| 27 | 31 | puts -nonewline $out $msg |
| 28 | 32 | flush $out |
| 29 | 33 | close $out |
| 30 | 34 | incr n |
| 31 | 35 | } |
| 32 | 36 |
| --- 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 |