aboutsummaryrefslogtreecommitdiff
path: root/src/mail.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-19 21:07:28 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-19 21:07:28 +0200
commit62758ace16e756050f15b81e66ee5ab3bdd062ab (patch)
tree5ca9f04bdf00988185e3df1ad2bd21854d27121a /src/mail.c
parent288ad3a8baf196011e791988b3251bbedb5f6cc2 (diff)
downloadwydawca-62758ace16e756050f15b81e66ee5ab3bdd062ab.tar.gz
wydawca-62758ace16e756050f15b81e66ee5ab3bdd062ab.tar.bz2
Improve testsuite
* src/mail.c (mail_send_message): Fix diagnostics. (mail_stats): Bail out if admin_address is not defined. * tests/mailstats.at: New file. * tests/Makefile.am (TESTSUITE_AT): Add mailstats.at * tests/testsuite.at: Add mailstats.at * tests/etc/mailstats.rc: New file. * tests/etc/Makefile.am (EXTRA_DIST): Add missing files. * tests/etc/wydawca.rcin: Define admin-address, enforce newline at EOF. * tests/notify-upl.at, tests/upload-dry.at, tests/upload.at: Fix descriptions.
Diffstat (limited to 'src/mail.c')
-rw-r--r--src/mail.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mail.c b/src/mail.c
index 6b76f43..e24b11c 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -83,10 +83,11 @@ mail_send_message (mu_address_t rcpt, const char *text)
{
if ((rc = mu_mailer_open (mailer, mailer_flags)))
{
- const char *url = NULL;
- mu_mailer_get_url_default (&url);
+ mu_url_t url = NULL;
+ mu_mailer_get_url (mailer, &url);
logmsg (LOG_CRIT, "opening mailer `%s' failed: %s",
- url, mu_strerror (rc));
+ url ? mu_url_to_string (url) : "(unknown URL)",
+ mu_strerror (rc));
return;
}
mailer_opened = 1;
@@ -223,6 +224,12 @@ mail_stats ()
if (!admin_stat_message || !stat_mask_p (mail_admin_mask) || !mailer)
return;
+ if (!admin_address)
+ {
+ logmsg (LOG_ERR, "Cannot mail statistics: admin-address not defined");
+ return;
+ }
+
if (debug_level)
{
size_t size;

Return to:

Send suggestions and report system problems to the System administrator.