Once again hello Viktor,
Steffen Nurpmeso <[email protected]> wrote:
|SZÉPE Viktor <[email protected]> wrote:
||Idézem/Quoting Steffen Nurpmeso <[email protected]>:
||> 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.
If you ever plan to feed into this $RECIPIENT unknown data you
should really use the -. option to terminate S-nail option
processing. This is why i advise against -Sexpandargv, too, you
should use *mta-arguments* in order to prevent option injection
attacks also to the MTA, i do not know what $RECIPIENT is. E.g.
$ </dev/null s-nail -:/ -d -Ssendwait -s '[cse] ..' \
-S mta-arguments="-f bla" -. hey@you
s-nail: Setting up PseudoRandomNumberGenerator: *SSL RAND_*
s-nail: >>> MTA: /usr/sbin/sendmail, arguments: sendmail -i -f bla -- hey@you
s-nail: >>> Date: Mon, 22 Jan 2018 22:51:54 +0100
s-nail: >>> To: hey@you
s-nail: >>> Subject: [cse] ..
s-nail: >>> User-Agent: s-nail v14.9.6-40-gdd750017
s-nail: >>>
s-nail: memreset: freed 15 chunks/24130 bytes
Ciao, Viktor.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)