/usr/sbin/mini_sendmail
Printable View
/usr/sbin/mini_sendmail
сделайте скрипт на баше, который назовите mail или еще как, который будет брать из параметров -s<...> и выставлять в текст вида Subject: <...>
конкретно я для cron нарисовал скриптик
его запихать в каталог \opt\etc\cron.5mins\Code:#!/bin/sh
# Simple SHELL script for Linux and UNIX system monitoring
HOST="192.168.0.254"
SERVICES="thttpd lighttpd cron proftpd"
# email report when
SUBJECT="Service is down"
EMAILID="naves@random-domain.net"
for myService in $SERVICES
do
echo testing $myService
count=$(pidof $myService)
echo count=$count
if [ "$count" -eq 0 ]; then
# Service failed
echo "$HOST : $myService is down at $(date)"
#echo "$HOST : $myService is down at $(date)" | sendmail -s "$SUBJECT" $EMAILID
case "$myService" in
"thttpd")
echo "trying to start thttpd..."
/opt/etc/init.d/S80thttpd start
;;
"lighttpd")
echo "trying to start lighttpd..."
/opt/etc/init.d/S80lighttpd start
;;
"proftpd")
echo "trying to start proftpd..."
/opt/sbin/proftpd
;;
*)
echo "default unknown"
;;
esac
else
echo "$HOST : $myService is OK at $(date)"
fi
done
и не спрашивайте зачем у меня в списке проверяемых сервисов сам cron :)
На d-link 320 поставил Sendmail, Lighttpd (php-fcgi, perl) Форум ExBB . Уж очень хочется чтоб пользователям пароль на почту присылался. Да и вообще, собственный почтовый сервер не помешал бы...
Вобщем жду помощи, как говориться, литр с меня ;) (или даже два) Кстати очень интересная железка получилась
в прошивке Олега есть mini_sendmail, не подойдет?
Code:[admin@router root]$ mini_sendmail --help
usage: mini_sendmail [-f<name>] [-t] [-s<server>] [-p<port>] [-T<timeout>] [-v] [address ...]
Quote:
mini_sendmail(8) mini_sendmail(8)
NAME
mini_sendmail - accept email on behalf of real sendmail
SYNOPSIS
mini_sendmail [-f<name>] [-t] [-s<server>] [-p<port>] [-T<timeout>] [-v] address ...
DESCRIPTION
With no flags, mini_sendmail reads its standard input up to an end-of-file and sends a copy of the message found there
to all of the addresses listed.
The message is sent by connecting to a local SMTP server. This means mini_sendmail can be used to send email from
inside a chroot(2) area.
-f Sets the name of the "from" person (i.e. the sender of the mail).
-t Read message for recipients. To:, Cc:, and Bcc: lines will be scanned for recipient addresses. The Bcc: line
will be deleted before transmission.
-s Specifies the SMTP server to use. Without this it uses localhost.
-p Specifies the port to use. Without this it uses 25, the standard SMTP port.
-T Specifies timeout - defaults to one minute.
-v Verbose mode - shows the conversation with the SMTP server.
SEE ALSO
sendmail(8)
AUTHOR
Copyright <A9> 1999 by Jef Poskanzer <jef@mail.acme.com>. All rights reserved.
Что-то припоминаю.... Было, задолбало. Пошло с nail вот так
в nail.rc делаешь настройки для провайдера логины, пароли, сервера pop smtpCode:$nail -A myisp -v -s "New message" lnrmn@xxx.ru < телописьма.msg
Resolving host box.xxx.ru . . . done.
Connecting to 217.xx.xx.37 . . . connected.
220 webmail.xxx.ru ESMTP
>>> HELO WL500W
250 webmail.xxx.ru
>>> MAIL FROM: <wl500w@xxx.ru>
250 2.1.0 Ok
>>> RCPT TO: <lnrmn@xxx.ru>
250 2.1.5 Ok
>>> DATA
354 End data with <CR><LF>.<CR><LF>
>>> .
250 2.0.0 Ok: queued as A539A3E19E7
>>> QUIT
221 2.0.0 Bye
так же мучился. Переставил почти всех мэйл клиентов. Запарился до усеру. Только nail поставил, он оказался последним, прописал провайдера логин пароль - и АХХХ вздохнудл от щастия!!
Посмотрел сейчас где что...
в /tmp/local/root/.mailrc
в /opt/etc/nail.rc в самом концеCode:account myisp {
set smtp=box.xxx.ru
set from=wl500w@xxx.ru
}
Вот вроде все настройки. Удачи.Code:# Hide some header fields which are uninteresting for most human readers.
ignore received in-reply-to message-id references
ignore mime-version content-transfer-encoding
shortcut MyMail pop3://wl500w@xxx.ru:110
set password-wl500w@xxx.ru:110="password"
# Only include selected header fields when forwarding messages.
fwdretain subject date from to
set smtp=box.xxx.ru
set pop=box.xxx.ru
set from="wl500w@xxx.ru"
Да... Темный лес... Все-таки раз я начал с sendmail думаю что продолжу с ним возиться до победного конца... Кто нибудь знаком с ним как говориться "на ты" ?
Куда уж проще в двух файлах мои данные заменить на свои...
box.xxx.ru - почтовик моего провайдера
wl500w@xxx.ru - адрес, который я зарегистрировал для моего роутера.
novlyanskoe.ru на твоем роутере крутится чтоль?