LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2001, 08:40 PM   #1
skopje909
LQ Newbie
 
Registered: Nov 2001
Distribution: Red Hat 6.2
Posts: 17

Rep: Reputation: 0
Linux mail to Windows NT


In Linux (RedH V6.2) is there a way I can send the message log that sits in /var/spool/mail "root" file to a Windows machine as an email? Any suggestions.....
 
Old 11-09-2001, 12:58 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
/var/spool/mail/root is kinda like root's "unopened mail"box, so this can contain a lot of stuff, but basically it's text.

just execute "cat /var/spool/mail/root | mail -s "(subject)" address1@host2 address2@host3".

If you rather would daily send the /var/log/messages or any other logfile before it gets logrotated, you can set up a cronjob (maybe as a pre-logrotate script) to mail it.
Find the name of the logfile in /etc/logrotate.d,
open up the script, itll show
/var/log/<filename>{
lotsa options
lotsa options
lotsa options
}
just make it look like

/var/log/<filename>{
prerotate
cat /var/log/<filename> | mail -s "" address@host
endscript
lotsa options
lotsa options
lotsa options
}

ofcourse you can also do daily mailing without relying on logrotated, then just dump the mailscript in /etc/cron.daily...


HTH somehow
 
Old 11-12-2001, 04:10 PM   #3
skopje909
LQ Newbie
 
Registered: Nov 2001
Distribution: Red Hat 6.2
Posts: 17

Original Poster
Rep: Reputation: 0
The "cat" command works fine but I can't get it to log it daily.
The config file is /etc/logrotate.d/syslog The first couple of lines read :
/var/log/messages {
postrotate
/usr/bin/killall -HUP syslogd
endscript
}

I have changed it to :
/var/log/messages {
prerotate
cat var/log/messages | mail -s "" jadmin@myhost.com
endscript
}

Is the above correct?
Should I keep the original postrotate line and add the prerotate?
As the way I have it does not do the email

Any suggestions.....






I tried adding the following (as an example):
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configure & Connect a Linux mail server from a windows mail clients digihall7 Linux - Networking 4 10-23-2006 12:21 PM
Importing Thunderbird Mail from Windows to SuSE linux 9.3 saksham Linux - Software 2 11-08-2005 03:56 PM
Redhat Linux 9 as mail relay for Windows Network mediamvp Linux - Networking 1 02-20-2004 02:57 PM
windows clients not being able to send mail through linux server kpg Linux - Networking 3 02-12-2004 01:35 PM
Moving Mozilla mail from Windows to Linux jasonfarbman Linux - Software 2 01-14-2004 12:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration