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
f3065927
...
f3065927105f7ebc70e0899583233b9fe9b0fea4
authored
2002-10-13 20:36:35 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use util_get_message()
1 parent
80a47134
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
25 additions
and
50 deletions
mail/copy.c
mail/decode.c
mail/delete.c
mail/followup.c
mail/from.c
mail/hold.c
mail/mbox.c
mail/pipe.c
mail/print.c
mail/quit.c
mail/reply.c
mail/size.c
mail/top.c
mail/undelete.c
mail/var.c
mail/write.c
mail/copy.c
View file @
f306592
...
...
@@ -74,14 +74,10 @@ mail_copy0 (int argc, char **argv, int mark)
{
int
status
;
status
=
mailbox_get_message
(
mbox
,
mp
->
msg_part
[
0
],
&
msg
);
status
=
util_get_message
(
mbox
,
mp
->
msg_part
[
0
],
&
msg
,
1
);
if
(
status
)
{
util_error
(
"can't get message %d: %s"
,
mp
->
msg_part
[
0
],
mu_errstring
(
status
));
break
;
}
mailbox_append_message
(
mbx
,
msg
);
message_size
(
msg
,
&
size
);
...
...
mail/decode.c
View file @
f306592
...
...
@@ -59,7 +59,7 @@ display_message (message_t mesg, msgset_t *msgset, void *arg)
struct
decode_closure
*
closure
=
arg
;
int
pagelines
=
util_get_crt
();
if
(
util_isdeleted
(
m
sgset
->
msg_part
[
0
]
))
if
(
util_isdeleted
(
m
esg
))
return
1
;
message_lines
(
mesg
,
&
lines
);
...
...
mail/delete.c
View file @
f306592
...
...
@@ -26,7 +26,8 @@ mail_delete0 (void)
{
message_t
msg
;
attribute_t
attr
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
)
!=
0
)
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
0
))
return
1
;
message_get_attribute
(
msg
,
&
attr
);
attribute_set_deleted
(
attr
);
...
...
mail/followup.c
View file @
f306592
...
...
@@ -36,9 +36,8 @@ mail_followup (int argc, char **argv)
if
(
msgset_parse
(
argc
,
argv
,
&
msglist
))
return
1
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
))
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
1
))
{
util_error
(
"%d: can't get message"
,
cursor
);
msgset_free
(
msglist
);
return
1
;
}
...
...
mail/from.c
View file @
f306592
...
...
@@ -42,10 +42,7 @@ mail_from (int argc, char **argv)
struct
tm
tm
;
mu_timezone
tz
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
)
!=
0
)
return
1
;
if
(
util_isdeleted
(
cursor
))
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
1
))
return
1
;
message_get_header
(
msg
,
&
hdr
);
...
...
mail/hold.c
View file @
f306592
...
...
@@ -32,11 +32,8 @@ mail_hold (int argc, char **argv)
return
util_msglist_command
(
mail_hold
,
argc
,
argv
,
1
);
else
{
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
))
{
util_error
(
"%d: can't get message"
,
cursor
);
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
0
))
return
1
;
}
message_get_attribute
(
msg
,
&
attr
);
attribute_unset_userflag
(
attr
,
MAIL_ATTRIBUTE_MBOXED
);
...
...
mail/mbox.c
View file @
f306592
...
...
@@ -31,11 +31,9 @@ mail_mbox (int argc, char **argv)
return
util_msglist_command
(
mail_mbox
,
argc
,
argv
,
1
);
else
{
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
))
{
util_error
(
"%d: can't get message"
,
cursor
);
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
1
))
return
1
;
}
/* Mark the message */
message_get_attribute
(
msg
,
&
attr
);
attribute_set_userflag
(
attr
,
MAIL_ATTRIBUTE_MBOXED
);
...
...
mail/pipe.c
View file @
f306592
...
...
@@ -46,7 +46,7 @@ mail_pipe (int argc, char **argv)
for
(
mp
=
list
;
mp
;
mp
=
mp
->
next
)
{
if
(
mailbox_get_message
(
mbox
,
mp
->
msg_part
[
0
],
&
msg
)
==
0
)
if
(
util_get_message
(
mbox
,
mp
->
msg_part
[
0
],
&
msg
,
1
)
==
0
)
{
message_get_stream
(
msg
,
&
stream
);
off
=
0
;
...
...
mail/print.c
View file @
f306592
...
...
@@ -42,10 +42,7 @@ mail_print (int argc, char **argv)
attribute_t
attr
;
int
pagelines
=
util_get_crt
();
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
mesg
)
!=
0
)
return
1
;
if
(
util_isdeleted
(
cursor
))
if
(
util_get_message
(
mbox
,
cursor
,
&
mesg
,
1
))
return
1
;
message_lines
(
mesg
,
&
lines
);
...
...
mail/quit.c
View file @
f306592
...
...
@@ -86,11 +86,9 @@ mail_mbox_commit ()
for
(
i
=
1
;
i
<=
total
;
i
++
)
{
if
(
mailbox_get_message
(
mbox
,
i
,
&
msg
))
{
util_error
(
"%d: can't get message"
,
i
);
if
(
util_get_message
(
mbox
,
i
,
&
msg
,
0
))
return
1
;
}
message_get_attribute
(
msg
,
&
attr
);
if
(
!
is_user_mbox
...
...
mail/reply.c
View file @
f306592
...
...
@@ -39,11 +39,8 @@ mail_reply (int argc, char **argv)
compose_init
(
&
env
);
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
))
{
util_error
(
"%d: can't get message"
,
cursor
);
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
1
))
return
1
;
}
message_get_header
(
msg
,
&
hdr
);
...
...
mail/size.c
View file @
f306592
...
...
@@ -30,11 +30,9 @@ mail_size (int argc, char **argv)
{
size_t
size
=
0
,
lines
=
0
;
message_t
msg
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
)
!=
0
)
{
util_error
(
"Could not read message %d"
,
cursor
);
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
0
))
return
1
;
}
message_size
(
msg
,
&
size
);
message_lines
(
msg
,
&
lines
);
...
...
mail/top.c
View file @
f306592
...
...
@@ -39,10 +39,7 @@ mail_top (int argc, char **argv)
||
lines
<
0
)
return
1
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
)
!=
0
)
return
1
;
if
(
util_isdeleted
(
cursor
))
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
1
))
return
1
;
message_get_stream
(
msg
,
&
stream
);
...
...
mail/undelete.c
View file @
f306592
...
...
@@ -30,11 +30,9 @@ mail_undelete (int argc, char **argv)
{
message_t
msg
;
attribute_t
attr
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
msg
)
!=
0
)
{
util_error
(
"Message %d does not exist"
,
cursor
);
if
(
util_get_message
(
mbox
,
cursor
,
&
msg
,
0
))
return
1
;
}
message_get_attribute
(
msg
,
&
attr
);
if
(
attribute_is_deleted
(
attr
))
attribute_unset_deleted
(
attr
);
...
...
mail/var.c
View file @
f306592
...
...
@@ -101,7 +101,7 @@ parse_headers (FILE *fp, compose_env_t *env)
if
(
name
)
{
header_set_value
(
header
,
name
,
value
,
0
);
header_set_value
(
header
,
name
,
value
[
0
]
?
value
:
NULL
,
0
);
free
(
name
);
free
(
value
);
name
=
value
=
NULL
;
...
...
@@ -452,7 +452,7 @@ var_quote (int argc, char **argv, compose_env_t *env)
size_t
n
=
0
;
char
*
prefix
=
"
\t
"
;
if
(
mailbox_get_message
(
mbox
,
cursor
,
&
mesg
)
!=
0
)
if
(
util_get_message
(
mbox
,
cursor
,
&
mesg
,
1
)
)
return
1
;
fprintf
(
stdout
,
"Interpolating: %d
\n
"
,
cursor
);
...
...
mail/write.c
View file @
f306592
...
...
@@ -81,7 +81,9 @@ mail_write (int argc, char **argv)
off_t
off
=
0
;
size_t
n
=
0
;
mailbox_get_message
(
mbox
,
mp
->
msg_part
[
0
],
&
msg
);
if
(
util_get_message
(
mbox
,
mp
->
msg_part
[
0
],
&
msg
,
1
))
continue
;
message_get_body
(
msg
,
&
bod
);
body_size
(
bod
,
&
size
);
...
...
Please
register
or
sign in
to post a comment