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
c5b57b85
...
c5b57b857207cbe4bb2e86b47753deb6a4d98c61
authored
2003-12-28 22:13:29 +0000
by
uid65697
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
New option --message-id-header
1 parent
07ba942e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
16 deletions
mail.local/main.c
mail.local/main.c
View file @
c5b57b8
...
...
@@ -17,19 +17,25 @@
#include <mail.local.h>
int
multiple_delivery
;
int
ex_quota_tempfail
;
int
exit_code
=
EX_OK
;
uid_t
uid
;
char
*
quotadbname
=
NULL
;
int
lock_timeout
=
300
;
int
multiple_delivery
;
/* Don't return errors when delivering to multiple
recipients */
int
ex_quota_tempfail
;
/* Return temporary failure if mailbox quota is
exceeded. If this variable is not set, mail.local
will return "service unavailable" */
int
exit_code
=
EX_OK
;
/* Exit code to be used */
uid_t
uid
;
/* Current user name */
char
*
quotadbname
=
NULL
;
/* Name of mailbox quota database */
int
lock_timeout
=
300
;
/* Locking timeout in seconds */
/* Debuggig options */
int
debug_level
;
int
debug_flags
;
int
sieve_debug_flags
;
int
sieve_enable_log
;
mu_debug_t
mudebug
;
int
debug_level
;
/* General debugging level */
int
debug_flags
;
/* Mailutils debugging flags */
int
sieve_debug_flags
;
/* Sieve debugging flags */
int
sieve_enable_log
;
/* Enables logging of executed Sieve actions */
char
*
message_id_header
;
/* Use the value of this header as message
identifier when logging Sieve actions */
mu_debug_t
mudebug
;
/* Mailutils debugging object */
#define MAXFD 64
#define EX_QUOTA() (ex_quota_tempfail ? EX_TEMPFAIL : EX_UNAVAILABLE)
...
...
@@ -59,6 +65,7 @@ static char args_doc[] = N_("recipient [recipient ...]");
#define ARG_MULTIPLE_DELIVERY 1
#define ARG_QUOTA_TEMPFAIL 2
#define ARG_MESSAGE_ID_HEADER 3
static
struct
argp_option
options
[]
=
{
...
...
@@ -75,6 +82,8 @@ static struct argp_option options[] =
#endif
{
"sieve"
,
'S'
,
N_
(
"PATTERN"
),
0
,
N_
(
"Set name pattern for user-defined sieve mail filters"
),
0
},
{
"message-id-header"
,
ARG_MESSAGE_ID_HEADER
,
N_
(
"STRING"
),
0
,
N_
(
"Identify messages by the value of this header when logging Sieve actions"
),
0
},
#ifdef WITH_GUILE
{
"source"
,
's'
,
N_
(
"PATTERN"
),
0
,
N_
(
"Set name pattern for user-defined mail filters"
),
0
},
...
...
@@ -127,6 +136,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
ex_quota_tempfail
=
1
;
break
;
case
ARG_MESSAGE_ID_HEADER
:
message_id_header
=
arg
;
break
;
case
'r'
:
case
'f'
:
if
(
from
!=
NULL
)
...
...
@@ -227,12 +240,27 @@ _sieve_action_log (void *user_name,
const
char
*
script
,
size_t
msgno
,
message_t
msg
,
const
char
*
action
,
const
char
*
fmt
,
va_list
ap
)
{
size_t
uid
=
0
;
char
*
text
=
NULL
;
message_get_uid
(
msg
,
&
uid
);
asprintf
(
&
text
,
_
(
"%s on msg uid %d"
),
action
,
uid
);
if
(
message_id_header
)
{
header_t
hdr
=
NULL
;
char
*
val
=
NULL
;
message_get_header
(
msg
,
&
hdr
);
if
(
header_aget_value
(
hdr
,
message_id_header
,
&
val
)
==
0
||
header_aget_value
(
hdr
,
MU_HEADER_MESSAGE_ID
,
&
val
)
==
0
)
{
asprintf
(
&
text
,
_
(
"%s on msg %s"
),
action
,
val
);
free
(
val
);
}
}
if
(
text
==
NULL
)
{
size_t
uid
=
0
;
message_get_uid
(
msg
,
&
uid
);
asprintf
(
&
text
,
_
(
"%s on msg uid %d"
),
action
,
uid
);
}
if
(
fmt
&&
strlen
(
fmt
))
{
char
*
diag
=
NULL
;
...
...
@@ -797,7 +825,7 @@ notify_biff (mailbox_t mbox, char *name, size_t size)
inaddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
inaddr
.
sin_port
=
sp
->
s_port
;
fd
=
socket
(
A
F_INET
,
SOCK_DGRAM
,
0
);
fd
=
socket
(
P
F_INET
,
SOCK_DGRAM
,
0
);
if
(
fd
<
0
)
fd
=
-
2
;
/* Mark failed initialization */
}
...
...
Please
register
or
sign in
to post a comment