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
e7730fe5
...
e7730fe57706ff1369892883141b696b292ad353
authored
2003-02-22 22:25:19 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Handle Fcc headers.
1 parent
5ea83ef7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
mailbox/mailer.c
mailbox/mailer.c
View file @
e7730fe
...
...
@@ -34,6 +34,9 @@
#include <mailutils/registrar.h>
#include <mailutils/stream.h>
#include <mailutils/url.h>
#include <mailutils/header.h>
#include <mailutils/mailbox.h>
#include <mailutils/message.h>
#include <mailer0.h>
...
...
@@ -259,8 +262,45 @@ mailer_check_to (address_t to)
return
0
;
}
static
void
save_fcc
(
message_t
msg
)
{
header_t
hdr
;
size_t
count
=
0
,
i
;
char
buf
[
512
];
if
(
message_get_header
(
msg
,
&
hdr
))
return
;
if
(
header_get_value
(
hdr
,
MU_HEADER_FCC
,
NULL
,
0
,
NULL
))
return
;
header_get_field_count
(
hdr
,
&
count
);
for
(
i
=
1
;
i
<=
count
;
i
++
)
{
mailbox_t
mbox
;
header_get_field_name
(
hdr
,
i
,
buf
,
sizeof
buf
,
NULL
);
if
(
strcasecmp
(
buf
,
MU_HEADER_FCC
)
==
0
)
{
if
(
header_get_field_value
(
hdr
,
i
,
buf
,
sizeof
buf
,
NULL
))
continue
;
if
(
mailbox_create_default
(
&
mbox
,
buf
))
continue
;
/*FIXME: error message?? */
if
(
mailbox_open
(
mbox
,
MU_STREAM_RDWR
|
MU_STREAM_CREAT
|
MU_STREAM_APPEND
)
==
0
)
{
mailbox_append_message
(
mbox
,
msg
);
mailbox_flush
(
mbox
,
0
);
}
mailbox_close
(
mbox
);
mailbox_destroy
(
&
mbox
);
}
}
}
int
mailer_send_message
(
mailer_t
mailer
,
message_t
msg
,
address_t
from
,
address_t
to
)
mailer_send_message
(
mailer_t
mailer
,
message_t
msg
,
address_t
from
,
address_t
to
)
{
int
status
;
...
...
@@ -282,7 +322,8 @@ mailer_send_message (mailer_t mailer, message_t msg, address_t from, address_t t
if
((
status
=
mailer_check_to
(
to
))
!=
0
)
return
status
;
}
save_fcc
(
msg
);
return
mailer
->
_send_message
(
mailer
,
msg
,
from
,
to
);
}
...
...
Please
register
or
sign in
to post a comment