Commit 5d370760 5d370760311aaa86a16ab5bab166d9d339104cd3 by Sergey Poznyakoff

Fix compilation without sendmail.

* libproto/mailer/remote.c: Fix compilation with --disable-sendmail.
* mail/testsuite/mail/send.exp: Ignore test (return UNSUPPORTED), if
sendmail support is not compiled.
* sieve/testsuite/sieve/redirect.exp: Likewise.
* sieve/testsuite/sieve/reject.exp: Likewise.
1 parent 68447ef0
......@@ -27,8 +27,6 @@
# include <config.h>
#endif
#ifdef ENABLE_SMTP
#include <stdlib.h>
#include <string.h>
......@@ -40,6 +38,8 @@
#include <mailer0.h>
#include <registrar0.h>
#ifdef ENABLE_SMTP
static int
_url_remote_init (mu_url_t url, const char *new_scheme)
{
......@@ -88,8 +88,12 @@ static struct _mu_record _mu_remote_smtp_record = {
};
mu_record_t mu_remote_smtp_record = &_mu_remote_smtp_record;
#else
mu_record_t mu_remote_smtp_record = NULL;
#endif
#ifdef ENABLE_SENDMAIL
static int
_url_remote_sendmail_init (mu_url_t url)
{
......@@ -140,9 +144,7 @@ static struct _mu_record _mu_remote_prog_record =
mu_record_t mu_remote_prog_record = &_mu_remote_prog_record;
#else
mu_record_t mu_remote_smtp_record = NULL;
mu_record_t mu_remote_sendmail_record = NULL;
mu_record_t mu_remote_prog_record = NULL;
#endif
......
......@@ -17,81 +17,86 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mail_start "--file=%mbox1"
mail_version
mail_command "set sendmail=\"sendmail:$top_builddir/examples/mta\""
mail_command "set inplacealiases"
mail_command "setenv MTA_DIAG=\"$MU_FOLDER_DIR/mta.diag\""
if ![mu_check_capability ENABLE_SENDMAIL] {
unsupported "Support for sendmail not compiled in"
} else {
mail_start "--file=%mbox1"
mail_test -noprompt "reply 1" \
mail_command "set sendmail=\"sendmail:$top_builddir/examples/mta\""
mail_command "set inplacealiases"
mail_command "setenv MTA_DIAG=\"$MU_FOLDER_DIR/mta.diag\""
mail_test -noprompt "reply 1" \
"To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\
"Subject: Re: Jabberwocky"\
""
mail_test -noprompt "~m"\
mail_test -noprompt "~m"\
"Interpolating: 1"\
"(continue)"
mail_test "."
mail_stop
mail_test "."
mu_test_file "$MU_FOLDER_DIR/mta.diag" \
-re "ENVELOPE FROM: \[^\r\n\]*"\
"ENVELOPE TO: <foobar@nonexistent.net>,<bar@dontmailme.org>"\
" 0: To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\
" 1: Subject: Re: Jabberwocky"\
" 2: In-Reply-To: Your message of Fri, 28 Dec 2001 22:18:08 +0200"\
" 3: \t<200112282018.fBSKI8N04906@nonexistent.net>"\
" 4: References: <200112282018.fBSKI8N04906@nonexistent.net>"\
" 5: X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)"\
" 6: "\
" 7: > Received: (from foobar@nonexistent.net)"\
" 8: > by nonexistent.net id fBSKI8N04906"\
" 9: > for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200"\
" 10: > Date: Fri, 28 Dec 2001 22:18:08 +0200"\
" 11: > From: Foo Bar <foobar@nonexistent.net>"\
" 12: > Message-Id: <200112282018.fBSKI8N04906@nonexistent.net>"\
" 13: > To: Bar <bar@dontmailme.org>"\
" 14: > Subject: Jabberwocky"\
" 15: >"\
" 16: > `Twas brillig, and the slithy toves"\
" 17: > Did gyre and gimble in the wabe;"\
" 18: > All mimsy were the borogoves,"\
" 19: > And the mome raths outgrabe."\
" 20: > "\
" 21: > `Beware the Jabberwock, my son!"\
" 22: > The jaws that bite, the claws that catch!"\
" 23: > Beware the Jujub bird, and shun"\
" 24: > The frumious Bandersnatch!'"\
" 25: > "\
" 26: > He took his vorpal sword in hand:"\
" 27: > Long time the manxome foe he sought --"\
" 28: > So rested he by the Tumtum gree,"\
" 29: > And stood awhile in thought."\
" 30: > "\
" 31: > And as in uffish thought he stood,"\
" 32: > The Jabberwock, with eyes of flame,"\
" 33: > Came whiffling through the tulgey wook,"\
" 34: > And burbled as it came!"\
" 35: > "\
" 36: > One, two! One, two! And through and through"\
" 37: > The vorpal blade went snicker-snack!"\
" 38: > He left it dead, and with its head"\
" 39: > He went galumphing back."\
" 40: > "\
" 41: > `And has thou slain the Jabberwock?"\
" 42: > Come to my arms, my beamish boy!"\
" 43: > O frabjous day! Calloh! Callay!"\
" 44: > He chortled in his joy."\
" 45: > "\
" 46: > `Twas brillig, and the slithy toves"\
" 47: > Did gyre and gimble in the wabe;"\
" 48: > All mimsy were the borogoves,"\
" 49: > And the mome raths outgrabe."\
" 50: > "\
" 51: "\
"END OF MESSAGE"
mail_stop
mu_test_file "$MU_FOLDER_DIR/mta.diag" \
-re "ENVELOPE FROM: \[^\r\n\]*"\
"ENVELOPE TO: <foobar@nonexistent.net>,<bar@dontmailme.org>"\
" 0: To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\
" 1: Subject: Re: Jabberwocky"\
" 2: In-Reply-To: Your message of Fri, 28 Dec 2001 22:18:08 +0200"\
" 3: \t<200112282018.fBSKI8N04906@nonexistent.net>"\
" 4: References: <200112282018.fBSKI8N04906@nonexistent.net>"\
" 5: X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)"\
" 6: "\
" 7: > Received: (from foobar@nonexistent.net)"\
" 8: > by nonexistent.net id fBSKI8N04906"\
" 9: > for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200"\
" 10: > Date: Fri, 28 Dec 2001 22:18:08 +0200"\
" 11: > From: Foo Bar <foobar@nonexistent.net>"\
" 12: > Message-Id: <200112282018.fBSKI8N04906@nonexistent.net>"\
" 13: > To: Bar <bar@dontmailme.org>"\
" 14: > Subject: Jabberwocky"\
" 15: >"\
" 16: > `Twas brillig, and the slithy toves"\
" 17: > Did gyre and gimble in the wabe;"\
" 18: > All mimsy were the borogoves,"\
" 19: > And the mome raths outgrabe."\
" 20: > "\
" 21: > `Beware the Jabberwock, my son!"\
" 22: > The jaws that bite, the claws that catch!"\
" 23: > Beware the Jujub bird, and shun"\
" 24: > The frumious Bandersnatch!'"\
" 25: > "\
" 26: > He took his vorpal sword in hand:"\
" 27: > Long time the manxome foe he sought --"\
" 28: > So rested he by the Tumtum gree,"\
" 29: > And stood awhile in thought."\
" 30: > "\
" 31: > And as in uffish thought he stood,"\
" 32: > The Jabberwock, with eyes of flame,"\
" 33: > Came whiffling through the tulgey wook,"\
" 34: > And burbled as it came!"\
" 35: > "\
" 36: > One, two! One, two! And through and through"\
" 37: > The vorpal blade went snicker-snack!"\
" 38: > He left it dead, and with its head"\
" 39: > He went galumphing back."\
" 40: > "\
" 41: > `And has thou slain the Jabberwock?"\
" 42: > Come to my arms, my beamish boy!"\
" 43: > O frabjous day! Calloh! Callay!"\
" 44: > He chortled in his joy."\
" 45: > "\
" 46: > `Twas brillig, and the slithy toves"\
" 47: > Did gyre and gimble in the wabe;"\
" 48: > All mimsy were the borogoves,"\
" 49: > And the mome raths outgrabe."\
" 50: > "\
" 51: "\
"END OF MESSAGE"
}
# End of send.exp
......
......@@ -17,14 +17,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
set mtafile "$MU_FOLDER_DIR/mta.diag"
set env(MTA_DIAG) "$mtafile"
set env(MTA_APPEND) 1
mu_version
if ![mu_check_capability ENABLE_SENDMAIL] {
unsupported "Support for sendmail not compiled in"
} else {
set mtafile "$MU_FOLDER_DIR/mta.diag"
set env(MTA_DIAG) "$mtafile"
set env(MTA_APPEND) 1
set mailer "sendmail:$top_builddir/examples/mta"
sieve_driver_test "Redirect" "$mailer" "$mtafile"
set mailer "sendmail:$top_builddir/examples/mta"
sieve_driver_test "Redirect" "$mailer" "$mtafile"
}
# End of redirect.exp
......
......@@ -17,14 +17,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
set mtafile "$MU_FOLDER_DIR/mta.diag"
set env(MTA_DIAG) "$mtafile"
set env(MTA_APPEND) 1
mu_version
if ![mu_check_capability ENABLE_SENDMAIL] {
unsupported "Support for sendmail not compiled in"
} else {
set mtafile "$MU_FOLDER_DIR/mta.diag"
set env(MTA_DIAG) "$mtafile"
set env(MTA_APPEND) 1
set mailer "sendmail:$top_builddir/examples/mta"
sieve_driver_test "Reject" "$mailer" "$mtafile"
set mailer "sendmail:$top_builddir/examples/mta"
sieve_driver_test "Reject" "$mailer" "$mtafile"
}
# End of reject.exp
......