sending mail through sendmail
Hi all...
I have to send mail from my linux machine to our company email server..I am planing to configure a sendmail server for that locally in my machine... I have to write a script that should run a cron job once in 10 minutes that will check for particular keyword in /var/log/message file and send email to my office email id... How can i best accomplish...Any suggestions....Pls Awaiting for positive replys... Any help will be appreciated... Thanks in advance..... |
Quote:
I think a better option would be a script that tails the message log and emails you when it finds and instance of the keyword?? better still there are apps that can do this for you. once called swatch and logging software called syslog-ng - which replaces the normal syslog software |
It's not necessary to confige a sendmail to send mail to company email server.There are some script which can send mail by SMTP server.I can give you some example about send mail script .but you need to writing the script to "check for particular keyword in /var/log/message file"
Code:
#!/usr/bin/perl -w |
|
Quote:
I am trying with this...but i am getting following error Can't locate Net/SMTP_auth.pm in @INC... Can you pls tell me whats the module i need to install for smtp to work... |
oh.sorry about that .I forgot I had installed the module .the module is "Net-SMTP_auth-0.08.tar.gz".may be you can download from some sites .
|
Quote:
Code:
#!/usr/bin/perl -w Code:
nmap localhost |
I telnet the vinay.linux.com 25 port it's not open .maybe the mailserver is your private mailserver.anyway ,you need to test the vinay.linux.com domain can send mail.you may be send a mail by the normal client ,like outlook. to test the vinay.linux.com is fine.
and maybe the Code:
$smtp = Net::SMTP->new('linux.com',Hello =>'linux.com'); |
Are you trying to recv mail on localhost or your eth0 IP?
By default at install, sendmail only listens on localhost (127.0.0.1). http://www.linuxtopia.org/online_boo...l-mta-sendmail |
All times are GMT -5. The time now is 09:50 AM. |