c6c8a7
%global use_nss 1
c6c8a7
%global mailrc %{_sysconfdir}/mail.rc
c6c8a7
c6c8a7
Summary: Enhanced implementation of the mailx command
c6c8a7
Name: mailx
c6c8a7
Version: 12.5
c6c8a7
Release: 19%{?dist}
c6c8a7
# MPLv1.1 .. nss.c, nsserr.c
c6c8a7
License: BSD with advertising and MPLv1.1
c6c8a7
Group: Applications/Internet
c6c8a7
URL: http://heirloom.sourceforge.net/mailx.html
c6c8a7
# Mailx's upstream provides only the CVS method of downloading source code.
c6c8a7
# Use get-upstream-tarball.sh script to download current version of mailx.
c6c8a7
Source0: mailx-%{version}.tar.xz
c6c8a7
Source1: get-upstream-tarball.sh
c6c8a7
c6c8a7
Patch0: nail-11.25-config.patch
c6c8a7
Patch1: mailx-12.3-pager.patch
c6c8a7
Patch2: mailx-12.5-lzw.patch
c6c8a7
# resolves: #805410
c6c8a7
Patch3: mailx-12.5-fname-null.patch
c6c8a7
# resolves: #857120
c6c8a7
Patch4: mailx-12.5-collect.patch
c6c8a7
# resolves: #948869
c6c8a7
Patch5: mailx-12.5-usage.patch
c6c8a7
# resolves: #1171178
c6c8a7
Patch6: mailx-12.5-outof-Introduce-expandaddr-flag.patch
c6c8a7
Patch7: mailx-12.5-unpack-Disable-option-processing-for-email-addresses.patch
c6c8a7
Patch8: mailx-12.5-fio.c-Unconditionally-require-wordexp-support.patch
c6c8a7
Patch9: mailx-12.5-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch
c6c8a7
# resolves: #1113611
c6c8a7
Patch10: mailx-12.5-empty-from.patch
c6c8a7
# resolves: #1290043
c6c8a7
Patch11: mailx-12.5-nss_check_host-fix.patch
c6c8a7
# resolves: #1147568
c6c8a7
Patch12: mailx-12.5-mailx.1-environment-variables.patch
c6c8a7
# resolves: #1147570
c6c8a7
Patch13: mailx-12.5-mailx.1-from-syntax.patch
c6c8a7
# resolves: #1474130
c6c8a7
Patch14: mailx-12.5-encsplit.patch
c6c8a7
c6c8a7
%if %{use_nss}
c6c8a7
BuildRequires: nss-devel, pkgconfig, krb5-devel
c6c8a7
%else
c6c8a7
BuildRequires: openssl-devel
c6c8a7
%endif
c6c8a7
c6c8a7
Obsoletes: nail < %{version}
c6c8a7
Provides: nail = %{version}
c6c8a7
c6c8a7
c6c8a7
%description
c6c8a7
Mailx is an enhanced mail command, which provides the functionality
c6c8a7
of the POSIX mailx command, as well as SysV mail and Berkeley Mail
c6c8a7
(from which it is derived).
c6c8a7
c6c8a7
Additionally to the POSIX features, mailx can work with Maildir/ e-mail
c6c8a7
storage format (as well as mailboxes), supports IMAP, POP3 and SMTP
c6c8a7
protocols (including over SSL) to operate with remote hosts, handles mime
c6c8a7
types and different charsets. There are a lot of other useful features,
c6c8a7
see mailx(1).
c6c8a7
c6c8a7
And as its ancient analogues, mailx can be used as a mail script language,
c6c8a7
both for sending and receiving mail.
c6c8a7
c6c8a7
Besides the "mailx" command, this package provides "mail" and "Mail"
c6c8a7
(which should be compatible with its predecessors from the mailx-8.x source),
c6c8a7
as well as "nail" (the initial name of this project).
c6c8a7
c6c8a7
c6c8a7
%prep
c6c8a7
%setup -q
c6c8a7
%patch0 -p1
c6c8a7
%patch1 -p1
c6c8a7
%patch2 -p1
c6c8a7
%patch3 -p1
c6c8a7
%patch4 -p1
c6c8a7
%patch5 -p1
c6c8a7
%patch6 -p1
c6c8a7
%patch7 -p1
c6c8a7
%patch8 -p1
c6c8a7
%patch9 -p1
c6c8a7
%patch10 -p1
c6c8a7
%patch11 -p1
c6c8a7
%patch12 -p1
c6c8a7
%patch13 -p1
c6c8a7
%patch14 -p1
c6c8a7
sed -i 's,/etc/nail.rc,%{mailrc},g' mailx.1
c6c8a7
c6c8a7
c6c8a7
%build
c6c8a7
%if %{use_nss}
c6c8a7
INCLUDES="$INCLUDES `pkg-config --cflags-only-I nss`"
c6c8a7
export INCLUDES
c6c8a7
%endif
c6c8a7
c6c8a7
echo    PREFIX=%{_prefix} \
c6c8a7
    BINDIR=/bin \
c6c8a7
    MANDIR=%{_mandir} \
c6c8a7
    SYSCONFDIR=%{_sysconfdir} \
c6c8a7
    MAILRC=%{mailrc} \
c6c8a7
    MAILSPOOL=%{_localstatedir}/mail \
c6c8a7
    SENDMAIL=%{_sbindir}/sendmail \
c6c8a7
    UCBINSTALL=install \
c6c8a7
> makeflags
c6c8a7
c6c8a7
#  %{?_smp_mflags} cannot be used here
c6c8a7
make `cat makeflags` \
c6c8a7
    CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" \
c6c8a7
    IPv6=-DHAVE_IPv6_FUNCS
c6c8a7
c6c8a7
c6c8a7
%install
c6c8a7
make DESTDIR=$RPM_BUILD_ROOT STRIP=: `cat makeflags` install
c6c8a7
c6c8a7
ln -s mailx $RPM_BUILD_ROOT/bin/mail
c6c8a7
c6c8a7
install -d $RPM_BUILD_ROOT%{_bindir}
c6c8a7
pref=`echo %{_bindir} | sed 's,/[^/]*,../,g'`
c6c8a7
c6c8a7
pushd $RPM_BUILD_ROOT%{_bindir}
c6c8a7
ln -s ${pref}bin/mailx Mail
c6c8a7
ln -s ${pref}bin/mailx nail
c6c8a7
popd
c6c8a7
c6c8a7
pushd $RPM_BUILD_ROOT%{_mandir}/man1
c6c8a7
ln -s mailx.1 mail.1
c6c8a7
ln -s mailx.1 Mail.1
c6c8a7
ln -s mailx.1 nail.1
c6c8a7
popd
c6c8a7
c6c8a7
c6c8a7
%triggerpostun -- mailx < 12
c6c8a7
[[ -f %{mailrc}.rpmnew ]] && {
c6c8a7
    # old config was changed. Merge both together.
c6c8a7
    ( echo '# The settings above was inherited from the old mailx-8.x config'
c6c8a7
      echo
c6c8a7
      cat %{mailrc}.rpmnew
c6c8a7
    ) >>%{mailrc}
c6c8a7
} || :
c6c8a7
c6c8a7
c6c8a7
%triggerpostun -- nail <= 12.3
c6c8a7
[[ -f %{_sysconfdir}/nail.rc.rpmsave ]] && {
c6c8a7
    # old config was changed...
c6c8a7
    save=%{mailrc}.rpmnew
c6c8a7
    [[ -f $save ]] && save=%{mailrc}.rpmsave
c6c8a7
c6c8a7
    mv -f %{mailrc} $save
c6c8a7
    mv -f %{_sysconfdir}/nail.rc.rpmsave %{mailrc}
c6c8a7
} || :
c6c8a7
c6c8a7
c6c8a7
%files
c6c8a7
%doc COPYING AUTHORS README
c6c8a7
%config(noreplace) %{mailrc}
c6c8a7
/bin/*
c6c8a7
%{_bindir}/*
c6c8a7
%{_mandir}/*/*
c6c8a7
c6c8a7
c6c8a7
%changelog
c6c8a7
* Wed Feb 07 2018 Nikola Forró <nforro@redhat.com> - 12.5-19
c6c8a7
- fix also quoted-printable encoded words
c6c8a7
  related: #1474130
c6c8a7
c6c8a7
* Wed Nov 22 2017 Nikola Forró <nforro@redhat.com> - 12.5-18
c6c8a7
- add missing linear whitespace to encsplit patch
c6c8a7
  related: #1474130
c6c8a7
c6c8a7
* Mon Aug 07 2017 Nikola Forró <nforro@redhat.com> - 12.5-17
c6c8a7
- fix multi-byte encoded line-folding
c6c8a7
  resolves: #1474130
c6c8a7
c6c8a7
* Fri Feb 10 2017 Nikola Forró <nforro@redhat.com> - 12.5-16
c6c8a7
- extend description of FROM syntax
c6c8a7
  resolves: #1147570
c6c8a7
c6c8a7
* Fri Feb 10 2017 Nikola Forró <nforro@redhat.com> - 12.5-15
c6c8a7
- correct information about environment variables
c6c8a7
  resolves: #1147568
c6c8a7
c6c8a7
* Tue Jan 17 2017 Nikola Forró <nforro@redhat.com> - 12.5-14
c6c8a7
- fix return value of nss_check_host()
c6c8a7
  resolves: #1290043
c6c8a7
c6c8a7
* Tue Jan 17 2017 Nikola Forró <nforro@redhat.com> - 12.5-13
c6c8a7
- fix SIGSEGV crash in smtp_auth_var()
c6c8a7
- add warning message for empty from variable
c6c8a7
  resolves: #1113611
c6c8a7
c6c8a7
* Wed Dec 10 2014 jchaloup <jchaloup@redhat.com> - 12.5-12
c6c8a7
- CVE-2004-2771 mailx: command execution flaw
c6c8a7
  resolves: #1171178
c6c8a7
c6c8a7
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 12.5-11
c6c8a7
- Mass rebuild 2014-01-24
c6c8a7
c6c8a7
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 12.5-10
c6c8a7
- Mass rebuild 2013-12-27
c6c8a7
c6c8a7
* Mon Jul 22 2013 Peter Schiffer <pschiffe@redhat.com> - 12.5-9
c6c8a7
- related: #912785
c6c8a7
  used -D_FILE_OFFSET_BITS=64 flag at the compile time
c6c8a7
- return error code when TMPDIR is set to an invalid path while sending email
c6c8a7
- added missing -v option to the usage message
c6c8a7
c6c8a7
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-8
c6c8a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c6c8a7
c6c8a7
* Mon Nov  5 2012 Peter Schiffer <pschiffe@redhat.com> - 12.5-7
c6c8a7
- cleaned .spec file
c6c8a7
- resolves: #805410
c6c8a7
  fixed SIGSEGV crash in which_protocol() function
c6c8a7
- updated get-upstream-tarball.sh script and added it as additional source
c6c8a7
c6c8a7
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-6
c6c8a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c6c8a7
c6c8a7
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-5
c6c8a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
c6c8a7
c6c8a7
* Wed Aug 17 2011 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.5-4
c6c8a7
- Fix decompress lzw issues (#731342)
c6c8a7
c6c8a7
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.5-3
c6c8a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c6c8a7
c6c8a7
* Thu Jan 27 2011 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.5-2
c6c8a7
- rebuild for new krb5-libs
c6c8a7
c6c8a7
* Tue Oct 26 2010 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.5-1
c6c8a7
- update to 12.5
c6c8a7
- drop patches applied upstream
c6c8a7
c6c8a7
* Fri Oct  1 2010 Ivana Hutarova Varekova <varekova@redhat.com> - 12.4-7
c6c8a7
- fix the typo in man-page
c6c8a7
c6c8a7
* Mon Dec 21 2009 Ivana Hutarova Varekova <varekova@redhat.com> - 12.4-6
c6c8a7
- fix source tag
c6c8a7
c6c8a7
* Fri Dec 18 2009 Ivana Hutarova Varekova <varekova@redhat.com> - 12.4-5
c6c8a7
- fix license tag
c6c8a7
c6c8a7
* Sat Dec 12 2009 Robert Scheck <robert@fedoraproject.org> - 12.4-4
c6c8a7
- Make OpenSSL support working again if NSS flag is disabled
c6c8a7
c6c8a7
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.4-3
c6c8a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c6c8a7
c6c8a7
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12.4-2
c6c8a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
c6c8a7
c6c8a7
* Mon Aug 11 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.4-1
c6c8a7
- update to 12.4
c6c8a7
c6c8a7
* Tue Jul 29 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.3-1
c6c8a7
- Place mailx to /bin/mailx, to avoid extra symlink in redhat-lsb package
c6c8a7
- /bin/mailx is now a base binary, another symlinked to it.
c6c8a7
c6c8a7
* Thu Jun 26 2008 Dmitry Butskoy <Dmitry@Butskoy.name>
c6c8a7
- add missed BR for krb5-devel
c6c8a7
- activate IPv6 support
c6c8a7
- change config to /etc/mail.rc for compatibility
c6c8a7
- add triggerpostun scriptlets against previous mailx and nail
c6c8a7
  to check and merge (when possible) their user config changes
c6c8a7
- use proper config filename in manuals
c6c8a7
- use "less" instead of non-provided "pg" for nobsdcompat mode
c6c8a7
c6c8a7
* Wed Jun 18 2008 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.3-0
c6c8a7
- Change the name from "nail" to upstream's "mailx".
c6c8a7
  Merge with the ordinary "mailx" cvs tree for Fedora 10.
c6c8a7
  Now this stuff supersedes the old ancient mailx-8.x in Fedora.
c6c8a7
- Build with nss instead of openssl, for "Security Consolidation" process.
c6c8a7
c6c8a7
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 12.3-4
c6c8a7
- Autorebuild for GCC 4.3
c6c8a7
c6c8a7
* Wed Dec 05 2007 Release Engineering <rel-eng at fedoraproject dot org> - 12.3-3
c6c8a7
 - Rebuild for deps
c6c8a7
c6c8a7
* Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 12.3-2
c6c8a7
- Rebuild for selinux ppc32 issue.
c6c8a7
c6c8a7
* Fri Aug 17 2007 Dmitry Butskoy <Dmitry@Butskoy.name>
c6c8a7
- Change License tag to "BSD with advertising"
c6c8a7
c6c8a7
* Tue Jul 24 2007 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.3-1
c6c8a7
- update to 12.3
c6c8a7
c6c8a7
* Fri Jan 12 2007 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.2-1
c6c8a7
- update to 12.2
c6c8a7
- spec file cleanups
c6c8a7
c6c8a7
* Fri Jun 16 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.1-1
c6c8a7
- update to 12.1
c6c8a7
c6c8a7
* Wed Mar 22 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.0-2
c6c8a7
- complete "mailx to nail" changes in the manual and config files
c6c8a7
- drop _smp_mflags: it caused make to work incorrectly.
c6c8a7
c6c8a7
* Tue Mar 21 2006 Dmitry Butskoy <Dmitry@Butskoy.name> - 12.0-1
c6c8a7
- upgrade to 12.0
c6c8a7
- change new upstream name "mailx" to the old name "nail" to avoid
c6c8a7
  conflicts with the Core mailx package.
c6c8a7
- drop Source1, use package's html file instead.
c6c8a7
c6c8a7
* Mon Oct 17 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-4
c6c8a7
- don't strip binaries on makeinstall (#170972)
c6c8a7
c6c8a7
* Mon Oct  3 2005 Dmitry Butskoy <Dmitry@Butskoy.name>
c6c8a7
- clear buildroot before install (Michael Schwendt)
c6c8a7
c6c8a7
* Mon Sep 26 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-3
c6c8a7
- more spec file cleanups
c6c8a7
- accepted for Fedora Extra
c6c8a7
  (review by Aurelien Bompard <gauret@free.fr>)
c6c8a7
c6c8a7
* Mon Aug 22 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-2
c6c8a7
- spec file cleanups (#166343)
c6c8a7
c6c8a7
* Fri Aug 19 2005 Dmitry Butskoy <Dmitry@Butskoy.name> - 11.25-1
c6c8a7
- initial release
c6c8a7
- add "set bsdcompat" to nail.rc as default
c6c8a7
- copy nail web page to doc
c6c8a7