diff -urN /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/autofaces.c /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/autofaces.c
--- /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/autofaces.c	1970-01-01 01:00:00.000000000 +0100
+++ /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/autofaces.c	2008-05-04 00:33:45.000000000 +0200
@@ -0,0 +1,118 @@
+
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2008 Ricardo Mones and the Claws Mail team
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "defs.h"
+
+#include "utils.h"
+#include "autofaces.h"
+
+gint get_content_for_any_face(gchar *buf, gint len, gchar *anyname, gint maxlen)
+{
+	FILE  *xfp;
+	gchar *xfile;
+	gint  lastc;
+
+	xfile = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, RC_DIR,
+	                    G_DIR_SEPARATOR_S, anyname, NULL);
+	buf[0] = '\0';
+	if ((xfp = fopen(xfile, "rb")) == NULL) {
+	        g_free(xfile);
+		g_warning("header content file '%s' not found\n", anyname);
+	        return -1;
+	}
+	if (fgets(buf, (len < maxlen)? len: maxlen, xfp) == NULL) {
+	        fclose(xfp);
+	        g_free(xfile);
+		g_warning("header content file '%s' read failure\n", anyname);
+	        return -2;
+	}
+	lastc = strlen(buf) - 1;        /* remove trailing \n */
+	buf[lastc] = (buf[lastc] == '\n')? '\0': buf[lastc];
+	fclose(xfp);
+	g_free(xfile);
+
+	return 0;
+}
+
+gchar * get_any_face_filename_for_account(gchar *facetype, gchar *accountname)
+{
+	gchar *name = NULL;
+	gchar *what = NULL;
+	if (facetype == NULL || accountname == NULL) 
+		return NULL;
+	if (*facetype == '\0' || *accountname == '\0') 
+		return NULL;
+	what = name = g_strdup_printf("%s.%s", facetype, accountname);
+	while (*what) {
+		switch (*what) {
+		case '/':
+		case '\\':
+		case '<':
+		case '>':
+		case ':':
+		case '?':
+		case '*':
+			*what = '_';
+			break;
+		default:
+			if (*what <= ' ') {
+				*what = '_';
+			}
+			break;
+		}
+		++what;
+	}
+	return name;
+}
+
+gint get_default_xface(gchar *buf, gint len) {
+	return get_content_for_any_face(buf, len, "xface", MAX_XFACE_LEN);
+}
+
+gint get_account_xface(gchar *buf, gint len, gchar *name) {
+	gchar *filename = get_any_face_filename_for_account("xface", name);
+	if (filename) {
+		gint result = get_content_for_any_face(buf, len, filename, MAX_XFACE_LEN);
+		g_free(filename);
+		return result;
+	}
+	g_warning("header xface filename invalid\n");
+	return -1;
+}
+
+gint get_default_face(gchar *buf, gint len) {
+	return get_content_for_any_face(buf, len, "face", MAX_FACE_LEN);
+}
+
+gint get_account_face(gchar *buf, gint len, gchar *name) {
+	gchar *filename = get_any_face_filename_for_account("face", name);
+	if (filename) {
+		gint result = get_content_for_any_face(buf, len, filename, MAX_FACE_LEN);
+		g_free(filename);
+		return result;
+	}
+	g_warning("header face filename invalid\n");
+	return -1;
+}
+
diff -urN /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/autofaces.h /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/autofaces.h
--- /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/autofaces.h	1970-01-01 01:00:00.000000000 +0100
+++ /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/autofaces.h	2008-05-04 00:33:45.000000000 +0200
@@ -0,0 +1,31 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2008 Ricardo Mones and the Claws Mail team
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+
+#ifndef __AUTOFACES_H__
+#define __AUTOFACES_H__
+
+#define MAX_XFACE_LEN	990
+#define MAX_FACE_LEN	990
+
+gint get_default_xface	(gchar *buf, gint len);
+gint get_default_face	(gchar *buf, gint len);
+gint get_account_xface	(gchar *buf, gint len, gchar *name);
+gint get_account_face	(gchar *buf, gint len, gchar *name);
+
+#endif /* __AUTOFACES_H__ */
diff -urN /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/compose.c /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/compose.c
--- /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/compose.c	2008-05-02 19:21:06.000000000 +0200
+++ /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/compose.c	2008-05-04 00:33:45.000000000 +0200
@@ -124,6 +124,10 @@
 #include "hooks.h"
 #include "privacy.h"
 #include "timing.h"
+#define AUTOFACES 1
+#ifdef AUTOFACES
+#include "autofaces.h"
+#endif
 
 enum
 {
@@ -6020,6 +6024,22 @@
 		}
 	}
 
+#ifdef AUTOFACES
+	/* Automatic Faces and X-Faces */
+	if (get_account_xface (buf, sizeof(buf), compose->account->account_name) == 0) {
+		g_string_append_printf(header, "X-Face: %s\n", buf);
+	}
+	else if (get_default_xface (buf, sizeof(buf)) == 0) {
+		g_string_append_printf(header, "X-Face: %s\n", buf);
+	}
+	if (get_account_face (buf, sizeof(buf), compose->account->account_name) == 0) {
+		g_string_append_printf(header, "Face: %s\n", buf);
+	}
+	else if (get_default_face (buf, sizeof(buf)) == 0) {
+		g_string_append_printf(header, "Face: %s\n", buf);
+	}
+#endif /* AUTOFACES */
+
 	/* PRIORITY */
 	switch (compose->priority) {
 		case PRIORITY_HIGHEST: g_string_append_printf(header, "Importance: high\n"
diff -urN /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/Makefile.am /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/Makefile.am
--- /home/mones/devel/claws/dev/sylpheedclaws/sylpheed-claws/src/Makefile.am	2008-05-02 19:21:06.000000000 +0200
+++ /home/mones/devel/claws/dev/my-sylpheedclaws/sylpheed-claws/src/Makefile.am	2008-05-03 17:13:27.000000000 +0200
@@ -171,7 +171,8 @@
 	unmime.c \
 	uri_opener.c \
 	vcard.c \
-	wizard.c
+	wizard.c \
+	autofaces.c
 
 claws_mailincludedir = $(pkgincludedir)
 claws_mailinclude_HEADERS = \
@@ -319,7 +320,8 @@
 	unmime.h \
 	uri_opener.h \
 	vcard.h \
-	wizard.h
+	wizard.h \
+	autofaces.h
 
 BUILT_SOURCES = \
 	matcher_parser_parse.h \
