aboutsummaryrefslogtreecommitdiff
path: root/src/mail.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-01 15:23:35 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-01 15:23:35 +0200
commitefd45e0a305dd0cc289d98b58141a40a3ddd3ffa (patch)
tree60859166c008e55034c1b6e84e113b72e909b2a6 /src/mail.c
parent5017a2c0a3266540c2bb5895595f2c79ce869091 (diff)
downloadwydawca-efd45e0a305dd0cc289d98b58141a40a3ddd3ffa.tar.gz
wydawca-efd45e0a305dd0cc289d98b58141a40a3ddd3ffa.tar.bz2
Fix locking. Improve mail formatting.
* src/config.c (locking_kw): Remove retry-attempts and retry-interval. New keyword: timeout. * src/job.c (job_queue_runner): Use lock_timeout. * src/lock.c (lock_retry_attempts, lock_retry_interval): Remove. (lock_timeout): New variable. (wydawca_lock): Rewrite lock acquisition loop. * src/wydawca.h (lock_retry_attempts, lock_retry_interval): Remove. (lock_timeout): New extern. * src/process.c (scan_spool): Analyze return from wydawca_lock. * src/mail.c (mail_send_message): Set From header, unless it is already present.
Diffstat (limited to 'src/mail.c')
-rw-r--r--src/mail.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mail.c b/src/mail.c
index beb88d4..a40e4b4 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -55,7 +55,8 @@ mail_send_message (mu_address_t rcpt, const char *text)
static char *x_mailer = "wydawca (" PACKAGE_STRING ")";
size_t size;
char *buf;
-
+ const char *sval;
+
mu_message_create (&msg, NULL);
mu_message_get_stream (msg, &stream);
@@ -70,6 +71,15 @@ mail_send_message (mu_address_t rcpt, const char *text)
mu_header_set_value (hdr, "To", buf, 1);
free (buf);
+ if (from_address && mu_header_sget_value (hdr, "From", &sval))
+ {
+ mu_address_to_string (from_address, NULL, 0, &size);
+ buf = xmalloc (size + 1);
+ mu_address_to_string (from_address, buf, size + 1, NULL);
+ mu_header_set_value (hdr, "From", buf, 1);
+ free (buf);
+ }
+
if (debug_level > 1)
{
mu_debug_t debug;

Return to:

Send suggestions and report system problems to the System administrator.