aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-mime-utils.c13
-rw-r--r--camel/camel-mime-utils.h3
3 files changed, 21 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index cee5b9bf55..1c413b0ab0 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-03 Radek Doulik <rodo@helixcode.com>
+
+ * camel-mime-utils.c (header_msgid_generate): new function,
+ generates simple message/content id
+
2000-11-04 Not Zed <NotZed@HelixCode.com>
* camel-mime-part-utils.c
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 6ecec61670..d2df6cac76 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <unicode.h>
@@ -3055,3 +3056,15 @@ void run_test(void)
}
#endif /* BUILD_TABLE */
+
+char *
+header_msgid_generate (void)
+{
+ gchar host [256], domain [768];
+ static gint count = 0;
+
+ gethostname (host, sizeof (host));
+ getdomainname (domain, sizeof (domain));
+
+ return g_strdup_printf ("%d.%d.%d.camel@%s.%s", (gint) time (NULL), getpid (), count++, host, domain);
+}
diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h
index dc865004ee..a1f8bb549d 100644
--- a/camel/camel-mime-utils.h
+++ b/camel/camel-mime-utils.h
@@ -154,6 +154,9 @@ char *header_format_date(time_t time, int offset);
/* decode a message id */
char *header_msgid_decode(const char *in);
+/* generate msg id */
+char *header_msgid_generate (void);
+
/* decode a References header */
struct _header_references *header_references_decode(const char *in);
void header_references_list_clear(struct _header_references **list);