diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-19 21:07:28 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-19 21:07:28 +0200 |
commit | 62758ace16e756050f15b81e66ee5ab3bdd062ab (patch) | |
tree | 5ca9f04bdf00988185e3df1ad2bd21854d27121a /src/mail.c | |
parent | 288ad3a8baf196011e791988b3251bbedb5f6cc2 (diff) | |
download | wydawca-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.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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; |