From 3c36e43b1e8340d82ad0f9d1ae4cd3133e1530ad Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 19 Jan 2006 21:41:22 +0000 Subject: [PATCH] * Change to journaling code to include an Internet email address for local recipients. --- citadel/ChangeLog | 4 ++++ citadel/README.txt | 3 +++ citadel/citadel_dirs.c | 2 +- citadel/journaling.c | 28 +++++++++++++++++++++++++++- citadel/serv_vcard.c | 1 + 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index ba7037452..a6a27a8e7 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,5 +1,9 @@ $Id$ +Thu Jan 19 16:40:57 EST 2006 ajc +* Change to journaling code to include an Internet email address for local + recipients. + Thu Jan 19 13:20:30 EST 2006 ajc * Refactored the code that populates the session's knowledge of the user's primary internet email address. We need it to be generic so that we can diff --git a/citadel/README.txt b/citadel/README.txt index 3db12c5fe..c034b10ca 100644 --- a/citadel/README.txt +++ b/citadel/README.txt @@ -7,6 +7,9 @@ 2. Install a supported version of Berkeley DB 3. ./configure && make && make install 4. Run the "setup" program + + * After installing Citadel, you'll probably want to install WebCit + so that you can access the Citadel system using a web browser. * Keep in mind that there is a FAQ at http://www.citadel.org diff --git a/citadel/citadel_dirs.c b/citadel/citadel_dirs.c index 2f33ed9c9..4b04f6a79 100644 --- a/citadel/citadel_dirs.c +++ b/citadel/citadel_dirs.c @@ -147,7 +147,7 @@ void calc_dirs_n_files(int relh, int home, const char *relhome,const char *ctdl snprintf(file_lmtp_unfiltered_socket, sizeof file_lmtp_socket, - "%slmtp-unfiltered.sock", + "%slmtp-unfiltered.socket", ctdl_run_dir); } diff --git a/citadel/journaling.c b/citadel/journaling.c index 5cba32940..ec158b43c 100644 --- a/citadel/journaling.c +++ b/citadel/journaling.c @@ -47,6 +47,8 @@ #include "html.h" #include "genstamp.h" #include "internet_addressing.h" +#include "vcard.h" +#include "serv_vcard.h" #include "journaling.h" struct jnlq *jnlq = NULL; /* journal queue */ @@ -88,6 +90,28 @@ void JournalBackgroundSubmit(struct CtdlMessage *msg, } +/* + * Convert a local user name to an internet email address for the journal + */ +void local_to_inetemail(char *inetemail, char *localuser, size_t inetemail_len) { + struct ctdluser us; + struct vCard *v; + + strcpy(inetemail, ""); + if (getuser(&us, localuser) != 0) { + return; + } + + v = vcard_get_user(&us); + if (v == NULL) { + return; + } + + extract_primary_inet_email(inetemail, inetemail_len, v); + vcard_free(v); +} + + /* * Called by JournalRunQueue() to send an individual message. */ @@ -98,6 +122,7 @@ void JournalRunQueueMsg(struct jnlq *jmsg) { char *message_text = NULL; char mime_boundary[256]; char recipient[256]; + char inetemail[256]; static int seq = 0; int i; @@ -170,8 +195,9 @@ void JournalRunQueueMsg(struct jnlq *jmsg) { for (i=0; irecps.num_local; ++i) { extract_token(recipient, jmsg->recps.recp_local, i, '|', sizeof recipient); + local_to_inetemail(inetemail, recipient, sizeof inetemail); sprintf(&message_text[strlen(message_text)], - " %s\r\n", recipient); + " %s <%s>\r\n", recipient, inetemail); } } diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index 2afd0f597..23c69648c 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -58,6 +58,7 @@ #include "tools.h" #include "vcard.h" #include "serv_ldap.h" +#include "serv_vcard.h" /* * set global flag calling for an aide to validate new users -- 2.30.2