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
21476083
...
214760832d70f58e1d64e3b74bbac710f284546d
authored
2002-11-18 17:09:03 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sieve_get_mailer,sieve_set_mailer,sieve_get_daemo_email,sieve_set_daemon_email): New functions.
1 parent
ca113f17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
6 deletions
libsieve/sieve.y
libsieve/sieve.y
View file @
2147608
...
...
@@ -361,39 +361,39 @@ sieve_machine_init (sieve_machine_t *pmach, void *data)
}
void
sieve_
machine_
set_error (sieve_machine_t mach, sieve_printf_t error_printer)
sieve_set_error (sieve_machine_t mach, sieve_printf_t error_printer)
{
mach->error_printer = error_printer ?
error_printer : _sieve_default_error_printer;
}
void
sieve_
machine_
set_parse_error (sieve_machine_t mach, sieve_parse_error_t p)
sieve_set_parse_error (sieve_machine_t mach, sieve_parse_error_t p)
{
mach->parse_error_printer = p ? p : _sieve_default_parse_error;
}
void
sieve_
machine_
set_debug (sieve_machine_t mach, sieve_printf_t debug)
sieve_set_debug (sieve_machine_t mach, sieve_printf_t debug)
{
mach->debug_printer = debug;
}
void
sieve_
machine_
set_debug_level (sieve_machine_t mach, mu_debug_t dbg, int level)
sieve_set_debug_level (sieve_machine_t mach, mu_debug_t dbg, int level)
{
mach->mu_debug = dbg;
mach->debug_level = level;
}
void
sieve_
machine_
set_logger (sieve_machine_t mach, sieve_action_log_t logger)
sieve_set_logger (sieve_machine_t mach, sieve_action_log_t logger)
{
mach->logger = logger;
}
void
sieve_
machine_
set_ticket (sieve_machine_t mach, ticket_t ticket)
sieve_set_ticket (sieve_machine_t mach, ticket_t ticket)
{
mach->ticket = ticket;
}
...
...
@@ -404,6 +404,46 @@ sieve_get_ticket (sieve_machine_t mach)
return mach->ticket;
}
mailer_t
sieve_get_mailer (sieve_machine_t mach)
{
if (!mach->mailer)
mailer_create (&mach->mailer, NULL);
return mach->mailer;
}
void
sieve_set_mailer (sieve_machine_t mach, mailer_t mailer)
{
mailer_destroy (&mach->mailer);
mach->mailer = mailer;
}
#define MAILER_DAEMON_PFX "MAILER-DAEMON@"
char *
sieve_get_daemon_email (sieve_machine_t mach)
{
if (!mach->daemon_email)
{
const char *domain = NULL;
mu_get_user_email_domain (&domain);
mach->daemon_email = sieve_palloc (&mach->memory_pool,
sizeof(MAILER_DAEMON_PFX) +
strlen (domain));
sprintf (mach->daemon_email, "%s%s", MAILER_DAEMON_PFX, domain);
}
return mach->daemon_email;
}
void
sieve_set_daemon_email (sieve_machine_t mach, const char *email)
{
sieve_pfree (&mach->memory_pool, (void *)mach->daemon_email);
mach->daemon_email = sieve_pstrdup (&mach->memory_pool, email);
}
struct sieve_destr_record
{
sieve_destructor_t destr;
...
...
@@ -441,6 +481,7 @@ sieve_machine_destroy (sieve_machine_t *pmach)
list_do (mach->destr_list, _run_destructor, NULL);
list_destroy (&mach->destr_list);
sieve_slist_destroy (&mach->memory_pool);
mailer_destroy (&mach->mailer);
free (mach);
*pmach = NULL;
}
...
...
Please
register
or
sign in
to post a comment