Register
It is currently Mon Sep 22, 2014 4:16 pm

mail checks safelist...


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Thu Jun 28, 2007 6:33 pm   

Joined: Thu Jun 28, 2007 5:52 pm
Posts: 1
mail checks a file called safelist which contains a list of email addresses you want to recieve. If one exists it will pass it through and mail will say " you have new mail" like it always does, but if an email is not on that safelist then it is automatically deleted and mail excludes it from displaying "you have new mail". I think this code would need to be in the users profile but I could be wrong. Has anyone already done a script like this?

example safelist (these email addresses are fake but listed as examples):
-------------------
bob@bob.net
sue@suzieq.com
tom@mot.com
-------------------

so script would display emails from the three emails listed in safelist but would delete any others so user doesnt have to read and delete them manually.

im also in process of converting an older korn script... atleast i think its a korn script to a bash version which is also put in user profile that will automatically display new emails when you logon, instead of just saying "you have new mail", but the safelist code would be very handy to weave into this so only people you know and want to read get through. Im very new to bash and unix/linux so be gentle if i typed anything or said anything wrong above. listed below is the script i believe is korn.. but not sure, once I get a good grasp on scripting maybe i will figure converting it to bash heh.

Displaying your mail at login (add script to etc/profile):
---------------------------------
# Identify mail directory
MAILDIR=$HOME/mail

# If there are mail messages
if /usr/bin/mail -e

then

# Change to your mail directory
cd $MAILDIR

# Print mail, oldest messages first
/usr/bin/mail -r

# Change back to $HOME directory
cd $HOME

else
echo "No mail right now."
fi
--------------------------------

so im wanting a bash version of this and a bash version of a safelist.. im guessing the safelist needs to be called before the script above or maybe the safelist code could be weaved into it? by the way, this would be for a none gui linux/unix os with bash. Ive been fiddling around with the new epia pico board, and thought it would be neat to add some automating scripts. its something for my dad since gui applications render him confused. he basically only types up documents and checks his email. trying to get him to say bye to msdos lol. It sounds silly but my dad actually understands command prompt stuff but gets confused with gui's.. usually its the other way around but ohwell.

sorry bout the long post, first post so felt like venting now :lol:

any examples, help, or offsite links would be appreciated. thanks in advance.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
just a heads up, im not using linux. im using OpenBSD 4.1 textbased with Bash.
but if someone could show example in linux that would help me out too.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP