/ylwrap
/nmh-*.tar.gz
/nmh-*.tar.gz.sig
+ /sbr/icalendar.c
+ /sbr/icalparse.[hc]
# Removed by maintainer-clean:
/autom4te.cache/
/uip/mark
/uip/mhbuild
/uip/mhfixmsg
+ /uip/mhical
/uip/mhl
/uip/mhlist
+/uip/mhlogin
/uip/mhn
/uip/mhparam
/uip/mhpath
/uip/whatnow
/uip/whom
/uip/*.exe
+/test/fakehttp
/test/fakepop
/test/fakesmtp
/test/getcanon
On all platforms, the following programs are required to build nmh from a
snapshot of the source code repository:
- autoconf
- automake
- flex
+ autoconf 2.68 or later
+ automake 1.12 or later
+ flex 2.5.4 or later
+ bison 2.3 or later, Berkeley yacc 1.9 or later, or Solaris yacc 4.0
They are not required if building from an nmh distribution (.tar.gz) file.
Platform-specific notes follow.
readline (if you want readline support)
cyrus-sasl-lib / libsasl2 (if configured with --with-cyrus-sasl)
openssl-libs / libssl (if configured with --with-tls)
+ libcurl (if configured with --with-oauth)
Additional build-time package requirements:
ncurses-devel / libncurses5-devel
readline-devel (if you want readline support)
cyrus-sasl-devel / libsasl2-dev (if configuring with --with-cyrus-sasl)
openssl-devel / libssl-dev (if configuring with --with-tls)
+ libcurl-devel / libcurl-dev (if configured with --with-oauth)
Test suite package requirements:
ncurses (tput is needed to run test/format/test-curses)
Additional build-time package requirements:
devel/autotools
+ ftp/curl (if configured with --with-oauth)
------------------------------------------------------------------------------
Cygwin
## We set this to get our autoconf macros in the m4 directory
ACLOCAL_AMFLAGS = -I m4
+ AM_YFLAGS = -d
+
##
## This is the default set of libraries all programs link against. Some
## programs add extra libraries to this set, so they override this with
## 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="@abs_builddir@/test/testdir" \
nmhlibexecdir="$(nmhlibexecdir)" bindir="$(bindir)" \
mandir="$(mandir)" nmhetcdir="$(nmhetcdir)" \
+ nmhetcdirinst="@nmhetcdirinst@$(nmhetcdir)" \
supported_locks="$(supported_locks)" \
default_locking="${default_locking}" \
MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \
test/mhbuild/test-ext-params \
test/mhbuild/test-forw test/mhbuild/test-header-encode \
test/mhbuild/test-utf8-body \
- test/mhfixmsg/test-mhfixmsg \
+ test/mhfixmsg/test-mhfixmsg test/mhical/test-mhical \
test/mhl/test-mhl-flags \
test/mhlist/test-mhlist test/mhlist/test-ext-params \
test/mhmail/test-mhmail \
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-send \
+ 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 \
test/post/test-post-group test/post/test-mts test/post/test-messageid \
test/post/test-sendfiles test/prompter/test-prompter \
test/rcv/test-rcvdist test/rcv/test-rcvpack test/rcv/test-rcvstore \
- test/rcv/test-rcvtty test/refile/test-refile \
+ test/rcv/test-rcvtty test/refile/test-refile test/repl/test-convert \
test/repl/test-if-str test/repl/test-trailing-newline \
test/repl/test-multicomp test/repl/test-repl \
test/scan/test-scan test/scan/test-scan-multibyte \
test/sequences/test-flist test/sequences/test-mark \
test/sequences/test-out-of-range \
+ test/show/test-show \
test/slocal/test-slocal \
test/whatnow/test-attach-detach test/whatnow/test-cd \
test/whatnow/test-ls test/whom/test-whom \
check_SCRIPTS = test/common.sh
check_PROGRAMS = test/getfullname test/getcanon test/fakepop test/fakesmtp \
- test/getcwidth
+ test/getcwidth test/fakehttp
- DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1
+
+ ## The location of installed nmhetcdir is, for all purposes except
+ ## distcheck, $nmhetcdir. For distcheck, prepend $MH_INST_DIR (from
+ ## test/common.sh.in), which is based on $MH_TEST_DIR (from
+ ## $TESTS_ENVIRONMENT).
+ DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 \
+ NMHETCDIRINST='$${abs_builddir}/test/testdir/inst'
##
## Stuff that should be cleaned via "make clean"
## automake 1.12.6 on FreeBSD 9 needs the sbr/dtimep.c.
##
CLEANFILES = config/version.c sbr/sigmsg.h sbr/dtimep.c etc/mts.conf \
- etc/gen-ctype-checked sbr/ctype-checked.h sbr/ctype-checked.c \
+ etc/gen-ctype-checked sbr/ctype-checked.[hc] \
etc/mhn.defaults man/man.sed man/mh-chart.man $(man_MANS) \
*.plist
clean-local:
##
bin_PROGRAMS = uip/ali uip/anno uip/burst uip/comp uip/dist uip/flist \
uip/fmttest uip/folder uip/forw uip/inc uip/install-mh \
- uip/mark uip/mhbuild uip/mhfixmsg uip/mhlist uip/mhn \
+ uip/mark uip/mhbuild uip/mhfixmsg uip/mhical uip/mhlist uip/mhn \
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
## them, but that might change in the future.
##
noinst_HEADERS = h/addrsbr.h h/aliasbr.h h/crawl_folders.h h/dropsbr.h \
- h/fmt_compile.h h/fmt_scan.h h/md5.h h/mf.h \
+ h/fmt_compile.h h/fmt_scan.h h/icalendar.h h/md5.h h/mf.h \
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
##
dist_nmhetc_DATA = etc/MailAliases etc/components etc/digestcomps \
- etc/distcomps etc/forwcomps etc/mhl.body etc/mhl.digest \
- etc/mhl.format etc/mhl.forward etc/mhl.headers \
- etc/mhl.reply etc/mhshow.marker etc/rcvdistcomps \
- etc/rcvdistcomps.outbox etc/replcomps etc/replgroupcomps \
- etc/scan.MMDDYY \
- etc/scan.YYYYMMDD etc/scan.curses etc/scan.default \
- etc/scan.highlighted \
- etc/scan.mailx etc/scan.nomime etc/scan.size etc/scan.time \
- etc/scan.timely etc/scan.unseen
+ etc/distcomps etc/forwcomps \
+ etc/mhical.12hour etc/mhical.24hour \
+ etc/mhl.body etc/mhl.digest etc/mhl.format etc/mhl.forward \
+ etc/mhl.headers etc/mhl.reply etc/mhl.replywithoutbody \
+ etc/mhshow.marker etc/rcvdistcomps etc/rcvdistcomps.outbox \
+ etc/replcomps etc/replgroupcomps \
+ etc/scan.MMDDYY \
+ etc/scan.YYYYMMDD etc/scan.curses etc/scan.default \
+ etc/scan.highlighted \
+ etc/scan.mailx etc/scan.nomime etc/scan.size etc/scan.time \
+ etc/scan.timely etc/scan.unseen
##
## The same as above, but we don't include these in the distribution
docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \
docs/README-HOOKS docs/README-components docs/README.about \
docs/README.SASL docs/README.developers docs/README.manpages \
- docs/README-iCalendar docs/TODO
+ docs/TODO
##
## Contribs that get installed in docdir/contrib/
contribdir = $(docdir)/contrib
dist_contrib_SCRIPTS = docs/contrib/replyfilter docs/contrib/build_nmh \
docs/contrib/ml docs/contrib/vpick
+ dist_contrib_DATA = docs/contrib/replaliases
##
## Our man pages
man/mh-alias.5 man/mh-chart.7 man/mh-draft.5 man/mh-folders.5 \
man/mh-format.5 man/mh-mail.5 man/mh-mime.7 man/mh-profile.5 \
man/mh_profile.5 man/mh-sequence.5 man/mh-tailor.5 man/mhbuild.1 \
- man/mhfixmsg.1 man/mhl.1 man/mhlist.1 man/mhmail.1 man/mhn.1 \
- man/mhparam.1 man/mhpath.1 man/mhshow.1 man/mhstore.1 \
+ man/mhfixmsg.1 man/mhical.1 man/mhl.1 man/mhlist.1 man/mhmail.1 \
+ man/mhn.1 man/mhparam.1 man/mhpath.1 man/mhshow.1 man/mhstore.1 \
man/mh-mkstemp.1 man/msgchk.1 man/mts.conf.5 man/new.1 \
man/next.1 man/nmh.7 man/packf.1 man/pick.1 man/post.8 man/prev.1 \
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/mh-chart-gen.sh man/mh-draft.man man/mh-folders.man \
man/mh-format.man man/mh-mail.man man/mh-mime.man \
man/mh-profile.man man/mh_profile.man man/mh-sequence.man \
- man/mh-tailor.man man/mhbuild.man man/mhfixmsg.man man/mhl.man \
- man/mhlist.man man/mhmail.man man/mhn.man man/mhparam.man \
- man/mhpath.man man/mhshow.man man/mhstore.man man/mh-mkstemp.man \
- man/msgchk.man man/mts.conf.man man/new.man \
+ man/mh-tailor.man man/mhbuild.man man/mhfixmsg.man man/mhical.man \
+ man/mhl.man man/mhlist.man man/mhmail.man man/mhn.man \
+ man/mhparam.man man/mhpath.man man/mhshow.man man/mhstore.man \
+ man/mh-mkstemp.man man/msgchk.man man/mts.conf.man man/new.man \
man/next.man man/nmh.man man/packf.man man/pick.man man/post.man \
man/prev.man man/prompter.man man/rcvdist.man man/rcvpack.man \
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 etc/mts.conf.in \
- etc/mhn.defaults.sh etc/sendfiles $(MHNSEARCHPROG) DATE MACHINES \
+ EXTRA_DIST = autogen.sh config/version.sh sbr/sigmsg.awk sbr/icalparse.h \
+ etc/mts.conf.in etc/mhn.defaults.sh etc/sendfiles \
+ $(MHNSEARCHPROG) DATE MACHINES \
docs/ChangeLog_MH-3_to_MH-6.6 \
docs/ChangeLog_MH-6.7.0_to_MH-6.8.4.html \
test/README test/fakesendmail $(TESTS) test/inc/deb359167.mbox \
test/mhbuild/somebinary \
test/mhbuild/nulls \
test/mhbuild/textplain \
- test/post/test-post-common.sh test/valgrind.supp uip/mhmail \
+ test/post/test-post-common.sh test/valgrind.supp \
+ test/oauth/common.sh \
+ 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) $(POSTLINK) $(CURLLIB)
uip_install_mh_SOURCES = uip/install-mh.c
uip_install_mh_LDADD = $(LDADD) $(POSTLINK)
uip_mhbuild_SOURCES = uip/mhbuild.c uip/mhbuildsbr.c uip/mhcachesbr.c \
uip/mhlistsbr.c uip/mhoutsbr.c uip/mhmisc.c \
- uip/mhfree.c uip/mhparse.c uip/md5.c
+ uip/mhfree.c uip/mhparse.c uip/md5.c \
+ uip/mhstoresbr.c uip/mhshowsbr.c
uip_mhbuild_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_mhfixmsg_SOURCES = uip/mhfixmsg.c uip/mhparse.c uip/mhcachesbr.c \
uip/mhshowsbr.c uip/mhlistsbr.c uip/md5.c
uip_mhfixmsg_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
+ uip_mhical_SOURCES = uip/mhical.c
+ uip_mhical_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
+
uip_mhlist_SOURCES = uip/mhlist.c uip/mhparse.c uip/mhcachesbr.c \
uip/mhlistsbr.c uip/mhmisc.c uip/mhfree.c uip/md5.c
uip_mhlist_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(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) $(POSTLINK) $(CURLLIB)
uip_new_SOURCES = uip/new.c
uip_new_LDADD = $(LDADD) $(POSTLINK)
uip_send_SOURCES = uip/send.c uip/sendsbr.c uip/annosbr.c \
uip/distsbr.c
-uip_send_LDADD = $(LDADD) $(POSTLINK)
+uip_send_LDADD = $(LDADD) $(POSTLINK) $(CURLLIB)
uip_show_SOURCES = uip/show.c uip/mhlsbr.c
uip_show_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(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)
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)
sbr/getcpy.c sbr/geteditor.c sbr/getfolder.c \
sbr/getpass.c \
sbr/fmt_addr.c sbr/fmt_compile.c sbr/fmt_new.c \
- sbr/fmt_rfc2047.c sbr/fmt_scan.c sbr/lock_file.c \
+ sbr/fmt_rfc2047.c sbr/fmt_scan.c \
+ sbr/icalparse.y sbr/icalendar.l sbr/datetime.c \
+ sbr/lock_file.c \
sbr/m_atoi.c sbr/m_backup.c sbr/m_convert.c \
sbr/m_draft.c sbr/m_getfld.c sbr/m_gmprot.c \
sbr/m_maildir.c sbr/m_name.c sbr/m_popen.c sbr/m_rand.c \
sbr/uprf.c sbr/vfgets.c \
sbr/mf.c sbr/utils.c sbr/ctype-checked.c \
sbr/m_mktemp.c sbr/getansreadline.c sbr/vector.c \
- config/config.c config/version.c
+ config/config.c config/version.c sbr/oauth.c \
+ thirdparty/jsmn/jsmn.c
##
## Because these files use the definitions in the libmh rule below,
config/sbr_libmh_a-config.$(OBJEXT) sbr/sbr_libmh_a-mts.$(OBJEXT): Makefile
- sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(nmhetcdir)"' \
+ sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"@nmhetcdirinst@$(nmhetcdir)"' \
-DMAILSPOOL='"$(mailspool)"' \
-DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \
-DNMHLIBEXECDIR='"$(nmhlibexecdir)"'
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]))
+AS_IF([test x"$with_oauth" != x -a x"$with_oauth" != x"no"],[
+ AC_DEFINE([OAUTH_SUPPORT], [1],
+ [Support OAuth2 in SMTP auth.])dnl
+ OAUTH_SUPPORT=1; oauth_support=yes], [OAUTH_SUPPORT=0; oauth_support=no])
+AC_SUBST(OAUTH_SUPPORT)
+
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"],[
dnl ------------------
dnl CHECK THE COMPILER
dnl ------------------
- dnl We want these before the checks,
- dnl so the checks can modify their values.
- test -z "$CFLAGS" && auto_cflags=1
AC_PROG_CC([cc gcc])
AM_PROG_CC_C_O
dnl ----------------
dnl CUSTOMIZE CFLAGS
dnl ----------------
- if test -n "$auto_cflags"; then
- dnl The user didn't specify CFLAGS, so customize them.
- if test "$GCC" = yes; then
- dnl Can't use -ansi with gcc 4.5.3 on Cygwin, at least through setup
- dnl version 2.763, because it disables some features in the system
- dnl header files and warns about them with -Wall. Try to test for
- dnl that generally, with gcc.
- AC_CACHE_CHECK([whether we can use -ansi with gcc], [nmh_cv_has_dash_ansi],
- [nmh_saved_cppflags="$CPPFLAGS"
- nmh_saved_cflags="$CFLAGS"
- CPPFLAGS="-D_GNU_SOURCE"
- CFLAGS="-ansi -Wall -Werror"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>],[tzset();])],
- [nmh_cv_has_dash_ansi=yes],
- [nmh_cv_has_dash_ansi=no])
- CPPFLAGS="$nmh_saved_cppflags"
- CFLAGS="$nmh_saved_cflags"])
- test "$nmh_cv_has_dash_ansi" = "yes" && \
- CFLAGS="${CFLAGS:+$CFLAGS }-ansi -pedantic"
- else
- dnl Use -v and some other options with SunStudio cc. lex produces
- dnl code that causes unreachable-statement warnings. It might be
- dnl better to use an autoconf test, except -v will probably succeed
- dnl with many other compilers but have different meaning.
- AS_CASE([`${CC} -V 2>&1`],
- [cc:\ Sun\ C*], [CFLAGS=\
+ dnl The user didn't specify CFLAGS, so customize them.
+ if test "$GCC" != yes; then
+ dnl Use -v and some other options with SunStudio cc. lex produces
+ dnl code that causes unreachable-statement warnings. It might be
+ dnl better to use an autoconf test, except -v will probably succeed
+ dnl with many other compilers but have different meaning.
+ AS_CASE([`${CC} -V 2>&1`],
+ [cc:\ Sun\ C*], [CFLAGS=\
"${CFLAGS:+$CFLAGS }-v -errtags=yes -erroff=E_STATEMENT_NOT_REACHED"])
- fi
-
- AC_CACHE_CHECK([whether compiler supports -Wall], [nmh_cv_has_wall],
- [nmh_saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wall -Werror"
- AC_TRY_COMPILE([],[],nmh_cv_has_wall=yes,nmh_cv_has_wall=no)
- CFLAGS="$nmh_saved_cflags"])
- test "$nmh_cv_has_wall" = "yes" && CFLAGS="${CFLAGS:+$CFLAGS }-Wall"
-
- AC_CACHE_CHECK([whether compiler supports -Wextra], [nmh_cv_has_wextra],
- [nmh_saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wextra -Werror"
- AC_TRY_COMPILE([],[],nmh_cv_has_wextra=yes,
- nmh_cv_has_wextra=no)
- CFLAGS="$nmh_saved_cflags"])
- test "$nmh_cv_has_wextra" = "yes" && CFLAGS="${CFLAGS:+$CFLAGS }-Wextra"
fi
+ AC_CACHE_CHECK([whether compiler supports -Wall], [nmh_cv_has_wall],
+ [nmh_saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wall -Werror"
+ AC_TRY_COMPILE([],[],nmh_cv_has_wall=yes,nmh_cv_has_wall=no)
+ CFLAGS="$nmh_saved_cflags"])
+ test "$nmh_cv_has_wall" = "yes" && CFLAGS="${CFLAGS:+$CFLAGS }-Wall"
+
+ AC_CACHE_CHECK([whether compiler supports -Wextra], [nmh_cv_has_wextra],
+ [nmh_saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wextra -Werror"
+ AC_TRY_COMPILE([],[],nmh_cv_has_wextra=yes,
+ nmh_cv_has_wextra=no)
+ CFLAGS="$nmh_saved_cflags"])
+ test "$nmh_cv_has_wextra" = "yes" && CFLAGS="${CFLAGS:+$CFLAGS }-Wextra"
+
if test "$GCC" = yes; then
dnl Do this regardless of auto_cflags value.
dnl Enable _FORTIFY_SOURCE checking, which is supported by
dnl ------------------
dnl CHECK FOR PROGRAMS
dnl ------------------
- AC_PROG_MAKE_SET dnl Does make define $MAKE
- AC_PROG_INSTALL dnl Check for BSD compatible `install'
- AC_PROG_RANLIB dnl Check for `ranlib'
+ AC_PROG_MAKE_SET dnl Does make define $MAKE
+ AC_PROG_INSTALL dnl Check for BSD compatible `install'
+ AC_PROG_RANLIB dnl Check for `ranlib'
AC_PROG_AWK dnl Check for mawk,gawk,nawk, then awk
- AC_PROG_SED dnl Check for Posix-compliant sed
+ AC_PROG_SED dnl Check for Posix-compliant sed
+ AC_PROG_YACC dnl Check for yacc/bison
AM_PROG_LEX dnl Check for lex/flex
AM_PROG_AR
dnl If mailspool is not world-writable and dotlockfile is not setgid,
dnl we need to #define MAILGROUP to 1 and make inc setgid.
- if test x"$LOCKTYPE" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then
+ if test x"$with_locking" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then
dnl do we really need both of these?
AC_DEFINE([MAILGROUP],[1],
[Define to 1 if you need to make `inc' set-group-id because your mail spool is not world writable. There are no guarantees as to the safety of doing this, but this #define will add some extra security checks.])dnl
[TLSLIB=])
AC_SUBST([TLSLIB])
+dnl -----------------
+dnl CHECK FOR CURL
+dnl -----------------
+AS_IF([test x"$OAUTH_SUPPORT" = x"1"],[
+ AC_PATH_PROG([curl_config], [curl-config])
+ AC_CHECK_HEADER([curl/curl.h], [], [AC_MSG_ERROR([curl/curl.h not found])])
+ AC_CHECK_LIB([curl], [curl_easy_init], [CURLLIB="`$curl_config --libs`"],
+ [AC_MSG_ERROR([curl library not found])],[$CURLLIB])
+ CURL_USER_AGENT=`$curl_config --version | sed 's| |/|'`
+ ],
+ [CURLLIB=
+ CURL_USER_AGENT=
+])
+AC_SUBST([CURLLIB])
+AC_SUBST([CURL_USER_AGENT])
+
dnl ----------------
dnl CHECK FLEX FIXUP
dnl ----------------
'; sed "s/\( \)int i;/\1yy_size_t i;/" $@ >$@.tmp && mv -f $@.tmp $@'])
AC_SUBST([LFLAGS])])
+ dnl ------------------
+ dnl FOR INTERNAL USE by the NMH test suite
+ dnl ------------------
+ AC_ARG_VAR([NMHETCDIRINST], [for internal use by nmh test suite])
+ AS_IF([test -n "$NMHETCDIRINST"], [nmhetcdirinst=$NMHETCDIRINST]
+ AC_SUBST([nmhetcdirinst]))
+
dnl ----------------
dnl CHECK STRUCTURES
dnl ----------------
default smtp servers : ${smtpservers}
SASL support : ${sasl_support}
TLS support : ${tls_support}
+OAuth support : ${oauth_support}
])])dnl
dnl ---------------
#define MS_UNKNOWN 1 /* type not known yet */
#define MS_MBOX 2 /* Unix-style "from" lines */
#define MS_MMDF 3 /* string mmdlm2 */
- #define MS_MSH 4 /* whacko msh */
#define NOUSE 0 /* draft being re-used */
extern char *showmimeproc;
extern char *showproc;
extern char *usequence;
+extern char *user_agent;
extern char *version_num;
extern char *version_str;
extern char *whatnowproc;
struct msgs_array;
void add_profile_entry (const char *, const char *);
-void adios (char *, char *, ...) NORETURN;
+void adios (char *, const char *, ...) NORETURN;
void admonish (char *, char *, ...);
-void advertise (char *, char *, char *, va_list);
+void advertise (char *, char *, const char *, va_list);
void advise (char *, char *, ...);
char **argsplit (char *, char **, int *);
void argsplit_msgarg (struct msgs_array *, char *, char **);
void push (void);
char *pwd (void);
char *r1bindex(char *, int);
-void readconfig (struct node **, FILE *, char *, int);
+void readconfig (struct node **, FILE *, const char *, int);
int refile (char **, char *);
void ruserpass (char *, char **, char **);
int remdir (char *);
*
*/
void unquote_string(const char *input, char *output);
- int uprf (char *, char *);
+ int uprf (const char *, const char *);
int vfgets (FILE *, char **);
/*
.\"
.\" %nmhwarning%
.\"
-.TH SEND %manext1% "July 8, 2014" "%nmhversion%"
+.TH SEND %manext1% "November 25, 2014" "%nmhversion%"
.SH NAME
send \- send a message
.SH SYNOPSIS
.RB [ \-msgid " | " \-nomsgid ]
.RB [ \-messageid
.IR localname " | " random ]
+.RB [ \-oauth
+.IR service ]
.RB [ \-push " | " \-nopush ]
.RB [ \-split
.IR seconds ]
.RB [ \-watch " | " \-nowatch ]
.RB [ \-mts
.IR smtp " | " sendmail/smtp " | " sendmail/pipe ]
+ .RB [ \-sendmail
+ .IR program ]
.RB [ \-server
.IR servername ]
.RB [ \-port
.B \-mts
switch.
.PP
+ If nmh is using as its mail transport system
+ .BR sendmail/pipe ,
+ the
+ .B \-sendmail
+ switch can be used to override the default
+ .B sendmail
+ program.
+ .PP
If nmh is using the SMTP MTA, the
.B \-server
and the
.B \-snoop
switch can be used to view the SMTP transaction. (Beware that the
SMTP transaction may contain authentication information either in
-plaintext or easily decoded base64.)
+plaintext or easily decoded base64.) If
+.B \-oauth
+is used, the HTTP transaction is also shown.
.PP
If
.B nmh
.PP
If
.B nmh
+has been compiled with OAuth support, the
+.B \-oauth
+switch will enable OAuth authentication. The
+.B \-user
+switch must be used, and the
+.I user-name
+must be an email address the user has for that service. Before using this,
+the user must authorize nmh by running
+.B mhlogin
+and grant authorization to that account. Only
+.B -oauth
+.I gmail
+is supported. See the
+.B mhlogin
+man page for more details.
+.PP
+If
+.B nmh
has been compiled with TLS support, the
.B \-tls
and
.IR forw (1),
.IR mhbuild (1),
.IR mhparam (1),
+.IR mhlogin (1),
.IR repl (1),
.IR whatnow (1),
.IR mh\-alias (5),
*/
#ifdef MAILGROUP
- /* Revised: Sat Apr 14 17:08:17 PDT 1990 (marvit@hplabs)
+ /*
+ * Thu Feb 12 21:00 CST 2015 Marcin Cieslak <saper@saper.info>
+ * Replaced setgid() calls with setegid() so that it works with dot
+ * locking on FreeBSD. setegid() should be supported on modern POSIX
+ * systems.
+ *
+ * Revised: Sat Apr 14 17:08:17 PDT 1990 (marvit@hplabs)
* Added hpux hacks to set and reset gid to be "mail" as needed. The reset
* is necessary so inc'ed mail is the group of the inc'er, rather than
* "mail". We setgid to egid only when [un]locking the mail file. This
X("form formatfile", 0, FORMSW) \
X("format string", 5, FMTSW) \
X("host hostname", 0, HOSTSW) \
+ X("oauth service", 0, OAUTHSW) \
X("user username", 0, USERSW) \
X("pack file", 0, PACKSW) \
X("nopack", 0, NPACKSW) \
* For setting and returning to "mail" gid
*/
#ifdef MAILGROUP
- static int return_gid;
+ static gid_t return_gid;
#define TRYDROPGROUPPRIVS() DROPGROUPPRIVS()
- #define DROPGROUPPRIVS() setgid(getgid())
- #define GETGROUPPRIVS() setgid(return_gid)
+ #define DROPGROUPPRIVS() \
+ if (setegid(getgid()) != 0) { \
+ adios ("setegid", "unable to restore group to %ld", (long) getgid()); \
+ }
+ #define GETGROUPPRIVS() \
+ if (setegid(return_gid) != 0) { \
+ adios ("setegid", "unable to set group to %ld", (long) return_gid); \
+ }
#define SAVEGROUPPRIVS() return_gid = getegid()
#else
/* define *GROUPPRIVS() as null; this avoids having lots of "#ifdef MAILGROUP"s */
FILE *aud = NULL;
char b[PATH_MAX + 1];
char *maildir_copy = NULL; /* copy of mail directory because the static gets overwritten */
+ const char *oauth_svc = NULL;
int nmsgs, nbytes;
char *MAILHOST_env_variable;
-
done=inc_done;
/* absolutely the first thing we do is save our privileges,
adios (NULL, "missing argument to %s", argp[-2]);
continue;
+ case OAUTHSW:
+#ifdef OAUTH_SUPPORT
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ oauth_svc = cp;
+#else
+ adios (NULL, "not built with OAuth support");
+#endif
+ continue;
+
case USERSW:
if (!(user = *argp++) || *user == '-')
adios (NULL, "missing argument to %s", argp[-2]);
if (inc_type == INC_POP) {
struct nmh_creds creds = { 0, 0, 0 };
+ if (oauth_svc == NULL) {
+ nmh_get_credentials (host, user, sasl, &creds);
+ } else {
+ if (user == NULL) {
+ adios (NULL, "must specify -user with -oauth");
+ }
+ creds.user = user;
+ }
+
/*
* initialize POP connection
*/
- nmh_get_credentials (host, user, sasl, &creds);
if (pop_init (host, port, creds.user, creds.password, proxy, snoop,
- sasl, saslmech) == NOTOK)
+ sasl, saslmech, oauth_svc) == NOTOK)
adios (NULL, "%s", response);
/* Check if there are any messages */
static void
inc_done (int status)
{
+ done = exit;
if (packfile && pd != NOTOK)
mbx_close (packfile, pd);
if (locked)
DEFINE_SWITCH_ARRAY(MHPARAM, switches);
#undef X
+ extern char *mhbindir;
extern char *mhetcdir;
extern char *mhlibexecdir;
"";
#endif
+static char *oauth =
+#ifdef OAUTH_SUPPORT
+ "oauth";
+#else
+ "";
+#endif
+
struct proc {
char *p_name;
char **p_field;
{ "version", &version_num },
{ "whatnowproc", &whatnowproc },
{ "whomproc", &whomproc },
+ { "bindir", &mhbindir },
{ "etcdir", &mhetcdir },
{ "libdir", &mhlibexecdir },
{ "libexecdir", &mhlibexecdir },
{ "datalocking", &datalocking },
{ "spoollocking", &spoollocking },
{ "iconv", &iconv },
+ { "oauth", &oauth },
{ "sasl", &sasl },
{ "tls", &tls },
{ NULL, NULL },
X("nosasl", SASLminc(-6), NOSASLSW) \
X("saslmaxssf", SASLminc(-10), SASLMXSSFSW) \
X("saslmech", SASLminc(-5), SASLMECHSW) \
+ X("oauth", -5, OAUTHSW) \
X("user", SASLminc(-4), USERSW) \
X("port server submission port name/number", 4, PORTSW) \
X("tls", TLSminc(-3), TLSSW) \
X("notls", TLSminc(-5), NTLSSW) \
X("fileproc", -4, FILEPROCSW) \
X("mhlproc", -3, MHLPROCSW) \
+ X("sendmail program", 0, MTSSM) \
X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
X("credentials legacy|file:filename", 0, CREDENTIALSSW) \
X("messageid localname|random", 2, MESSAGEIDSW) \
static int annoaux (struct mailname *);
static void insert_fcc (struct headers *, char *);
static void make_bcc_file (int);
-static void verify_all_addresses (int, char *);
+static void verify_all_addresses (int, char *, const char *);
static void chkadr (void);
static void sigon (void);
static void sigoff (void);
static void p_refile (char *);
static void fcc (char *, char *);
static void die (char *, char *, ...);
-static void post (char *, int, int, char *);
+static void post (char *, int, int, char *, const char *);
static void do_text (char *file, int fd);
static void do_an_address (struct mailname *, int);
static void do_addresses (int, int);
char buf[BUFSIZ], name[NAMESZ];
FILE *in, *out;
m_getfld_state_t gstate = 0;
+ char *xoauth_client_res = NULL;
if (nmh_init(argv[0], 0 /* use context_foil() */)) { return 1; }
if (!(saslmech = *argp++) || *saslmech == '-')
adios (NULL, "missing argument to %s", argp[-2]);
continue;
-
+
+ case OAUTHSW:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ xoauth_client_res = cp;
+ continue;
+
case USERSW:
if (!(user = *argp++) || *user == '-')
adios (NULL, "missing argument to %s", argp[-2]);
mhlproc = cp;
continue;
+ case MTSSM:
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ sendmail = cp;
+ continue;
+
case MTSSW:
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
/* If we are doing a "whom" check */
if (whomsw) {
/* This won't work with MTS_SENDMAIL_PIPE. */
- verify_all_addresses (1, envelope);
+ verify_all_addresses (1, envelope, xoauth_client_res);
done (0);
}
verify_all_addresses with MTS_SENDMAIL_PIPE, but
that might require running sendmail as root. Note
that spost didn't verify addresses. */
- verify_all_addresses (verbose, envelope);
+ verify_all_addresses (verbose, envelope, xoauth_client_res);
}
- post (tmpfil, 0, verbose, envelope);
+ post (tmpfil, 0, verbose, envelope, xoauth_client_res);
}
- post (bccfil, 1, verbose, envelope);
+ post (bccfil, 1, verbose, envelope, xoauth_client_res);
(void) m_unlink (bccfil);
} else {
- post (tmpfil, 0, isatty (1), envelope);
+ post (tmpfil, 0, isatty (1), envelope, xoauth_client_res);
}
p_refile (tmpfil);
*/
static void
-post (char *file, int bccque, int talk, char *envelope)
+post (char *file, int bccque, int talk, char *envelope,
+ const char *xoauth_client_res)
{
int fd;
int retval, i;
} else {
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch,
verbose, snoop, sasl, saslssf,
- saslmech, user, tls)) ||
- rp_isbad (retval = sm_winit (envelope)))
+ saslmech, user, xoauth_client_res, tls))
+ || rp_isbad (retval = sm_winit (envelope)))
die (NULL, "problem initializing server; %s", rp_string (retval));
do_addresses (bccque, talk && verbose);
/* Address Verification */
static void
-verify_all_addresses (int talk, char *envelope)
+verify_all_addresses (int talk, char *envelope, const char *xoauth_client_res)
{
int retval;
struct mailname *lp;
if (!whomsw || checksw)
if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch,
verbose, snoop, sasl, saslssf,
- saslmech, user, tls))
+ saslmech, user, xoauth_client_res, tls))
|| rp_isbad (retval = sm_winit (envelope)))
die (NULL, "problem initializing server; %s", rp_string (retval));
#include <h/mh.h>
#include <fcntl.h>
+#include <h/oauth.h>
+#include <h/utils.h>
#ifndef CYRUS_SASL
# define SASLminc(a) (a)
X("nosasl", SASLminc(-6), NOSASLSW) \
X("saslmaxssf", SASLminc(-10), SASLMXSSFSW) \
X("saslmech mechanism", SASLminc(-5), SASLMECHSW) \
+ X("oauth service", 0, OAUTHSW) \
X("user username", SASLminc(-4), USERSW) \
X("attach", -6, ATTACHSW) \
X("noattach", -8, NOATTACHSW) \
X("tls", TLSminc(-3), TLSSW) \
X("initialtls", TLSminc(-10), INITTLSSW) \
X("notls", TLSminc(-5), NTLSSW) \
+ X("sendmail program", 0, MTSSM) \
X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
X("messageid localname|random", 2, MESSAGEIDSW) \
char *cp, *dfolder = NULL, *maildir = NULL;
char buf[BUFSIZ], **ap, **argp, **arguments, *program;
char *msgs[MAXARGS], **vec;
+ const char *user = NULL, *oauth_svc = NULL;
struct msgs *mp;
struct stat st;
+ int snoop = 0;
if (nmh_init(argv[0], 1)) { return 1; }
vec[vecp++] = --cp;
continue;
+ case SNOOPSW:
+ snoop++;
+ vec[vecp++] = --cp;
+ continue;
+
case DEBUGSW:
debugsw++; /* fall */
case NFILTSW:
case NMSGDSW:
case WATCSW:
case NWATCSW:
- case SNOOPSW:
case SASLSW:
case NOSASLSW:
case TLSSW:
vec[vecp++] = --cp;
continue;
+ case OAUTHSW:
+#ifdef OAUTH_SUPPORT
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ oauth_svc = cp;
+#else
+ NMH_UNUSED (oauth_svc);
+ adios (NULL, "not built with OAuth support");
+#endif
+ continue;
+
+ case USERSW:
+ vec[vecp++] = --cp;
+ if (!(cp = *argp++) || *cp == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ vec[vecp++] = cp;
+ user = cp;
+ continue;
+
case ALIASW:
case FILTSW:
case WIDTHSW:
case SERVSW:
case SASLMECHSW:
case SASLMXSSFSW:
- case USERSW:
case PORTSW:
+ case MTSSM:
case MTSSW:
case MESSAGEIDSW:
vec[vecp++] = --cp;
distfile = NULL;
}
+#ifdef OAUTH_SUPPORT
+ if (oauth_svc != NULL) {
+ if (user == NULL) {
+ adios (NULL, "must specify -user with -oauth");
+ }
+
+ vec[vecp++] = "-oauth";
+ vec[vecp++] = mh_oauth_do_xoauth (user, oauth_svc,
+ snoop ? stderr : NULL);
+ }
+#endif /* OAUTH_SUPPORT */
+
if (altmsg == NULL || stat (altmsg, &st) == NOTOK) {
st.st_mtime = 0;
st.st_dev = 0;