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
12754c27
...
12754c2721a007a20394a3166eb9d8e76d73a829
authored
2003-03-18 23:15:54 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_create_message_id): New function.
1 parent
efc4fcd5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
mh/mh.h
mh/mh_init.c
mh/mh.h
View file @
12754c2
...
...
@@ -303,6 +303,7 @@ int mh_disposition __P((const char *filename));
int
mh_usedraft
__P
((
const
char
*
filename
));
int
mh_file_copy
__P
((
const
char
*
from
,
const
char
*
to
));
char
*
mh_draft_name
__P
((
void
));
char
*
mh_create_message_id
__P
((
int
));
int
mh_whom
__P
((
char
*
filename
,
int
check
));
void
mh_annotate
__P
((
message_t
msg
,
char
*
field
,
char
*
text
,
int
date
));
...
...
@@ -326,3 +327,4 @@ int mhdraft_stream_create __P((stream_t *stream, stream_t src, int flags));
void
mh_comp_draft
__P
((
char
*
formfile
,
char
*
defformfile
,
char
*
draftfile
));
int
check_draft_disposition
__P
((
struct
mh_whatnow_env
*
wh
,
int
use_draft
));
...
...
mh/mh_init.c
View file @
12754c2
...
...
@@ -21,6 +21,7 @@
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <stdarg.h>
#include <unistd.h>
#include <errno.h>
...
...
@@ -733,3 +734,30 @@ mh_draft_name ()
return
mh_expand_name
(
draftfolder
,
"draft"
,
0
);
}
char
*
mh_create_message_id
(
int
m
)
{
char
date
[
4
+
2
+
2
+
2
+
2
+
2
+
1
];
time_t
t
=
time
(
NULL
);
struct
tm
*
tm
=
localtime
(
&
t
);
char
*
host
;
char
*
p
;
strftime
(
date
,
sizeof
date
,
"%Y%m%d%H%M%S"
,
tm
);
mu_get_host_name
(
&
host
);
if
(
m
)
{
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
asprintf
(
&
p
,
"<%s.%lu.%lu@%s>"
,
date
,
(
unsigned
long
)
tv
.
tv_usec
,
(
unsigned
long
)
getpid
(),
host
);
}
else
asprintf
(
&
p
,
"<%s.%lu@%s>"
,
date
,
(
unsigned
long
)
getpid
(),
host
);
free
(
host
);
return
p
;
}
...
...
Please
register
or
sign in
to post a comment