Results 1 to 10 of 10
Hello,
I've just set up CentOS 5 and Zenoss.
After adding my devices and such, I figured it was time to start the reporting system.
I want zenoss to send ...
- 11-29-2007 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
Auto prosessing mail from command line
Hello,
I've just set up CentOS 5 and Zenoss.
After adding my devices and such, I figured it was time to start the reporting system.
I want zenoss to send a mail that should be prosessed and sent through an SMS gateway.
First thing, I set up an account named sms, which now recieves the mail zenoss sends.
Then I downloaded gnokii, set it up properly, so now I can send sms from command line. Then i downloaded mail2sms which is nifty because it compresses the messages, removing headers and such, makes it a good sms format.
All of this works - Fine!
My problem is the command 'mail'. In my former monitoring solution which consisted of gentoo and nagios, the mail was delivered in files, (something like /root/.maildir/new/200711281435)
In my current system, the mail is delivered to /var/spool/mail/sms/
Can I use the mail command to parse the mail through a script, and remove it from my 'inbox'? (Thus doing mail, 1, scrolling down, ctrl+d and parsing the output to a file instead of stdout, all without a touch of a button?)
Thanks in advance,
\\makraves
- 11-29-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
Hi makraves,
Your best bet is to see if you can change the mail format of your MTA from mbox to maildir.
mbox is what you have now, one flat file, maildir is what you had before lots of files in a folder.RHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 11-29-2007 #3Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
allright, yeah. that sounds just about right:=)
But how do one accomplish such a magnificent thing?
- 11-30-2007 #4Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
Which MTA are you using ?
Probably sendmail, postfix ro eximRHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 11-30-2007 #5Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
Hello,
Thanks for reply.
I'm using sendmail, postfix is not installed.
\\makraves
- 11-30-2007 #6Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
Ok, send you slightly down the wrong path, the Delivery Agent stores the mail by default on RedHat Systems that's fetchmail which doesn't support maildir only mbox.
You can change the agent to procmail though.
Have a look at this linkRHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 11-30-2007 #7Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
A couple more RedHat links:
email
Delivery AgentsRHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 11-30-2007 #8Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
procmail
Thank you. That was very helpful.
Just installed procmail, and made a config file looking somewhat like this:
(actually it looks exactly like this....)
SHELL=/bin/bash
LINEBUF=4096
PATH=/bin:/usr/bin:/usr/local/bin
VERBOSE=off
MAILDIR=$HOME/Mail
LOGFILE=$HOME/Mail/procmaillog
FORMAIL=/usr/bin/formail
SENDMAIL=/usr/sbin/sendmail
:0:
* ^TOsms@localhost
/home/sms/Mail/smsbox/
# Added also this:
* ^TOsms@super.xxx.no
/home/sms/Mail/smsbox/
Will this make mails end up in /home/sms/Mail/smsbox ? (in file form)
I've made all the folders mentioned above (in /home/sms)
the .procmailrc is located in /home/sms/
When I try to send mail to sms@localhost, the mail is delivered in the 'normal' way, to an mbox. (/home/sms/mbox)
After procmail is installed, and .procmailrc is put in the /home/sms/ dir, is there anything else that has to be done in order for procmail to work? Do I have to start it somehow?
Sorry for posting stupid and / or ridiculous questions, I'm a bit new on manual mail prosessing and such...
\\makravesLast edited by makraves; 11-30-2007 at 02:06 PM. Reason: Rewrote .procmailrc
- 11-30-2007 #9Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
I must admit to not being a postfix config guru.
But it looks good to me...
And no you shouldn't need to do anything for procmail to workRHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 12-03-2007 #10Just Joined!
- Join Date
- Nov 2007
- Posts
- 6
Strange.
This does not work.
Could I urge someone to take just a peak at my .procmailrc in this thread?
Thanks a bunch,
\\makraves


Reply With Quote