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.
Showing
4 changed files
with
97 additions
and
82 deletions
... | @@ -27,8 +27,6 @@ | ... | @@ -27,8 +27,6 @@ |
27 | # include <config.h> | 27 | # include <config.h> |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #ifdef ENABLE_SMTP | ||
31 | |||
32 | #include <stdlib.h> | 30 | #include <stdlib.h> |
33 | #include <string.h> | 31 | #include <string.h> |
34 | 32 | ||
... | @@ -40,6 +38,8 @@ | ... | @@ -40,6 +38,8 @@ |
40 | #include <mailer0.h> | 38 | #include <mailer0.h> |
41 | #include <registrar0.h> | 39 | #include <registrar0.h> |
42 | 40 | ||
41 | #ifdef ENABLE_SMTP | ||
42 | |||
43 | static int | 43 | static int |
44 | _url_remote_init (mu_url_t url, const char *new_scheme) | 44 | _url_remote_init (mu_url_t url, const char *new_scheme) |
45 | { | 45 | { |
... | @@ -88,8 +88,12 @@ static struct _mu_record _mu_remote_smtp_record = { | ... | @@ -88,8 +88,12 @@ static struct _mu_record _mu_remote_smtp_record = { |
88 | }; | 88 | }; |
89 | 89 | ||
90 | mu_record_t mu_remote_smtp_record = &_mu_remote_smtp_record; | 90 | mu_record_t mu_remote_smtp_record = &_mu_remote_smtp_record; |
91 | #else | ||
92 | mu_record_t mu_remote_smtp_record = NULL; | ||
93 | #endif | ||
91 | 94 | ||
92 | 95 | ||
96 | #ifdef ENABLE_SENDMAIL | ||
93 | static int | 97 | static int |
94 | _url_remote_sendmail_init (mu_url_t url) | 98 | _url_remote_sendmail_init (mu_url_t url) |
95 | { | 99 | { |
... | @@ -140,9 +144,7 @@ static struct _mu_record _mu_remote_prog_record = | ... | @@ -140,9 +144,7 @@ static struct _mu_record _mu_remote_prog_record = |
140 | 144 | ||
141 | mu_record_t mu_remote_prog_record = &_mu_remote_prog_record; | 145 | mu_record_t mu_remote_prog_record = &_mu_remote_prog_record; |
142 | 146 | ||
143 | |||
144 | #else | 147 | #else |
145 | mu_record_t mu_remote_smtp_record = NULL; | ||
146 | mu_record_t mu_remote_sendmail_record = NULL; | 148 | mu_record_t mu_remote_sendmail_record = NULL; |
147 | mu_record_t mu_remote_prog_record = NULL; | 149 | mu_record_t mu_remote_prog_record = NULL; |
148 | #endif | 150 | #endif | ... | ... |
... | @@ -17,81 +17,86 @@ | ... | @@ -17,81 +17,86 @@ |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 | # 02110-1301 USA. | 18 | # 02110-1301 USA. |
19 | 19 | ||
20 | mail_start "--file=%mbox1" | 20 | mail_version |
21 | 21 | ||
22 | mail_command "set sendmail=\"sendmail:$top_builddir/examples/mta\"" | 22 | if ![mu_check_capability ENABLE_SENDMAIL] { |
23 | mail_command "set inplacealiases" | 23 | unsupported "Support for sendmail not compiled in" |
24 | mail_command "setenv MTA_DIAG=\"$MU_FOLDER_DIR/mta.diag\"" | 24 | } else { |
25 | mail_start "--file=%mbox1" | ||
25 | 26 | ||
26 | mail_test -noprompt "reply 1" \ | 27 | mail_command "set sendmail=\"sendmail:$top_builddir/examples/mta\"" |
28 | mail_command "set inplacealiases" | ||
29 | mail_command "setenv MTA_DIAG=\"$MU_FOLDER_DIR/mta.diag\"" | ||
30 | |||
31 | mail_test -noprompt "reply 1" \ | ||
27 | "To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\ | 32 | "To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\ |
28 | "Subject: Re: Jabberwocky"\ | 33 | "Subject: Re: Jabberwocky"\ |
29 | "" | 34 | "" |
30 | 35 | ||
31 | mail_test -noprompt "~m"\ | 36 | mail_test -noprompt "~m"\ |
32 | "Interpolating: 1"\ | 37 | "Interpolating: 1"\ |
33 | "(continue)" | 38 | "(continue)" |
39 | |||
40 | mail_test "." | ||
34 | 41 | ||
35 | mail_test "." | 42 | mail_stop |
36 | |||
37 | mail_stop | ||
38 | |||
39 | mu_test_file "$MU_FOLDER_DIR/mta.diag" \ | ||
40 | -re "ENVELOPE FROM: \[^\r\n\]*"\ | ||
41 | "ENVELOPE TO: <foobar@nonexistent.net>,<bar@dontmailme.org>"\ | ||
42 | " 0: To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\ | ||
43 | " 1: Subject: Re: Jabberwocky"\ | ||
44 | " 2: In-Reply-To: Your message of Fri, 28 Dec 2001 22:18:08 +0200"\ | ||
45 | " 3: \t<200112282018.fBSKI8N04906@nonexistent.net>"\ | ||
46 | " 4: References: <200112282018.fBSKI8N04906@nonexistent.net>"\ | ||
47 | " 5: X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)"\ | ||
48 | " 6: "\ | ||
49 | " 7: > Received: (from foobar@nonexistent.net)"\ | ||
50 | " 8: > by nonexistent.net id fBSKI8N04906"\ | ||
51 | " 9: > for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200"\ | ||
52 | " 10: > Date: Fri, 28 Dec 2001 22:18:08 +0200"\ | ||
53 | " 11: > From: Foo Bar <foobar@nonexistent.net>"\ | ||
54 | " 12: > Message-Id: <200112282018.fBSKI8N04906@nonexistent.net>"\ | ||
55 | " 13: > To: Bar <bar@dontmailme.org>"\ | ||
56 | " 14: > Subject: Jabberwocky"\ | ||
57 | " 15: >"\ | ||
58 | " 16: > `Twas brillig, and the slithy toves"\ | ||
59 | " 17: > Did gyre and gimble in the wabe;"\ | ||
60 | " 18: > All mimsy were the borogoves,"\ | ||
61 | " 19: > And the mome raths outgrabe."\ | ||
62 | " 20: > "\ | ||
63 | " 21: > `Beware the Jabberwock, my son!"\ | ||
64 | " 22: > The jaws that bite, the claws that catch!"\ | ||
65 | " 23: > Beware the Jujub bird, and shun"\ | ||
66 | " 24: > The frumious Bandersnatch!'"\ | ||
67 | " 25: > "\ | ||
68 | " 26: > He took his vorpal sword in hand:"\ | ||
69 | " 27: > Long time the manxome foe he sought --"\ | ||
70 | " 28: > So rested he by the Tumtum gree,"\ | ||
71 | " 29: > And stood awhile in thought."\ | ||
72 | " 30: > "\ | ||
73 | " 31: > And as in uffish thought he stood,"\ | ||
74 | " 32: > The Jabberwock, with eyes of flame,"\ | ||
75 | " 33: > Came whiffling through the tulgey wook,"\ | ||
76 | " 34: > And burbled as it came!"\ | ||
77 | " 35: > "\ | ||
78 | " 36: > One, two! One, two! And through and through"\ | ||
79 | " 37: > The vorpal blade went snicker-snack!"\ | ||
80 | " 38: > He left it dead, and with its head"\ | ||
81 | " 39: > He went galumphing back."\ | ||
82 | " 40: > "\ | ||
83 | " 41: > `And has thou slain the Jabberwock?"\ | ||
84 | " 42: > Come to my arms, my beamish boy!"\ | ||
85 | " 43: > O frabjous day! Calloh! Callay!"\ | ||
86 | " 44: > He chortled in his joy."\ | ||
87 | " 45: > "\ | ||
88 | " 46: > `Twas brillig, and the slithy toves"\ | ||
89 | " 47: > Did gyre and gimble in the wabe;"\ | ||
90 | " 48: > All mimsy were the borogoves,"\ | ||
91 | " 49: > And the mome raths outgrabe."\ | ||
92 | " 50: > "\ | ||
93 | " 51: "\ | ||
94 | "END OF MESSAGE" | ||
95 | 43 | ||
44 | mu_test_file "$MU_FOLDER_DIR/mta.diag" \ | ||
45 | -re "ENVELOPE FROM: \[^\r\n\]*"\ | ||
46 | "ENVELOPE TO: <foobar@nonexistent.net>,<bar@dontmailme.org>"\ | ||
47 | " 0: To: <foobar@nonexistent.net>,<bar@dontmailme.org>"\ | ||
48 | " 1: Subject: Re: Jabberwocky"\ | ||
49 | " 2: In-Reply-To: Your message of Fri, 28 Dec 2001 22:18:08 +0200"\ | ||
50 | " 3: \t<200112282018.fBSKI8N04906@nonexistent.net>"\ | ||
51 | " 4: References: <200112282018.fBSKI8N04906@nonexistent.net>"\ | ||
52 | " 5: X-Mailer: mail (GNU Mailutils $MU_TOOL_VERSION)"\ | ||
53 | " 6: "\ | ||
54 | " 7: > Received: (from foobar@nonexistent.net)"\ | ||
55 | " 8: > by nonexistent.net id fBSKI8N04906"\ | ||
56 | " 9: > for bar@dontmailme.org; Fri, 28 Dec 2001 22:18:08 +0200"\ | ||
57 | " 10: > Date: Fri, 28 Dec 2001 22:18:08 +0200"\ | ||
58 | " 11: > From: Foo Bar <foobar@nonexistent.net>"\ | ||
59 | " 12: > Message-Id: <200112282018.fBSKI8N04906@nonexistent.net>"\ | ||
60 | " 13: > To: Bar <bar@dontmailme.org>"\ | ||
61 | " 14: > Subject: Jabberwocky"\ | ||
62 | " 15: >"\ | ||
63 | " 16: > `Twas brillig, and the slithy toves"\ | ||
64 | " 17: > Did gyre and gimble in the wabe;"\ | ||
65 | " 18: > All mimsy were the borogoves,"\ | ||
66 | " 19: > And the mome raths outgrabe."\ | ||
67 | " 20: > "\ | ||
68 | " 21: > `Beware the Jabberwock, my son!"\ | ||
69 | " 22: > The jaws that bite, the claws that catch!"\ | ||
70 | " 23: > Beware the Jujub bird, and shun"\ | ||
71 | " 24: > The frumious Bandersnatch!'"\ | ||
72 | " 25: > "\ | ||
73 | " 26: > He took his vorpal sword in hand:"\ | ||
74 | " 27: > Long time the manxome foe he sought --"\ | ||
75 | " 28: > So rested he by the Tumtum gree,"\ | ||
76 | " 29: > And stood awhile in thought."\ | ||
77 | " 30: > "\ | ||
78 | " 31: > And as in uffish thought he stood,"\ | ||
79 | " 32: > The Jabberwock, with eyes of flame,"\ | ||
80 | " 33: > Came whiffling through the tulgey wook,"\ | ||
81 | " 34: > And burbled as it came!"\ | ||
82 | " 35: > "\ | ||
83 | " 36: > One, two! One, two! And through and through"\ | ||
84 | " 37: > The vorpal blade went snicker-snack!"\ | ||
85 | " 38: > He left it dead, and with its head"\ | ||
86 | " 39: > He went galumphing back."\ | ||
87 | " 40: > "\ | ||
88 | " 41: > `And has thou slain the Jabberwock?"\ | ||
89 | " 42: > Come to my arms, my beamish boy!"\ | ||
90 | " 43: > O frabjous day! Calloh! Callay!"\ | ||
91 | " 44: > He chortled in his joy."\ | ||
92 | " 45: > "\ | ||
93 | " 46: > `Twas brillig, and the slithy toves"\ | ||
94 | " 47: > Did gyre and gimble in the wabe;"\ | ||
95 | " 48: > All mimsy were the borogoves,"\ | ||
96 | " 49: > And the mome raths outgrabe."\ | ||
97 | " 50: > "\ | ||
98 | " 51: "\ | ||
99 | "END OF MESSAGE" | ||
100 | } | ||
96 | 101 | ||
97 | # End of send.exp | 102 | # End of send.exp | ... | ... |
... | @@ -17,14 +17,18 @@ | ... | @@ -17,14 +17,18 @@ |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 | # 02110-1301 USA. | 18 | # 02110-1301 USA. |
19 | 19 | ||
20 | set mtafile "$MU_FOLDER_DIR/mta.diag" | 20 | mu_version |
21 | set env(MTA_DIAG) "$mtafile" | 21 | if ![mu_check_capability ENABLE_SENDMAIL] { |
22 | set env(MTA_APPEND) 1 | 22 | unsupported "Support for sendmail not compiled in" |
23 | } else { | ||
24 | set mtafile "$MU_FOLDER_DIR/mta.diag" | ||
25 | set env(MTA_DIAG) "$mtafile" | ||
26 | set env(MTA_APPEND) 1 | ||
23 | 27 | ||
24 | set mailer "sendmail:$top_builddir/examples/mta" | 28 | set mailer "sendmail:$top_builddir/examples/mta" |
25 | |||
26 | sieve_driver_test "Redirect" "$mailer" "$mtafile" | ||
27 | 29 | ||
30 | sieve_driver_test "Redirect" "$mailer" "$mtafile" | ||
31 | } | ||
28 | # End of redirect.exp | 32 | # End of redirect.exp |
29 | 33 | ||
30 | 34 | ... | ... |
... | @@ -17,14 +17,18 @@ | ... | @@ -17,14 +17,18 @@ |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 | # 02110-1301 USA. | 18 | # 02110-1301 USA. |
19 | 19 | ||
20 | set mtafile "$MU_FOLDER_DIR/mta.diag" | 20 | mu_version |
21 | set env(MTA_DIAG) "$mtafile" | 21 | if ![mu_check_capability ENABLE_SENDMAIL] { |
22 | set env(MTA_APPEND) 1 | 22 | unsupported "Support for sendmail not compiled in" |
23 | } else { | ||
24 | set mtafile "$MU_FOLDER_DIR/mta.diag" | ||
25 | set env(MTA_DIAG) "$mtafile" | ||
26 | set env(MTA_APPEND) 1 | ||
23 | 27 | ||
24 | set mailer "sendmail:$top_builddir/examples/mta" | 28 | set mailer "sendmail:$top_builddir/examples/mta" |
25 | |||
26 | sieve_driver_test "Reject" "$mailer" "$mtafile" | ||
27 | 29 | ||
30 | sieve_driver_test "Reject" "$mailer" "$mtafile" | ||
31 | } | ||
28 | # End of reject.exp | 32 | # End of reject.exp |
29 | 33 | ||
30 | 34 | ... | ... |
-
Please register or sign in to post a comment