Idézem/Quoting Steffen Nurpmeso <stef...@sdaoden.eu>:

Once again hello Viktor,

Steffen Nurpmeso <stef...@sdaoden.eu> wrote:
 |SZÉPE Viktor <vik...@szepe.net> wrote:
 ||Idézem/Quoting Steffen Nurpmeso <stef...@sdaoden.eu>:
 ||> While looking some more, i have some suggestions for possible
 ||> improvements, just in case i understand your concerns right.
 ...
 ||> Hmm, ok.  In monitoring/domain-expiry.sh ;) you say
 ||>
 ||>   s-nail -E -S from="${DAEMON} <root>" -s "domain expiry alert" root
 ||>
 ||> which should complain about an invalid address.  How about
 ...
 ||http://www.courier-mta.org/courier.html at "defaultdomain" says:
 ||
 ||> This file contains one line whose contents is a valid mail domain.
 ||> Most header rewriting functions will append @defaultdomain to all
 ||> E-mail addresses that do not specify a domain.
 ||
 ||I do not know any other MTA, I am a Courier user since the beginning.
 ||So courier rewrites addresses like this domain-less one.

Just to clarify this Viktor, the above line will likely never
succeed because S-nail will refuse accepting the given value for
*from*, since "$DAEMON <root>" is not a valid e-mail address.
You have this problem in a number of places.  You can always
perform a dry-run test of what you want if you use -d, as in

  $ </dev/null s-nail -d -S from="TEST <root>" -s ub root
  s-nail: An address given in *from* is invalid: TEST <root>
  ..more noise.

I have just pushed some changes so that in a future release the
*from* and *sender* variables will be checked upon assignment
time, and assignment will be aborted on error.

 ||Does -r also set the MAIL FROM: address?
 |
 |Yes.  It sets *from*, but that can be overwritten in addition,
 |too.

Said change will henceforth cause a program exit if such an
address is used with -r.

Likely -r should instead default to Sender:, and
*r-option-implicit* should possibly also take the things out of
*sender* first, but it could be that will not happen before v15.

  ...
 ||> In monitoring/cse/can-send-email.sh, ohwowwow!  Despite said
 ||> address errors there is:
 ||>
 ||>  s-nail -s "[cse] bounce message / Email kézbesítés monitorozás" \
 ||>         -S "from=${CSE_ADDRESS}" -- "$RECIPIENT" "-f${CSE_ADDRESS}" \
 ||>|| echo "Trigger failed ($?) for ${URL}"
 ||
 ||I've just switch to s-nail from long-time Heirloom mailx usage.
 ||As the comment says: "Hack to pass from address to sendmail"
 ||Heirloom mailx had no option to set MAIL FROM: address.
 ||Is it -r in s-nail, right?

This will never work because you send to no recipients at all,
Viktor.  It must instead be

  s-nail -Ssendwait -s '[cse] ..' -r "${CSE_ADDRESS}" -. "$RECIPIENT"

Or just modify to

  s-nail -Ssendwait -Sexpandargv -s '[cse] ..' -. "$RECIPIENT" -- \
    -f"${CSE_ADDRESS}"

which possibly will also work.

All things were so nice with heirloom-mailx. It accepted domain-less recipients, and allowed the sendmail-option hack.

Is there any way - maybe in the future - to bring back domain-less addresses?
But wait!

$ s-nail -V
v14.8.16

$ ls -la | s-nail -d -S from="TEST <root>" -s ub root
...
MTA: "/usr/sbin/sendmail", arguments: "sendmail" "-i" "--" "root"
Date: Mon, 22 Jan 2018 22:08:12 +0000
From: TEST <root>
To: root
Subject: ub
User-Agent: s-nail v14.8.16

It works. Would you like to break this feature?



SZÉPE Viktor, honlap üzemeltetés
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
--
+36-20-4242498  s...@szepe.net  skype: szepe.viktor
Budapest, III. kerület




Reply via email to