Re: use mailx instead of sendmail in apt-listchanges

2019-06-05 Thread Martin T
Dan,

> You could do the wrapper, or you could install nullmailer, which
> is an extremely simple MTA that always hands off mail to a
> relayhost (i.e. somebody else's problem).

I ended up with a following wrapper:

$ cat /usr/sbin/sendmail
#!/usr/bin/env bash

# As header fields are at the top of the message, then following substitutions
# should work reliably.
sed '0,/^Subject: =?utf-8?q?apt-listchanges=3A_changelogs_for_vps?=$/
s//Subject: apt-listchanges: changelogs for vps/' | \
sed '0,/^From: root$/ s//From: nore...@example.com (VPS)/' | \
recode -f /qp | \
/usr/bin/mailx -t
$


Andrew,

I guess it works for you because bsd-mailx depends on virtual packet
mail-transport-agent.


regards,
Martin



Re: use mailx instead of sendmail in apt-listchanges

2019-06-03 Thread Andrew McGlashan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi,

On 3/6/19 5:40 am, Martin T wrote:
> What could be the most elegant workaround in this situation? Create
> a /usr/sbin/sendmail wrapper script which processes the 
> "/usr/sbin/sendmail -oi -t" command called by apt_listchanges.py
> and sends the mail using mailx? Modify the apt_listchanges.py?
> Something else?

This is what I use on Devuan (and Debian previously):

# aptitude show bsd-mailx;echo;dpkg -L bsd-mailx;ls -lart
/etc/alternatives/mailx
Tue  4 Jun 04:27:41 AEST 2019 -- show bsd-mailx
Package: bsd-mailx
Version: 8.1.2-0.20160123cvs-4
State: installed
Automatically installed: no
Priority: optional
Section: mail
Maintainer: Robert Luberda 
Architecture: amd64
Uncompressed Size: 169 k
Depends: base-files (>= 2.2.0), default-mta | mail-transport-agent,
libbsd0 (>= 0.2.0), libc6 (>= 2.17), liblockfile1 (>= 1.0)
Provides: mail-reader, mailx
Description: simple mail user agent

Tags: implemented-in::c, interface::commandline, mail::smtp,
mail::user-agent, network::client, protocol::smtp, role::program,
suite::bsd, works-with::mail


/.
/etc
/etc/mail.rc
/usr
/usr/bin
/usr/bin/bsd-mailx
/usr/share
/usr/share/bsd-mailx
/usr/share/bsd-mailx/mail.help
/usr/share/bsd-mailx/mail.tildehelp
/usr/share/doc
/usr/share/doc/bsd-mailx
/usr/share/doc/bsd-mailx/NEWS.Debian.gz
/usr/share/doc/bsd-mailx/README.Debian.gz
/usr/share/doc/bsd-mailx/changelog.Debian.gz
/usr/share/doc/bsd-mailx/changelog.gz
/usr/share/doc/bsd-mailx/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/bsd-mailx.1.gz
lrwxrwxrwx 1 root root 18 May 15 10:52 /etc/alternatives/mailx ->
/usr/bin/bsd-mailx


Cheers
AndrewM
-BEGIN PGP SIGNATURE-

iHUEAREIAB0WIQTJAoMHtC6YydLfjUOoFmvLt+/i+wUCXPVnCwAKCRCoFmvLt+/i
+5WiAP95KtncIG+nJcrLpweSq47/iSUsJRBws37hlWXPABcgEQD/QljjehIDKdmj
NNQ1AyTcUX5A6kdWmPMTyuTEwv0kNBQ=
=AVBN
-END PGP SIGNATURE-



Re: use mailx instead of sendmail in apt-listchanges

2019-06-03 Thread Dan Ritter
Martin T wrote: 
> Hi,
> 
> I have apt-listchanges installed and registered in apt system:
> 
> # apt-config dump | grep apt-listchanges
> DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -lt 10";
> DPkg::Tools::Options::/usr/bin/apt-listchanges "";
> DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
> DPkg::Tools::Options::/usr/bin/apt-listchanges::InfoFD "20";
> #
> 
> "frontend" in /etc/apt/listchanges.conf is set to "mail" and valid
> e-mail address is set with "email_address" configuration option. Now
> when I upgrade a package which has NEWS/changelog present, then I get
> the "apt-listchanges: The mail frontend needs an installed 'sendmail',
> using pager" error message. This is because I don't have
> /usr/sbin/sendmail binary installed. I prefer to use mail/mailx and an
> external MTA.
> 
> What could be the most elegant workaround in this situation? Create a
> /usr/sbin/sendmail wrapper script which processes the
> "/usr/sbin/sendmail -oi -t" command called by apt_listchanges.py and
> sends the mail using mailx? Modify the apt_listchanges.py? Something
> else?

You could do the wrapper, or you could install nullmailer, which
is an extremely simple MTA that always hands off mail to a
relayhost (i.e. somebody else's problem).

Modifying apt_listchanges.py would require you to keep
maintaining the changes forever.

-dsr-