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.
- 05-10-2003 #1Just 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
- 05-10-2003 #2Linux Engineer
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
Use sendmail for that
Use man mail for more information about this command.Code:cat <yourfile> |mail -s "<your subject>" your@email
Regards
Regards
Andutt
- 05-10-2003 #3Linux 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.
- 05-10-2003 #4Just 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
- 05-10-2003 #5Linux 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.
- 05-10-2003 #6Linux 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..
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..Would that be the same as "mail -s subject address <file"?
Regards
Regards
Andutt
- 05-11-2003 #7Linux 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.
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.
Originally Posted by andutt
Ya know, <file is interpreted by the shell, not by mail.
- 05-11-2003 #8Linux 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:
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.Code::0: * ^To: filesenderaccountname@yourdomain.com * Send File | (formail -r -I"Precedence: junk" \ -A"X-Loop: your@own.mail.address" ; \ echo "send file here") | $SENDMAIL -t
I respectfully decline the invitation to join your delusion.


Reply With Quote
