## nmh _does_ have a test suite!
##
TESTS_ENVIRONMENT = MH_OBJ_DIR="@abs_builddir@" \
+ MH_VERSION="$(VERSION)" \
+ OAUTH_SUPPORT='@OAUTH_SUPPORT@' \
+ CURL_USER_AGENT='@CURL_USER_AGENT@' \
MH_TEST_DIR=`cd "@abs_builddir@" && pwd -P`/test/testdir \
nmhlibexecdir="$(nmhlibexecdir)" bindir="$(bindir)" \
mandir="$(mandir)" nmhetcdir="$(nmhetcdir)" \
test/mhshow/test-subpart test/mhshow/test-msg-buffer-boundaries \
test/mhstore/test-mhstore test/mkstemp/test-mkstemp \
test/new/test-basic test/pick/test-pick test/pick/test-stderr \
+ test/oauth/test-mhlogin test/oauth/test-mhparam test/oauth/test-send \
+ test/oauth/test-sendfrom test/oauth/test-inc test/oauth/test-share \
test/post/test-post-aliases test/post/test-post-basic \
test/post/test-post-multiple test/post/test-post-bcc \
test/post/test-post-dcc test/post/test-post-fcc \
check_SCRIPTS = test/common.sh
check_PROGRAMS = test/getfullname test/getcanon test/fakepop test/fakesmtp \
- test/getcwidth
+ test/getcwidth test/fakehttp
## The location of installed nmhetcdir is, for all purposes except
## distcheck, $nmhetcdir. For distcheck, prepend $MH_INST_DIR (from
##
## Files that need to be built before everything else
##
-BUILT_SOURCES = sbr/sigmsg.h sbr/ctype-checked.c
+BUILT_SOURCES = sbr/ctype-checked.c
##
## This is a list of all programs that get installed in the "bin" directory
uip/mhparam uip/mhpath uip/mhshow uip/mhstore uip/msgchk \
uip/new uip/packf uip/pick uip/prompter uip/refile \
uip/repl uip/rmf uip/rmm uip/scan uip/send uip/show uip/sortm \
- uip/whatnow uip/whom
+ uip/whatnow uip/whom uip/mhlogin
bin_SCRIPTS = uip/mhmail etc/sendfiles
h/mh.h h/mhcachesbr.h h/mhparse.h h/mime.h \
h/mts.h h/nmh.h h/picksbr.h h/popsbr.h h/prototypes.h \
h/rcvmail.h h/scansbr.h h/signals.h h/tws.h h/utils.h \
- mts/smtp/smtp.h sbr/ctype-checked.h
+ mts/smtp/smtp.h sbr/ctype-checked.h h/oauth.h \
+ thirdparty/jsmn/jsmn.h
##
## Extra files we need to install in various places
man/prompter.1 man/rcvdist.1 man/rcvpack.1 man/rcvstore.1 \
man/rcvtty.1 man/refile.1 man/repl.1 man/rmf.1 man/rmm.1 \
man/scan.1 man/send.1 man/sendfiles.1 man/show.1 man/slocal.1 \
- man/sortm.1 man/unseen.1 man/whatnow.1 man/whom.1
+ man/sortm.1 man/unseen.1 man/whatnow.1 man/whom.1 man/mhlogin.1
##
## Sources for our man pages
man/rcvstore.man man/rcvtty.man man/refile.man man/repl.man \
man/rmf.man man/rmm.man man/scan.man man/send.man \
man/sendfiles.man man/show.man man/slocal.man man/sortm.man \
- man/unseen.man man/whatnow.man man/whom.man
+ man/unseen.man man/whatnow.man man/whom.man man/mhlogin.man
##
## Files we need to include in the distribution which aren't found by
## Automake using the automatic rules
##
-EXTRA_DIST = autogen.sh config/version.sh sbr/sigmsg.awk sbr/icalparse.h \
+EXTRA_DIST = autogen.sh config/version.sh sbr/icalparse.h \
etc/mts.conf.in etc/mhn.defaults.sh etc/sendfiles \
$(MHNSEARCHPROG) DATE MACHINES \
docs/ChangeLog_MH-3_to_MH-6.6 \
test/mhbuild/nulls \
test/mhbuild/textplain \
test/post/test-post-common.sh test/send/README \
+ test/oauth/common.sh \
test/valgrind.supp uip/mhmail \
SPECS/nmh.spec SPECS/build-nmh-cygwin $(man_SRCS)
uip_forw_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/popsbr.c
- uip_inc_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(SASLLIB) $(POSTLINK)
+ uip_inc_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(SASLLIB) $(CURLLIB) $(POSTLINK)
uip_install_mh_SOURCES = uip/install-mh.c
uip_install_mh_LDADD = $(LDADD) $(POSTLINK)
uip_mhstore_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_msgchk_SOURCES = uip/msgchk.c uip/popsbr.c
- uip_msgchk_LDADD = $(LDADD) $(SASLLIB) $(POSTLINK)
+ uip_msgchk_LDADD = $(LDADD) $(SASLLIB) $(CURLLIB) $(POSTLINK)
uip_new_SOURCES = uip/new.c
uip_new_LDADD = $(LDADD) $(POSTLINK)
uip_whatnow_SOURCES = uip/whatnow.c uip/whatnowsbr.c uip/sendsbr.c \
uip/annosbr.c uip/distsbr.c
-uip_whatnow_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) \
- $(POSTLINK)
+uip_whatnow_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_whom_SOURCES = uip/whom.c uip/distsbr.c
uip_whom_LDADD = $(LDADD) $(POSTLINK)
uip_mhl_SOURCES = uip/mhl.c uip/mhlsbr.c
uip_mhl_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
+ uip_mhlogin_SOURCES = uip/mhlogin.c
+ uip_mhlogin_LDADD = mts/libmts.a $(LDADD) $(CURLLIB) $(POSTLINK)
+
uip_mkstemp_SOURCES = uip/mkstemp.c
uip_mkstemp_LDADD = $(LDADD) $(POSTLINK)
uip_post_SOURCES = uip/post.c uip/aliasbr.c
- uip_post_LDADD = mts/libmts.a $(LDADD) $(SASLLIB) $(TLSLIB) $(POSTLINK)
+ uip_post_LDADD = mts/libmts.a $(LDADD) $(SASLLIB) $(CURLLIB) $(TLSLIB) \
+ $(POSTLINK)
uip_rcvdist_SOURCES = uip/rcvdist.c uip/distsbr.c
uip_rcvdist_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip/annosbr.c uip/distsbr.c
uip_viamail_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
- test_getfullname_SOURCES = test/getfullname.c
- test_getfullname_LDADD = $(LDADD) $(POSTLINK)
-
##
## Other program definitions
##
+ test_getfullname_SOURCES = test/getfullname.c
+ test_getfullname_LDADD = $(LDADD) $(POSTLINK)
+
test_getcanon_SOURCES = test/getcanon.c
test_getcanon_LDADD = $(POSTLINK)
- test_fakepop_SOURCES = test/fakepop.c
+ test_fakepop_SOURCES = test/fakepop.c test/server.c
test_fakepop_LDADD = $(POSTLINK)
- test_fakesmtp_SOURCES = test/fakesmtp.c
+ test_fakesmtp_SOURCES = test/fakesmtp.c test/server.c
test_fakesmtp_LDADD = $(POSTLINK)
+ test_fakehttp_SOURCES = test/fakehttp.c test/server.c
+ test_fakehttp_LDADD = $(POSTLINK)
+
test_getcwidth_SOURCES = test/getcwidth.c
test_getcwidth_LDADD = $(POSTLINK)
config/version.c: Makefile $(srcdir)/config/version.sh
env srcdir="$(srcdir)" sh $(srcdir)/config/version.sh $(VERSION) > ./config/version.c
-sbr/sigmsg.h: $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H)
- $(AWK) -f $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) > $@
-
sbr/ctype-checked.h: etc/gen-ctype-checked
etc/gen-ctype-checked
sbr/folder_addmsg.c sbr/folder_delmsgs.c \
sbr/folder_free.c sbr/folder_pack.c \
sbr/folder_read.c sbr/folder_realloc.c sbr/read_switch.c \
- sbr/read_switch_multiword.c sbr/read_yes_or_no_if_tty.c sbr/getarguments.c \
+ sbr/read_switch_multiword.c sbr/read_switch_multiword_via_readline.c \
+ sbr/read_yes_or_no_if_tty.c sbr/getarguments.c \
sbr/getcpy.c sbr/geteditor.c sbr/getfolder.c \
sbr/getpass.c sbr/read_line.c \
sbr/fmt_addr.c sbr/fmt_compile.c sbr/fmt_new.c \
sbr/trimcpy.c sbr/unquote.c \
sbr/uprf.c sbr/vfgets.c \
sbr/mf.c sbr/utils.c sbr/ctype-checked.c \
- sbr/m_mktemp.c sbr/read_switch_multiword_via_readline.c sbr/vector.c \
- config/config.c config/version.c
+ sbr/m_mktemp.c sbr/vector.c sbr/oauth.c sbr/oauth_prof.c \
+ config/config.c config/version.c \
+ thirdparty/jsmn/jsmn.c
##
## Because these files use the definitions in the libmh rule below,
AC_MSG_WARN([Please pass the appropriate arguments to CPPFLAGS/LDFLAGS])])
sasl_support=yes], [sasl_support=no])
+ dnl Do you want client-side support for using OAuth2 for SMTP authentication?
+ AC_ARG_WITH([oauth], AS_HELP_STRING([--with-oauth],
+ [Enable OAuth2 support in SMTP auth]))
+
dnl Do you want client-side support for encryption with TLS?
AC_ARG_WITH([tls], AS_HELP_STRING([--with-tls], [Enable TLS support]))
AS_IF([test x"$with_tls" != x"no"],[
[TLSLIB=])
AC_SUBST([TLSLIB])
+ dnl -----------------
+ dnl CHECK FOR CURL
+ dnl -----------------
+ dnl Look for curl if oauth not disabled (--without-oauth).
+ AC_PATH_PROG([curl_config], [curl-config])
+ AS_IF([test "x$with_oauth" != xno && test -n "$curl_config"], [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS `$curl_config --cflags`"
+ AC_CHECK_HEADER([curl/curl.h], [
+ HAVE_CURL_H=1
+ AC_CHECK_LIB([curl], [curl_easy_init], [
+ CURLLIB="`$curl_config --libs`"
+ AC_SUBST([CURLLIB])
+ CURL_USER_AGENT="`$curl_config --version | sed 's|^libcurl *|libcurl/|; q'`"
+ AS_IF([test "x$CURL_USER_AGENT" != "x`echo $CURL_USER_AGENT | sed 's/ //'`"],
+ [AC_MSG_WARN([unexpected curl-config --version: $CURL_USER_AGENT])
+ CURL_USER_AGENT=libcurl/UNKNOWN])
+ echo "HEYEPG ($CURL_USER_AGENT)"
+ AC_SUBST([CURL_USER_AGENT])
+ ])
+ ], [
+ CFLAGS="$save_CFLAGS"
+ ])
+ ])
+
+ dnl -----------------
+ dnl Enable OAuth?
+ dnl -----------------
+ dnl By default (with_oauth=''), enable OAuth if curl is found.
+ dnl If OAuth requested (--with-oauth with_oauth=yes), error if curl not found.
+ dnl If OAuth disabled (--without-oauth with_oauth=no), don't enable it.
+ oauth_support=no
+ OAUTH_SUPPORT=0
+ AC_SUBST([OAUTH_SUPPORT])
+ AS_IF([test "x$with_oauth" = xyes && test "x$HAVE_CURL_H" = x],
+ [AC_MSG_ERROR([OAuth requested but curl/curl.h not found])],
+ [test "x$with_oauth" = xyes && test "x$CURLLIB" = x],
+ [AC_MSG_ERROR([OAuth requested but curl library not found])],
+ [test "x$with_oauth" != xno && test "x$HAVE_CURL_H" = x1 && test "x$CURLLIB" != x],
+ [AC_DEFINE([OAUTH_SUPPORT], [1], [Support OAuth2 in SMTP auth.])
+ OAUTH_SUPPORT=1
+ oauth_support=yes])
+
dnl ----------------
dnl CHECK FLEX FIXUP
dnl ----------------
AC_STRUCT_DIRENT_D_TYPE
-dnl Where is <signal.h> located? Needed as input for signames.awk
-AC_CACHE_CHECK(where signal.h is located, nmh_cv_path_signal_h,
-[for SIGNAL_H in /usr/include/bsd/sys/signal.h dnl Next
- /usr/include/asm/signal.h dnl Linux 1.3.0 and above
- /usr/include/asm/signum.h dnl some versions of Linux/Alpha
- /usr/include/linux/signal.h dnl Linux up to 1.2.11
- /usr/include/sys/signal.h dnl Almost everybody else
- /dev/null; dnl Just in case we fall through
-do
- test -f $SIGNAL_H && \
- grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
- break
-done
-nmh_cv_path_signal_h=$SIGNAL_H
-])
-SIGNAL_H=$nmh_cv_path_signal_h
-AC_SUBST(SIGNAL_H)dnl
-
dnl
dnl Sigh, this is required because under the new world order autoconf has
dnl nothing to create in a few of the build directories when doing an object
default smtp servers : ${smtpservers}
SASL support : ${sasl_support}
TLS support : ${tls_support}
+ OAuth support : ${oauth_support}
])])dnl
dnl ---------------