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!!
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
What does 'sendwait' do in case of /sbin/sendmail? Does it work only
when mta=smtp://... ?
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.
Does -r also set the MAIL FROM: address?
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?
OK. I add -S expandargv and -S sendwait
Thanks.
All the best to you!
SZÉPE Viktor, honlap üzemeltetés
https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
--
+36-20-4242498 [email protected] skype: szepe.viktor
Budapest, III. kerület