Find the answer to your Linux question:
Results 1 to 8 of 8
hey guys i was just wondering if there is a software that lets me for example if i have my linux box runing and i have a file there that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2003
    Posts
    84

    automati email request


    hey guys i was just wondering if there is a software that lets me for example if i have my linux box runing and i have a file there that i need i would just send in email having for example the name of the file in the subject and have this file sent to me directly
    i hop i can get some help

    thank you

    -Dewey

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Use sendmail for that

    Code:
    cat <yourfile> |mail -s "<your subject>" your@email
    Use man mail for more information about this command.

    Regards

    Regards

    Andutt

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Would that be the same as "mail -s subject address <file"?
    Anyway, what I really wanted to say was that you should use metamail instead. That will be able to handle any file type, not just ASCII.

  4. #4
    Just Joined!
    Join Date
    Mar 2003
    Posts
    84
    well i don't know but if i use this command will i get an email back automatecly with the file i want?????
    isn't there any configuration i should make on my server??
    thanks alot for the help guys


    -Dewey

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    mail, metamail and sendmail (the two former being front-ends for the latter one) simply send mails to the address(es) you specify. The only thing you'll need is internet access.

  6. #6
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Well i dont know what you mean with automaticly, but that command sends an email with your file included in the mail. If you want any other automatic procedure you have to make a little script or something for it... and then you can schedule it from cron if you like.


    Dolda asked..
    Would that be the same as "mail -s subject address <file"?
    It think so...is the file parsed or included as an attachment in the mail when you do mail < file?? If you do like i said the file only gets parsed in...like cat on the file in a terminal..

    Regards

    Regards

    Andutt

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Actually, if you use the mail command, it isn't included as an attachment, but the file becomes the mail message itself. That is why you should use metamail if the file contains characters outside the standard ASCII charset, since some MTAs will clear the MSB to make messages ASCII compliant, thus making binary files unusable if sent with the mail command. metamail, on the other hand, can put the file as an attachment, encoded with BASE64.

    Quote Originally Posted by andutt
    Dolda asked..
    That wasn't really a question as much as a statement. In both ways, stdin of mail will refer to a filedescriptor that passes the contents of the file. The difference is that with cat, it won't refer to the file itself, but to a pipe coming from cat, so without cat you won't have another unnecessary process running in your system. So in effect it will yield the exact same results, only with better semantics.
    Ya know, <file is interpreted by the shell, not by mail.

  8. #8
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    I think you guys are answering the wrong question, and the question he wants answered is a bit tricky. I think he wants a procmail recipe that will email him back a file if he sends a specifically formatted email message to a certain address. I don't know procmail that well, but If you read the man pages, and some documentation online I am sure you can get it down. Try something like:
    Code:
    &#58;0&#58;
    * ^To&#58; filesenderaccountname@yourdomain.com
    * Send File
    | &#40;formail -r -I"Precedence&#58; junk" \
                      -A"X-Loop&#58; your@own.mail.address" ; \
                     echo "send file here"&#41; | $SENDMAIL -t
    how you get the "your@own.mail.address" and "send file here" from the message is a mystery to me, but you get the idea. You would put this in a .procmailrc in /home/filesenderaccountname/ and have that filesenderaccountname check it's mail every x minutes using something like cron and fetchmail, or some other solution, I don't know offhand. I hope this leads you on the right track though.
    I respectfully decline the invitation to join your delusion.

Posting Permissions

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