Process mail using cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Process mail using cron
# 1  
Old 11-27-2004
Process mail using cron

I am looking for information on how to process mail using a cron job. The email server is a hosted ISP, so I simply have a POP connection to the mailbox.

Specifically, I want to fire a cron job at {x} time and have pine, mail, mailx, or some other suitable mail client utility process the current POP mail inbox.

Part A is my desire to automatically search for and move some log files to a specific file/folder by grepping out part of the subject line.

Part B might be solved better with some spam filtering tool, but I want to automatically delete "spam" email from the mailbox on a scheduled basis. I will be using a "friends" list to filter out any mail domain not specifically authorized to send email to this account.

So, can anyone point me in the direction of how to read / process the mail box using something like mailx in a script such that I can accomplish A & B above.

Thanks,
CM
# 2  
Old 11-27-2004
It might be easier to use an LDA (local delivery agent), like procmail. You can check to see if your ISP uses procmail and, if so, create a local .procmailrc file to accomplish your tasks.


Reference:

http://www.redhat.com/docs/manuals/l...-procmail.html
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mail Attachment Not Working for Cron

Hi All, i Have An Script Which is Fetching Data From DB And sending Mail With the Data in Excel Format. i'm Receiving Mail with Attachment when i Manually Running the script using ksh -x Scriptname or ./ Scriptname. when i try to run it through cron i'm receiving mail only but ... (7 Replies)
Discussion started by: naveen1.kumar
7 Replies

2. Shell Programming and Scripting

check mail backup cron job

i have just installed a cron job to run at 3 in the morning once a week. It's difficult for me to test if it works because the email backup program takes the email service down before running the backup. I wondered if i could ask you gurus if this would work? 0 3 * * 0 ... (1 Reply)
Discussion started by: timgolding
1 Replies

3. Shell Programming and Scripting

Cron jobs and mail

Hi, I am new to this mail concept and cran jobs,i have given with a task to send a mail for every one hour from unix to my outlook by checking some sanitry checks kindly look the below queires and help me in this 1.)How to send a mail from unix box to outlook. 2.)I assigned to check a... (4 Replies)
Discussion started by: thelakbe
4 Replies

4. Solaris

no mail after cron

Hi All, My current version is 5.10 Generic_127127-11, I'm not getting mails after cron for single os user where as for others users im getting mail after cron. i've not found any mail file in /var/mail for that particular user, and i have created a new mail file. but no luck please... (1 Reply)
Discussion started by: adeel_dba
1 Replies

5. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

6. Shell Programming and Scripting

Stopping Cron Mail to administrator

I have written a number of shell scripts which I have added to cron to run on an Apple Xserve running MAc OS Server 10.4.11. Recently I configured postfix to use one of my company's email servers as a relay so that it can send out statistics about the number of jobs my shell scripts have... (2 Replies)
Discussion started by: buzzs4w
2 Replies

7. Solaris

Mail is not sent by cron daemon

Hello All, In SunOS 10, I have some cron jobs and it is running fine but the cron job outputs are not mailing to any acount of the system. In other OS, we have option like MAILTO variable or /dev/null to disable but in Sun I have no idea how it is disabled by default and how do I... (13 Replies)
Discussion started by: Tlogine
13 Replies

8. UNIX for Dummies Questions & Answers

Problems in generating the mail from cron -- very urgent help me

Hi, I wrote a script which generates a mail automatically under certain condition. When i execute the script manually in unix the script is getting executed and the condition works accordingly and the mail is also generated. But when it is pu into cron the mail is not generated and the... (4 Replies)
Discussion started by: thiru_cs
4 Replies

9. Shell Programming and Scripting

Killing of a process and send a mail if the process doesnot come up within 2 minutes

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There is a... (1 Reply)
Discussion started by: Prince89
1 Replies
Login or Register to Ask a Question