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
e809fe4f
...
e809fe4f159a6522b7187d9174bfc20e9c54c837
authored
2002-07-26 11:22:02 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use pop3d_outf instead of fprintf
1 parent
fdcf0b75
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
34 additions
and
34 deletions
pop3d/apop.c
pop3d/capa.c
pop3d/dele.c
pop3d/list.c
pop3d/noop.c
pop3d/quit.c
pop3d/retr.c
pop3d/rset.c
pop3d/stat.c
pop3d/top.c
pop3d/uidl.c
pop3d/apop.c
View file @
e809fe4
...
...
@@ -256,7 +256,7 @@ pop3d_apop (const char *arg)
username
=
strdup
(
pw
->
pw_name
);
if
(
username
==
NULL
)
pop3d_abquit
(
ERR_NO_MEM
);
fprintf
(
ofile
,
"+OK opened mailbox for %s
\r\n
"
,
username
);
pop3d_outf
(
"+OK opened mailbox for %s
\r\n
"
,
username
);
/* mailbox name */
{
url_t
url
=
NULL
;
...
...
pop3d/capa.c
View file @
e809fe4
...
...
@@ -35,17 +35,17 @@ pop3d_capa (const char *arg)
if
(
state
!=
AUTHORIZATION
&&
state
!=
TRANSACTION
)
return
ERR_WRONG_STATE
;
fprintf
(
ofile
,
"+OK Capability list follows
\r\n
"
);
fprintf
(
ofile
,
"TOP
\r\n
"
);
fprintf
(
ofile
,
"USER
\r\n
"
);
fprintf
(
ofile
,
"UIDL
\r\n
"
);
fprintf
(
ofile
,
"RESP-CODES
\r\n
"
);
fprintf
(
ofile
,
"PIPELINING
\r\n
"
);
pop3d_outf
(
"+OK Capability list follows
\r\n
"
);
pop3d_outf
(
"TOP
\r\n
"
);
pop3d_outf
(
"USER
\r\n
"
);
pop3d_outf
(
"UIDL
\r\n
"
);
pop3d_outf
(
"RESP-CODES
\r\n
"
);
pop3d_outf
(
"PIPELINING
\r\n
"
);
/* FIXME: This can be Implemented by setting an header field on the
message. */
/*
fprintf (ofile,
"EXPIRE NEVER\r\n"); */
/*
pop3d_outf (
"EXPIRE NEVER\r\n"); */
if
(
state
==
TRANSACTION
)
/* let's not advertise to just anyone */
fprintf
(
ofile
,
"IMPLEMENTATION %s %s
\r\n
"
,
IMPL
,
VERSION
);
fprintf
(
ofile
,
".
\r\n
"
);
pop3d_outf
(
"IMPLEMENTATION %s %s
\r\n
"
,
IMPL
,
VERSION
);
pop3d_outf
(
".
\r\n
"
);
return
OK
;
}
...
...
pop3d/dele.c
View file @
e809fe4
...
...
@@ -39,6 +39,6 @@ pop3d_dele (const char *arg)
message_get_attribute
(
msg
,
&
attr
);
attribute_set_deleted
(
attr
);
fprintf
(
ofile
,
"+OK Message %d marked
\r\n
"
,
num
);
pop3d_outf
(
"+OK Message %d marked
\r\n
"
,
num
);
return
OK
;
}
...
...
pop3d/list.c
View file @
e809fe4
...
...
@@ -37,7 +37,7 @@ pop3d_list (const char *arg)
if
(
strlen
(
arg
)
==
0
)
{
size_t
total
=
0
;
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
mailbox_messages_count
(
mbox
,
&
total
);
for
(
mesgno
=
1
;
mesgno
<=
total
;
mesgno
++
)
{
...
...
@@ -47,10 +47,10 @@ pop3d_list (const char *arg)
{
message_size
(
msg
,
&
size
);
message_lines
(
msg
,
&
lines
);
fprintf
(
ofile
,
"%d %d
\r\n
"
,
mesgno
,
size
+
lines
);
pop3d_outf
(
"%d %d
\r\n
"
,
mesgno
,
size
+
lines
);
}
}
fprintf
(
ofile
,
".
\r\n
"
);
pop3d_outf
(
".
\r\n
"
);
}
else
{
...
...
@@ -62,7 +62,7 @@ pop3d_list (const char *arg)
return
ERR_MESG_DELE
;
message_size
(
msg
,
&
size
);
message_lines
(
msg
,
&
lines
);
fprintf
(
ofile
,
"+OK %d %d
\r\n
"
,
mesgno
,
size
+
lines
);
pop3d_outf
(
"+OK %d %d
\r\n
"
,
mesgno
,
size
+
lines
);
}
return
OK
;
...
...
pop3d/noop.c
View file @
e809fe4
...
...
@@ -26,6 +26,6 @@ pop3d_noop (const char *arg)
return
ERR_BAD_ARGS
;
if
(
state
!=
TRANSACTION
)
return
ERR_WRONG_STATE
;
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
return
OK
;
}
...
...
pop3d/quit.c
View file @
e809fe4
...
...
@@ -35,7 +35,7 @@ pop3d_quit (const char *arg)
pop3d_unlock
();
if
(
mailbox_expunge
(
mbox
)
!=
0
)
err
=
ERR_FILE
;
if
(
mailbox_close
(
mbox
)
!=
0
)
if
(
mailbox_close
(
mbox
)
!=
0
)
err
=
ERR_FILE
;
mailbox_destroy
(
&
mbox
);
syslog
(
LOG_INFO
,
"Session ended for user: %s"
,
username
);
...
...
@@ -48,6 +48,6 @@ pop3d_quit (const char *arg)
free
(
md5shared
);
if
(
err
==
OK
)
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
return
err
;
}
...
...
pop3d/retr.c
View file @
e809fe4
...
...
@@ -46,7 +46,7 @@ pop3d_retr (const char *arg)
return
ERR_MESG_DELE
;
message_get_stream
(
msg
,
&
stream
);
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
off
=
n
=
0
;
buf
=
malloc
(
buflen
*
sizeof
(
*
buf
));
...
...
@@ -68,9 +68,9 @@ pop3d_retr (const char *arg)
continue
;
}
if
(
buf
[
0
]
==
'.'
)
fprintf
(
ofile
,
".%s
\r\n
"
,
buf
);
pop3d_outf
(
".%s
\r\n
"
,
buf
);
else
fprintf
(
ofile
,
"%s
\r\n
"
,
buf
);
pop3d_outf
(
"%s
\r\n
"
,
buf
);
off
+=
n
;
}
...
...
@@ -78,7 +78,7 @@ pop3d_retr (const char *arg)
attribute_set_read
(
attr
);
free
(
buf
);
fprintf
(
ofile
,
".
\r\n
"
);
pop3d_outf
(
".
\r\n
"
);
return
OK
;
}
...
...
pop3d/rset.c
View file @
e809fe4
...
...
@@ -42,6 +42,6 @@ pop3d_rset (const char *arg)
if
(
attribute_is_deleted
(
attr
))
attribute_unset_deleted
(
attr
);
}
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
return
OK
;
}
...
...
pop3d/stat.c
View file @
e809fe4
...
...
@@ -55,7 +55,7 @@ pop3d_stat (const char *arg)
num
++
;
}
}
fprintf
(
ofile
,
"+OK %d %d
\r\n
"
,
num
,
tsize
);
pop3d_outf
(
"+OK %d %d
\r\n
"
,
num
,
tsize
);
return
OK
;
}
...
...
pop3d/top.c
View file @
e809fe4
...
...
@@ -58,7 +58,7 @@ pop3d_top (const char *arg)
if
(
attribute_is_deleted
(
attr
))
return
ERR_MESG_DELE
;
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
/* Header. */
message_get_header
(
msg
,
&
hdr
);
...
...
@@ -74,10 +74,10 @@ pop3d_top (const char *arg)
if
(
buf
[
n
-
1
]
==
'\n'
)
{
buf
[
n
-
1
]
=
'\0'
;
fprintf
(
ofile
,
"%s
\r\n
"
,
buf
);
pop3d_outf
(
"%s
\r\n
"
,
buf
);
}
else
fprintf
(
ofile
,
"%s"
,
buf
);
pop3d_outf
(
"%s"
,
buf
);
off
+=
n
;
}
...
...
@@ -102,16 +102,16 @@ pop3d_top (const char *arg)
continue
;
}
if
(
buf
[
0
]
==
'.'
)
fprintf
(
ofile
,
".%s
\r\n
"
,
buf
);
pop3d_outf
(
".%s
\r\n
"
,
buf
);
else
fprintf
(
ofile
,
"%s
\r\n
"
,
buf
);
pop3d_outf
(
"%s
\r\n
"
,
buf
);
lines
--
;
off
+=
n
;
}
}
free
(
buf
);
fprintf
(
ofile
,
".
\r\n
"
);
pop3d_outf
(
".
\r\n
"
);
return
OK
;
}
...
...
pop3d/uidl.c
View file @
e809fe4
...
...
@@ -34,7 +34,7 @@ pop3d_uidl (const char *arg)
if
(
strlen
(
arg
)
==
0
)
{
size_t
total
=
0
;
fprintf
(
ofile
,
"+OK
\r\n
"
);
pop3d_outf
(
"+OK
\r\n
"
);
mailbox_messages_count
(
mbox
,
&
total
);
for
(
mesgno
=
1
;
mesgno
<=
total
;
mesgno
++
)
{
...
...
@@ -43,10 +43,10 @@ pop3d_uidl (const char *arg)
if
(
!
attribute_is_deleted
(
attr
))
{
message_get_uidl
(
msg
,
uidl
,
sizeof
(
uidl
),
NULL
);
fprintf
(
ofile
,
"%d %s
\r\n
"
,
mesgno
,
uidl
);
pop3d_outf
(
"%d %s
\r\n
"
,
mesgno
,
uidl
);
}
}
fprintf
(
ofile
,
".
\r\n
"
);
pop3d_outf
(
".
\r\n
"
);
}
else
{
...
...
@@ -57,7 +57,7 @@ pop3d_uidl (const char *arg)
if
(
attribute_is_deleted
(
attr
))
return
ERR_MESG_DELE
;
message_get_uidl
(
msg
,
uidl
,
sizeof
(
uidl
),
NULL
);
fprintf
(
ofile
,
"+OK %d %s
\r\n
"
,
mesgno
,
uidl
);
pop3d_outf
(
"+OK %d %s
\r\n
"
,
mesgno
,
uidl
);
}
return
OK
;
...
...
Please
register
or
sign in
to post a comment