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
417d4307
...
417d4307c6a76d178a13eb29a16c8972b3b7ee8f
authored
2002-01-21 06:23:15 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use MU_PATH_MAILDIR.
1 parent
02c6f21a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
27 deletions
guimb/collect.c
imap4d/imap4d.c
mailbox/mbx_default.c
pop3d/pop3d.c
guimb/collect.c
View file @
417d430
...
...
@@ -16,13 +16,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "guimb.h"
#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/var/spool/mail"
#endif
char
*
temp_filename
;
FILE
*
temp_file
;
...
...
@@ -33,6 +26,15 @@ collect_open_default ()
{
size_t
nmesg
;
if
(
!
default_mailbox
)
{
asprintf
(
&
default_mailbox
,
"%s%s"
,
maildir
,
user_name
);
if
(
!
default_mailbox
)
{
util_error
(
"not enough memory"
);
exit
(
1
);
}
}
if
(
mailbox_create
(
&
mbox
,
default_mailbox
)
!=
0
||
mailbox_open
(
mbox
,
MU_STREAM_RDWR
)
!=
0
)
{
...
...
@@ -137,18 +139,6 @@ collect_output ()
return
0
;
}
if
(
!
default_mailbox
)
{
if
(
!
user_name
)
return
0
;
asprintf
(
&
default_mailbox
,
"%s/%s"
,
_PATH_MAILDIR
,
user_name
);
if
(
!
default_mailbox
)
{
fprintf
(
stderr
,
"guimb: not enough memory
\n
"
);
return
1
;
}
}
if
(
user_name
)
saved_umask
=
umask
(
077
);
...
...
@@ -197,3 +187,18 @@ collect_drop_mailbox ()
free
(
temp_filename
);
}
}
int
guimb_catch_handler
(
void
*
unused
,
SCM
tag
,
SCM
throw_args
)
{
collect_drop_mailbox
();
return
scm_handle_by_message
(
"guimb"
,
tag
,
throw_args
);
}
int
guimb_exit
(
void
*
unused1
,
mailbox_t
unused2
)
{
int
rc
=
collect_output
();
collect_drop_mailbox
();
return
rc
;
}
...
...
imap4d/imap4d.c
View file @
417d430
...
...
@@ -25,7 +25,7 @@ FILE *ofile;
unsigned
int
timeout
=
1800
;
/* RFC2060: 30 minutes, if enable. */
mailbox_t
mbox
;
char
*
homedir
;
char
*
maildir
=
_PATH_MAILDIR
;
char
*
maildir
=
MU
_PATH_MAILDIR
;
int
state
=
STATE_NONAUTH
;
/* Number of child processes. */
...
...
mailbox/mbx_default.c
View file @
417d430
...
...
@@ -34,10 +34,6 @@
#include <mailutils/mutil.h>
#include <mailutils/error.h>
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/usr/spool/mail"
#endif
/* Is this a security risk? */
#define USE_ENVIRON 1
...
...
@@ -281,6 +277,7 @@ mailbox_create_default (mailbox_t *pmbox, const char *mail)
if
(
mbox
==
NULL
)
{
const
char
*
user
=
NULL
;
int
len
;
#ifdef USE_ENVIRON
user
=
(
getenv
(
"LOGNAME"
))
?
getenv
(
"LOGNAME"
)
:
getenv
(
"USER"
);
#endif
...
...
@@ -296,10 +293,10 @@ mailbox_create_default (mailbox_t *pmbox, const char *mail)
return
EINVAL
;
}
}
mbox
=
malloc
(
strlen
(
user
)
+
strlen
(
_PATH_MAILDIR
)
+
2
);
mbox
=
malloc
(
strlen
(
user
)
+
strlen
(
MU
_PATH_MAILDIR
)
+
2
);
if
(
mbox
==
NULL
)
return
ENOMEM
;
sprintf
(
mbox
,
"%s
/%s"
,
_PATH_MAILDIR
,
user
);
sprintf
(
mbox
,
"%s
%s"
,
MU
_PATH_MAILDIR
,
user
);
}
status
=
mailbox_create
(
pmbox
,
mbox
);
free
(
mbox
);
...
...
pop3d/pop3d.c
View file @
417d430
...
...
@@ -25,7 +25,7 @@ mailbox_t mbox;
unsigned
int
timeout
;
int
state
;
char
*
username
;
char
*
maildir
=
_PATH_MAILDIR
;
char
*
maildir
=
MU
_PATH_MAILDIR
;
FILE
*
ifile
;
FILE
*
ofile
;
char
*
md5shared
;
...
...
Please
register
or
sign in
to post a comment