sendmail on CentOS 5.3

12 views
Skip to first unread message

farewelldave

unread,
Aug 11, 2009, 9:16:44 AM8/11/09
to vmsbackup
Hello all,

First off, this script is one of many I've been trying. I actually
ended up writing my own that worked for a while, and email
notification was something I was really interested regarding this
script.

Host is running CentOS 5.3 w/ VMware Server 2.0.1 - background
snapshots disabled. Script version is 3.12a

I've got the sendmail path as /usr/sbin/sendmail and the notifications
do get sent, but I get them about 8-10 hours after the backup, and the
email is completely blank - i.e., no subject, no header.

What am I doing wrong? Should I use something else besides sendmail on
CentOS 5.3?

Thanks,

David

10nico

unread,
Aug 11, 2009, 10:52:18 AM8/11/09
to vmsbackup
Hello David, the problem is quite simple.

You've configured the script to use the sendmail program, but my
script uses the sendEmail executable (note the capital "E" in the
name), which is a completely different thing.

sendEmail (with the capital 'E') is a perl script which is used to
send email from a command line interface, for example from a bash
script.

You can get the script from the developer's home page:

http://caspian.dotconf.net/menu/Software/SendEmail/

I usually use the binary generic version and download it in /usr/local/
src
http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.tar.gz

Then I decompress it with this command:

tar -zxvf sendEmail-v1.55.tar.gz

Then I copy the "sendEmail" executable from /usr/local/src/sendEmail-
v1.55 to /usr/bin/sendEmail
cp /usr/local/src/sendEmail-v1.55/sendEmail /usr/bin/sendEmail

To verify if it works, you can simply type "sendEmail" at the console
and you should get the program's usage instructions.

If you get to this point then you only have to put the right path in
the backup_vmware script, which is done by setting the SENDEMAIL
variable.
The right setting, if you put the sendEmail executable into /usr/bin,
is:

SENDEMAIL="/usr/bin/sendEmail"

Please let me know if you have further problems!

Good evening,

Michele

Par_Tojkander

unread,
Aug 12, 2009, 3:00:12 AM8/12/09
to vmsbackup
I think an improvement would be to let the user define how the mail
should be sent. For instance, I have local network mail setup at home,
so I'd prefer to use the regular 'mail' program to send the logs.

Something like this, if you want to use sendEmail:

MAIL_CMD="/usr/sbin/sendEmail f \"$EMAILFROM\" -t \"$EMAILTO\" -u
\"$EMAILSUB\" -m \"$EMAILBODY\" -s \"$EMAILSRV\" -a \"$TEMPLOG\""

...or like this, if you want to use mail:

MAIL_CMD="echo -e \"${EMAILBODY}\n\n${TEMPLOG}\" | mail \"$EMAILTO
\" -s $EMAILSUB"

What do you think?

Pär

On 11 Aug, 16:52, 10nico <gcanavra...@yahoo.it> wrote:
> Hello David, the problem is quite simple.
>
> You've configured the script to use the sendmail program, but my
> script uses the sendEmail executable (note the capital "E" in the
> name), which is a completely different thing.
>
> sendEmail (with the capital 'E') is a perl script which is used to
> send email from a command line interface, for example from a bash
> script.
>
> You can get the script from the developer's home page:
>
> http://caspian.dotconf.net/menu/Software/SendEmail/
>
> I usually use the binary generic version and download it in /usr/local/
> srchttp://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.ta...
> > David- Dölj citerad text -
>
> - Visa citerad text -

10nico

unread,
Aug 12, 2009, 4:05:21 AM8/12/09
to vmsbackup
Why not?
We could add an in-script variable (something like MAILER="something")
that allows to chose the mailer program to be used.
Then we can put an "if then" clause around the part that actually
sends the e-mail and chose the method to send the mail.

if [ "$MAILER" == "sendEmail" ]; then
# send the email with sendEmail
elif [ "$MAILER" == "mail" ]; then
# send the email with mail
elif [ "$MAILER" == "sendmail" ]; then
# send the email with sendmail
elif [ "$MAILER" == "none" ]; then
# don't send any mail
etc etc etc

fi

Yes I know, I should use "case"...;-)

This way we can also disable the mailing part, in case one doesn't
need it.

Regards,

Michele

Par_Tojkander

unread,
Aug 12, 2009, 4:57:08 AM8/12/09
to vmsbackup
Good suggestion! I'll create an issue concerning this.


Pär

Par_Tojkander

unread,
Aug 12, 2009, 7:03:57 AM8/12/09
to vmsbackup
This is now issue #20.

http://code.google.com/p/vmsbackup/issues/detail?id=20#c0


Pär
> > Michele- Dölj citerad text -

farewelldave

unread,
Aug 12, 2009, 9:48:56 AM8/12/09
to vmsbackup
Doh! I've gotten used to seeing sendmail everywhere, my eye translated
that without the capital 'E'.

The sendEmail program works like a charm, Michele.

Thanks so much, and I like the idea of the mail variable as well.

-Dave

On Aug 11, 9:52 am, 10nico <gcanavra...@yahoo.it> wrote:
> Hello David, the problem is quite simple.
>
> You've configured the script to use the sendmail program, but my
> script uses the sendEmail executable (note the capital "E" in the
> name), which is a completely different thing.
>
> sendEmail (with the capital 'E') is a perl script which is used to
> send email from a command line interface, for example from a bash
> script.
>
> You can get the script from the developer's home page:
>
> http://caspian.dotconf.net/menu/Software/SendEmail/
>
> I usually use the binary generic version and download it in /usr/local/
> srchttp://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.ta...

10nico

unread,
Aug 12, 2009, 10:27:12 AM8/12/09
to vmsbackup
I'm glad it now works of for you :-)

Good evening,

Michele
Reply all
Reply to author
Forward
0 new messages