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
606fca10
...
606fca10b6570f9fc4be3e3117fd147aac2a2039
authored
2008-10-23 16:52:33 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
New tag :user.
1 parent
7cc7c42f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
libsieve/extensions/spamd.c
libsieve/extensions/spamd.c
View file @
606fca1
...
...
@@ -235,6 +235,7 @@ sigpipe_handler (int sig MU_ARG_UNUSED)
/* Syntax: spamd [":host" <tcp-host: string]
[":port" <tcp-port: number> /
":socket" <unix-socket: string>]
[":user" <name: string>]
[":over" / ":under" <limit: string>]
The "spamd" test is an interface to "spamd" facility of
...
...
@@ -269,7 +270,6 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
mu_sieve_value_t
*
arg
;
mu_message_t
msg
;
size_t
m_size
,
m_lines
,
size
;
struct
mu_auth_data
*
auth
;
signal_handler
handler
;
char
*
host
;
mu_header_t
hdr
;
...
...
@@ -302,12 +302,17 @@ spamd_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
mu_message_size
(
msg
,
&
m_size
);
mu_message_lines
(
msg
,
&
m_lines
);
auth
=
mu_get_auth_by_uid
(
geteuid
());
spamd_send_command
(
stream
,
"SYMBOLS SPAMC/1.2"
);
spamd_send_command
(
stream
,
"Content-length: %lu"
,
(
u_long
)
(
m_size
+
m_lines
));
if
(
mu_sieve_tag_lookup
(
tags
,
"user"
,
&
arg
))
spamd_send_command
(
stream
,
"User: %s"
,
arg
);
else
{
struct
mu_auth_data
*
auth
=
mu_get_auth_by_uid
(
geteuid
());
spamd_send_command
(
stream
,
"User: %s"
,
auth
?
auth
->
name
:
"root"
);
mu_auth_data_free
(
auth
);
}
got_sigpipe
=
0
;
handler
=
set_signal_handler
(
SIGPIPE
,
sigpipe_handler
);
...
...
@@ -411,6 +416,7 @@ static mu_sieve_tag_def_t spamd_tags[] = {
{
"host"
,
SVT_STRING
},
{
"port"
,
SVT_NUMBER
},
{
"socket"
,
SVT_STRING
},
{
"user"
,
SVT_STRING
},
{
"over"
,
SVT_STRING
},
{
"under"
,
SVT_STRING
},
{
NULL
}
...
...
Please
register
or
sign in
to post a comment