DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default Using sendmail in a cron job

Greetings,

Since sendmail is running by default, I'd like to have the results of cron jobs emailed to my external email address rather than my username.

Is there any special tweaking (other than lots of coffee ) to allow this?

I've never dealt with sendmail before.
Reply With Quote
  #2   (View Single Post)  
Old 15th May 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Default

you'll need to edit /etc/aliases. Say you want to redirect all roots emails to .. here@there.com, you'd put the following in that file
Code:
root here@there.com
then run 'newaliases' to rebuild the aliases db
Reply With Quote
  #3   (View Single Post)  
Old 15th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default

Quote:
Originally Posted by corey_james View Post
you'll need to edit /etc/aliases. Say you want to redirect all roots emails to .. here@there.com, you'd put the following in that file
Code:
root here@there.com
then run 'newaliases' to rebuild the aliases db
Thanks. Any way to add a subject line and make sure the log file, say, is in the body of the email rather than an attachment?
Reply With Quote
  #4   (View Single Post)  
Old 15th May 2008
replaced replaced is offline
Real Name: Adam Hoka
New User
 
Join Date: May 2008
Posts: 8
Default

heh...
~/.forward
Reply With Quote
  #5   (View Single Post)  
Old 15th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default

Quote:
Originally Posted by erehwon View Post
Thanks. Any way to add a subject line and make sure the log file, say, is in the body of the email rather than an attachment?
Ha, well, not the best idea...but I'm lazy!
Reply With Quote
  #6   (View Single Post)  
Old 15th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default And now, domains...

Trying

Code:
mail -s "test" me@external-email.com
failed because my internal domain (on a LAN) was used as the identifying mail address, as machinename.LAN

I'm a bit confused by reading the man pages for hostname, setdomainname, myname, and so on, but I need to preserve DNS / DHCP for my machine, since behind a router.

Ah, networking...
Reply With Quote
  #7   (View Single Post)  
Old 15th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default

Quote:
Originally Posted by erehwon View Post
Trying

Code:
mail -s "test" me@external-email.com
failed because my internal domain (on a LAN) was used as the identifying mail address, as machinename.LAN

I'm a bit confused by reading the man pages for hostname, setdomainname, myname, and so on, but I need to preserve DNS / DHCP for my machine, since behind a router.

Ah, networking...
I *think* this will solve it:

All you have to do is to edit as root the file /etc/hosts and include a fictitious FQDN for your machine. For example, the machine GX300 with IP number 192.168.0.7, could have as the fictitious FQDN GX300.test.net, and be entered in the HOSTS file as follows:

Code:
192.168.0.7   GX300  GX300.test.net
Then set the host file to query files before dns.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron won't execute a perl script ivanatora FreeBSD General 4 17th August 2008 07:53 AM
cron newsyslog message starbuck FreeBSD General 2 6th August 2008 07:33 PM
Cron running but not working stukov Other BSD and UNIX/UNIX-like 26 24th July 2008 01:17 PM
Please help me automate getmail with cron cssgalactic FreeBSD General 2 9th July 2008 10:13 PM
Cronjob script does not run in cron godfrank FreeBSD General 9 30th June 2008 12:41 AM


All times are GMT. The time now is 10:47 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick