The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Re: sending email with shell script
Author: dln 
Date:   25-02-07 01:39

severndigital wrote:

> --My initial thoughts were to code some telnet commands into
> the shell script but that proved useless as it's a human
> intervention process.
> I've attempted to use expect, but have not been able to get
> that to function at all.

I'm not sure why you're making this hard for yourself.

You can enable a simple localhost only mailer setup that will do what you want using sendmail_submit_enable="YES" in /etc/rc.conf. If you then tweak your sendmail config file to always send mail through your mail server (that is, a typical smarthost setup) then you're pretty much done. You just send your mail via /bin/mail or /usr/sbin/sendmail (or MailTools in perl) like on any other box. You can also configure a thinner setup without needing to run any MTA daemon at all by periodically running /usr/sbin/sendmail -q from crontab (once a day is plenty on a pure server box but may not be sufficient for what you want).

While you're at it, edit /etc/mail/aliases, run newaliases to redirect root mail so that periodic reports get sent to wherever they need to go.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 sending email with shell script   new
severndigital 19-02-07 20:34 
 Re: sending email with shell script   new
dln 25-02-07 01:39 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum