Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
4943e83c
...
4943e83c209699cbb9e0880a777e66d2ccfef44d
authored
2001-08-18 17:32:15 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Moved sieve-message-bounce to sieve-core.scm
1 parent
f5d3343a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
39 deletions
guimb/scm/redirect.scm
guimb/scm/redirect.scm
View file @
4943e83
...
...
@@ -17,45 +17,6 @@
;;;; This module provides sieve's "redirect" action.
(
use-modules
(
ice-9
popen
))
(
define
PATH-SENDMAIL
"/usr/lib/sendmail"
)
(
define
sieve-my-email
""
)
;;; Bounce a message.
;;; Current mailutils API does not provide a way to send a message
;;; specifying its recipients (like "sendmail -t foo@bar.org" does),
;;; hence the need for this function.
(
define
(
sieve-message-bounce
message
addr-list
)
(
catch
#t
(
lambda
()
(
let
((
port
(
open-output-pipe
(
apply
string-append
(
append
(
list
PATH-SENDMAIL
" -oi -t "
)
(
map
(
lambda
(
addr
)
(
string-append
addr
" "
))
addr-list
))))))
;; Write headers
(
for-each
(
lambda
(
hdr
)
(
display
(
string-append
(
car
hdr
)
": "
(
cdr
hdr
))
port
)
(
newline
port
))
(
mu-message-get-header-fields
message
))
(
newline
port
)
;; Write body
(
let
((
body
(
mu-message-get-body
message
)))
(
do
((
line
(
mu-body-read-line
body
)
(
mu-body-read-line
body
)))
((
eof-object?
line
)
#f
)
(
display
line
port
)))
(
close-output-port
port
)))
(
lambda
args
(
runtime-error
LOG_ERR
"redirect: Can't send message"
)
(
write
args
))))
;;; rfc3028 says:
;;; "Implementations SHOULD take measures to implement loop control,"
;;; We do this by appending an "X-Sender" header to each message
...
...
@@ -91,3 +52,4 @@
(
sieve-register-action
"redirect"
action-redirect
'string
))
...
...
Please
register
or
sign in
to post a comment