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
c4720131
...
c4720131db791a34cf550f66687c59a6bbd9c6fc
authored
2001-05-20 04:40:49 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Remove some '//' C++ style of comments.
1 parent
180d9a5d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
20 deletions
mailbox/attachment.c
mailbox/folder_imap.c
mailbox/mbx_imap.c
mailbox/mbx_mbox.c
mailbox/mbx_pop.c
mailbox/smtp.c
mailbox/attachment.c
View file @
c472013
...
...
@@ -59,7 +59,8 @@ struct _msg_info {
message_t
msg
;
int
ioffset
;
int
ooffset
;
stream_t
ostream
;
// output file/decoding stream for saving attachment
stream_t
stream
;
/* output file/decoding stream for saving attachment */
stream_t
fstream
;
/* output file stream for saving attachment */
};
#define MSG_HDR "Content-Type: %s; name=%s\nContent-Transfer-Encoding: %s\nContent-Disposition: attachment; filename=%s\n\n"
...
...
@@ -231,7 +232,7 @@ int message_attachment_filename(message_t msg, const char **filename)
int
message_save_attachment
(
message_t
msg
,
const
char
*
filename
,
void
**
data
)
{
stream_t
istream
,
fstream
;
stream_t
istream
;
struct
_msg_info
*
info
=
NULL
;
int
ret
;
size_t
size
;
...
...
@@ -251,8 +252,8 @@ int message_save_attachment(message_t msg, const char *filename, void **data)
ret
=
message_attachment_filename
(
msg
,
&
fname
);
else
fname
=
filename
;
if
(
fname
&&
(
ret
=
file_stream_create
(
&
fstream
)
)
==
0
)
{
if
(
(
ret
=
stream_open
(
fstream
,
fname
,
0
,
MU_STREAM_WRITE
|
MU_STREAM_CREAT
)
)
==
0
)
{
if
(
fname
&&
(
ret
=
file_stream_create
(
&
info
->
fstream
)
)
==
0
)
{
if
(
(
ret
=
stream_open
(
info
->
fstream
,
fname
,
0
,
MU_STREAM_WRITE
|
MU_STREAM_CREAT
)
)
==
0
)
{
header_get_value
(
hdr
,
"Content-Transfer-Encoding"
,
NULL
,
0
,
&
size
);
if
(
size
)
{
if
(
(
content_encoding
=
alloca
(
size
+
1
)
)
==
NULL
)
...
...
@@ -260,17 +261,17 @@ int message_save_attachment(message_t msg, const char *filename, void **data)
header_get_value
(
hdr
,
"Content-Transfer-Encoding"
,
content_encoding
,
size
+
1
,
0
);
}
else
content_encoding
=
(
char
*
)
"7bit"
;
ret
=
filter_create
(
&
info
->
ostream
,
f
stream
,
content_encoding
,
MU_FILTER_DECODE
,
MU_STREAM_READ
);
ret
=
filter_create
(
&
info
->
stream
,
i
stream
,
content_encoding
,
MU_FILTER_DECODE
,
MU_STREAM_READ
);
}
}
}
if
(
info
->
o
stream
&&
istream
)
{
if
(
info
->
stream
&&
istream
)
{
if
(
info
->
nbytes
)
memmove
(
info
->
buf
,
info
->
buf
+
(
BUF_SIZE
-
info
->
nbytes
),
info
->
nbytes
);
while
(
(
ret
==
0
&&
info
->
nbytes
)
||
(
(
ret
=
stream_read
(
istream
,
info
->
buf
,
BUF_SIZE
,
info
->
ioffset
,
&
info
->
nbytes
)
)
==
0
&&
info
->
nbytes
)
)
{
while
(
(
ret
==
0
&&
info
->
nbytes
)
||
(
(
ret
=
stream_read
(
i
nfo
->
stream
,
info
->
buf
,
BUF_SIZE
,
info
->
ioffset
,
&
info
->
nbytes
)
)
==
0
&&
info
->
nbytes
)
)
{
info
->
ioffset
+=
info
->
nbytes
;
while
(
info
->
nbytes
)
{
if
(
(
ret
=
stream_write
(
info
->
o
stream
,
info
->
buf
,
info
->
nbytes
,
info
->
ooffset
,
&
nbytes
)
)
!=
0
)
if
(
(
ret
=
stream_write
(
info
->
f
stream
,
info
->
buf
,
info
->
nbytes
,
info
->
ooffset
,
&
nbytes
)
)
!=
0
)
break
;
info
->
nbytes
-=
nbytes
;
info
->
ooffset
+=
nbytes
;
...
...
@@ -278,8 +279,9 @@ int message_save_attachment(message_t msg, const char *filename, void **data)
}
}
if
(
ret
!=
EAGAIN
&&
info
)
{
stream_close
(
info
->
ostream
);
stream_destroy
(
&
info
->
ostream
,
NULL
);
stream_close
(
info
->
fstream
);
stream_destroy
(
&
info
->
stream
,
NULL
);
stream_destroy
(
&
info
->
fstream
,
NULL
);
_attachment_free
(
info
,
ret
);
}
return
ret
;
...
...
mailbox/folder_imap.c
View file @
c472013
...
...
@@ -599,7 +599,7 @@ folder_imap_list (folder_t folder, const char *ref, const char *name,
for
(
i
=
0
;
i
<
num
;
i
++
)
{
struct
list_response
*
lr
=
f_imap
->
callback
.
flist
.
element
[
i
];
/
/printf ("%s --> %s\n", lr->name, name);
/
* printf ("%s --> %s\n", lr->name, name); */
if
(
fnmatch
(
name
,
lr
->
name
,
0
)
==
0
)
{
plist
[
i
]
=
calloc
(
1
,
sizeof
(
**
plist
));
...
...
@@ -672,7 +672,7 @@ folder_imap_lsub (folder_t folder, const char *ref, const char *name,
for
(
i
=
0
;
i
<
num
;
i
++
)
{
struct
list_response
*
lr
=
f_imap
->
callback
.
flist
.
element
[
i
];
/
/printf ("%s --> %s\n", lr->name, name);
/
* printf ("%s --> %s\n", lr->name, name); */
plist
[
i
]
=
calloc
(
1
,
sizeof
(
**
plist
));
if
(
plist
[
i
]
==
NULL
||
(
plist
[
i
]
->
name
=
strdup
(
lr
->
name
))
==
NULL
)
...
...
mailbox/mbx_imap.c
View file @
c472013
...
...
@@ -1165,7 +1165,7 @@ imap_get_part (message_t msg, size_t partno, message_t *pmsg)
message_get_header
(
message
,
&
header
);
header_set_get_value
(
header
,
NULL
,
message
);
message_set_stream
(
message
,
NULL
,
msg_imap
->
parts
[
partno
-
1
]);
/
/message_set_size (message, NULL, msg_imap->parts[partno - 1]);
/
* message_set_size (message, NULL, msg_imap->parts[partno - 1]); */
msg_imap
->
parts
[
partno
-
1
]
->
message
=
message
;
if
(
pmsg
)
*
pmsg
=
message
;
...
...
mailbox/mbx_mbox.c
View file @
c472013
...
...
@@ -167,7 +167,7 @@ extern char *base_name __P ((char const *));
static
int
mbox_open
__P
((
mailbox_t
,
int
));
static
int
mbox_close
__P
((
mailbox_t
));
static
int
mbox_get_message
__P
((
mailbox_t
,
size_t
,
message_t
*
));
/
/static int mbox_get_message_by_uid __P ((mailbox_t, size_t, message_t *));
/
* static int mbox_get_message_by_uid __P ((mailbox_t, size_t, message_t *)); */
static
int
mbox_append_message
__P
((
mailbox_t
,
message_t
));
static
int
mbox_messages_count
__P
((
mailbox_t
,
size_t
*
));
static
int
mbox_messages_recent
__P
((
mailbox_t
,
size_t
*
));
...
...
@@ -865,9 +865,11 @@ mbox_expunge (mailbox_t mailbox)
part of mum will be at the right position. */
memmove
(
mud
->
umessages
+
j
,
mud
->
umessages
+
j
+
1
,
(
dlast
-
j
)
*
sizeof
(
mum
));
//mum->header_from = mum->header_from_end = 0;
//mum->body = mum->body_end = 0;
//mum->header_lines = mum->body_lines = 0;
#if 0
mum->header_from = mum->header_from_end = 0;
mum->body = mum->body_end = 0;
mum->header_lines = mum->body_lines = 0;
#endif
for
(
i
=
0
;
i
<
HDRSIZE
;
i
++
)
if
(
mum
->
fhdr
[
i
])
{
...
...
mailbox/mbx_pop.c
View file @
c472013
...
...
@@ -416,13 +416,13 @@ pop_user (authority_t auth)
CHECK_ERROR_CLOSE
(
mbox
,
mpd
,
EINVAL
);
}
status
=
pop_writeline
(
mpd
,
"PASS %s
\r\n
"
,
mpd
->
passwd
);
MAILBOX_DEBUG0
(
mbox
,
MU_DEBUG_PROT
,
mpd
->
buffer
);
/* MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, mpd->buffer); */
/* We have to nuke the passwd. */
memset
(
mpd
->
passwd
,
'\0'
,
strlen
(
mpd
->
passwd
));
free
(
mpd
->
passwd
);
mpd
->
passwd
=
NULL
;
CHECK_ERROR_CLOSE
(
mbox
,
mpd
,
status
);
//
MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, "PASS *\n");
MAILBOX_DEBUG0
(
mbox
,
MU_DEBUG_PROT
,
"PASS *
\n
"
);
mpd
->
state
=
POP_AUTH_PASS
;
case
POP_AUTH_PASS
:
...
...
mailbox/smtp.c
View file @
c472013
...
...
@@ -273,7 +273,7 @@ smtp_open (mailer_t mailer, int flags)
/* Don't flag it as an error some SMTP servers can get the FQDN
by themselves even if the client is lying, probably
with getpeername(). */
/
/ return EINVAL;
/
* return EINVAL; */
}
else
{
...
...
Please
register
or
sign in
to post a comment