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
c6eef46c
...
c6eef46c15d976cac14815952cb49cb4f4069c1e
authored
2000-12-07 04:35:31 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Hunted down a nasty bug in the expunge code, bad bad.
1 parent
bbbdd3d8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
7 deletions
include/mailutils/observer.h
mailbox/mbx_mbox.c
mailbox/message.c
mailbox/sendmail.c
mailbox/smtp.c
include/mailutils/observer.h
View file @
c6eef46
...
...
@@ -45,6 +45,7 @@ typedef struct _observable* observable_t;
#define MU_EVT_MAILBOX_PROGRESS 0x020
#define MU_EVT_AUTHORITY_FAILED 0x030
#define MU_EVT_MAILBOX_CORRUPT 0x040
#define MU_EVT_MAILER_MESSAGE_SENT 0x080
#define MU_OBSERVER_NO_CHECK 1
...
...
mailbox/mbx_mbox.c
View file @
c6eef46
...
...
@@ -743,23 +743,24 @@ mbox_expunge (mailbox_t mailbox)
{
size_t
dlast
;
for
(
j
=
dirty
,
dlast
=
mud
->
messages_count
-
1
;
j
<
mud
->
messages_coun
t
;
j
++
)
j
<
=
dlas
t
;
j
++
)
{
/* Clear all the references, any attach messages been already
destroy above. */
mum
=
mud
->
umessages
[
j
];
if
(
mum
->
new_flags
&&
ATTRIBUTE_IS_DELETED
(
mum
->
new_flags
))
{
if
((
j
+
1
)
>=
mud
->
messages_coun
t
)
if
((
j
+
1
)
<=
dlas
t
)
{
/* Move all the pointers up. So the message pointer
part of mum will be at the right position. */
memmove
(
mud
->
umessages
+
j
,
mud
->
umessages
+
j
+
1
,
(
dlast
-
dirty
)
*
sizeof
(
mum
));
mum
->
header_from
=
mum
->
header_from_end
=
0
;
mum
->
header_status
=
mum
->
header_status_end
=
0
;
mum
->
body
=
mum
->
body_end
=
0
;
mum
->
header_lines
=
mum
->
body_lines
=
0
;
(
dlast
-
j
)
*
sizeof
(
mum
));
//mum->header_from = mum->header_from_end = 0;
//mum->header_status = mum->header_status_end = 0;
//mum->body = mum->body_end = 0;
//mum->header_lines = mum->body_lines = 0;
memset
(
mum
,
0
,
sizeof
(
*
mum
));
/* We are not free()ing the useless mum, but instead
we put it back in the pool, to be reuse. */
mud
->
umessages
[
dlast
]
=
mum
;
...
...
@@ -768,6 +769,10 @@ mbox_expunge (mailbox_t mailbox)
gets cleared to. */
mum
=
mud
->
umessages
[
j
];
}
else
{
memset
(
mum
,
0
,
sizeof
(
*
mum
));
}
}
mum
->
header_from
=
mum
->
header_from_end
=
0
;
mum
->
header_status
=
mum
->
header_status_end
=
0
;
...
...
mailbox/message.c
View file @
c6eef46
...
...
@@ -384,6 +384,7 @@ message_get_attribute (message_t msg, attribute_t *pattribute)
{
if
(
msg
==
NULL
||
pattribute
==
NULL
)
return
EINVAL
;
monitor_wrlock
(
msg
->
monitor
);
if
(
msg
->
attribute
==
NULL
)
{
...
...
mailbox/sendmail.c
View file @
c6eef46
...
...
@@ -234,6 +234,7 @@ sendmail_send_message (mailer_t mailer, message_t msg)
status
=
errno
;
else
if
(
WIFEXITED
(
status
))
status
=
WEXITSTATUS
(
status
);
observable_notify
(
mailer
->
observable
,
MU_EVT_MAILER_MESSAGE_SENT
);
}
default:
break
;
...
...
mailbox/smtp.c
View file @
c6eef46
...
...
@@ -583,6 +583,7 @@ smtp_send_message(mailer_t mailer, message_t msg)
status
=
smtp_read_ack
(
smtp
);
CHECK_EAGAIN
(
smtp
,
status
);
MAILER_DEBUG0
(
mailer
,
MU_DEBUG_PROT
,
smtp
->
buffer
);
observable_notify
(
mailer
->
observable
,
MU_EVT_MAILER_MESSAGE_SENT
);
if
(
smtp
->
buffer
[
0
]
!=
'2'
)
{
stream_close
(
mailer
->
stream
);
...
...
Please
register
or
sign in
to post a comment