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.
|> In monitoring/init-alert/debian/init-alert.init there is
|>
|>| s-nail -s "Host is BOOTED: $(hostname -f)" ${INIT_ALERT_MAIL}; then
|> # Wait for message delivery
|> sleep 5
|> return 0
|>
|> and the same a few lines below for halting. If that sleep is
|> meant for s-nail rather than the underlaying MTA? Then you could
|> remove it by simply using "s-nail -Ssendwait", in which case we
|> would wait for the exit of the MTA.
|
|Hallo Steffen!
|
|Very nice to read your suggestions!!
My pleasure.
|That sleep 5 is in my own init-alert Debian package.
|At halt-time we need to delivery the shutdown alert email so we need
|to delay the whole shutdown procedure to give MTA the chance to
|delivery the message remotely.
|So it goes like s-nail -> courier sendmail binary (not SMTP!) -> MTA
|queue -> SMTP/recipient's mail server
Ah, ok.
|What does 'sendwait' do in case of /sbin/sendmail? Does it work only
|when mta=smtp://... ?
It does not matter which MTA is used, it always waits until that
program (may it be s-nail itself) returns.
|> 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
|>
|> s-nail -ESfrom="${DAEMON}@${HOSTNAME}" -s"domain expiry alert" root
|> or even
|> s-nail -Er "${DAEMON}@${HOSTNAME}" -s"domain expiry alert" root
|
|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.
It is because of the <root>, this is not a valid domain. If
$DAEMON is an address by itself, how about "root <$DAEMON>" or so?
|Does -r also set the MAIL FROM: address?
Yes. It sets *from*, but that can be overwritten in addition,
too.
|> 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?
Yep.
|OK. I add -S expandargv and -S sendwait
|Thanks.
|
|All the best to you!
All in return.
Good night!
--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)