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
8fe94a41
...
8fe94a41e02078c7a7973189934b810f8a4dbacd
authored
2007-06-28 08:04:00 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_rfc2822_msg_id): New function
1 parent
1e32b2a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
include/mailutils/mutil.h
mailbox/mutil.c
include/mailutils/mutil.h
View file @
8fe94a4
...
...
@@ -114,6 +114,7 @@ extern int mu_unroll_symlink (char *out, size_t outsz, const char *in);
extern
char
*
mu_expand_path_pattern
(
const
char
*
pattern
,
const
char
*
username
);
extern
int
mu_rfc2822_msg_id
(
int
subpart
,
char
**
pstr
);
extern
int
mu_rfc2822_references
(
mu_message_t
msg
,
char
**
pstr
);
extern
int
mu_rfc2822_in_reply_to
(
mu_message_t
msg
,
char
**
pstr
);
...
...
mailbox/mutil.c
View file @
8fe94a4
...
...
@@ -1023,6 +1023,35 @@ mu_rfc2822_references (mu_message_t msg, char **pstr)
return
MU_ERR_FAILURE
;
}
int
mu_rfc2822_msg_id
(
int
subpart
,
char
**
pval
)
{
char
date
[
4
+
2
+
2
+
2
+
2
+
2
+
1
];
time_t
t
=
time
(
NULL
);
struct
tm
*
tm
=
localtime
(
&
t
);
char
*
host
;
char
*
p
;
mu_strftime
(
date
,
sizeof
date
,
"%Y%m%d%H%M%S"
,
tm
);
mu_get_host_name
(
&
host
);
if
(
subpart
)
{
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
asprintf
(
&
p
,
"<%s.%lu.%d@%s>"
,
date
,
(
unsigned
long
)
getpid
(),
subpart
,
host
);
}
else
asprintf
(
&
p
,
"<%s.%lu@%s>"
,
date
,
(
unsigned
long
)
getpid
(),
host
);
free
(
host
);
*
pval
=
p
;
return
0
;
}
#define DATEBUFSIZE 128
#define COMMENT "Your message of "
...
...
Please
register
or
sign in
to post a comment