Find the answer to your Linux question:
Results 1 to 6 of 6
Hi guys, I have qmail installed and the emails are coming to the maildir/new i think with random names. I want to be able to check for new mail, cut ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2

    Bash scripting for newbie

    Hi guys,
    I have qmail installed and the emails are coming to the maildir/new i think with random names. I want to be able to check for new mail, cut it, take a exact contents and then mail this content to another email or send it though sms to a specific phone number. I know how to do almost everything except how to make the loop to check for new emails and after finish working with the email to delete it.
    Can you please point me to some documentation or give me a simple example.

    Thank you very very much!!

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    what about?
    LOOP:
    check if files exist?
    do stuff
    Destory File
    Time Wait 3 Seconds (To not Throttle CPU)
    : DO

    I cant give you this in Bash though I can in Perl or C++
    New Users, please read this..
    Google first, then ask..

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2
    Hi
    what file? i dont know the names of the files as they come randomly. thats the main point i dont know how to create script(loop) to check for new files in this directory as they come randomly and what if three emails come together in the same time?

  4. #4
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Check if there is a file..
    record the name of the file.
    Remove that file afterwards
    then he sees the second one.
    and if you dont know the name use a wildcard in the search
    New Users, please read this..
    Google first, then ask..

  5. #5
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Isn't this what procmail is made for?

  6. #6
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Can be I dont know
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...