LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cant to pipe attachment to sendmail using headers (https://www.linuxquestions.org/questions/linux-newbie-8/cant-to-pipe-attachment-to-sendmail-using-headers-706076/)

bradsburgers 02-19-2009 11:02 PM

cant to pipe attachment to sendmail using headers
 
Hi

I am having troubles with sendmail, whereby i cant pipe my attachment to the email i am sending.

here is the command i am using; where filename is attachment and tempfile is the file that contains the header information.

uuencode /tmp/$filename /tmp/$filename | sendmail -t < /tmp/$tempfile

i am using sendmail as i need to mask the sender address.

any help is appreciated

regards brad

Udi 02-21-2009 12:03 PM

You are piping with a "|" and redirecting input from a file with a "<" at the same time... Your 'sendmail' program can't get its input from 2 sources.

A pipe should be enough, like in the following example:
base64 $filename | sendmail -i recipient@address.com

More generally, a pipe is used when you want the output of one program to go in as input to the second program, and input redirection from files (with "<") only works when you have a real file on the disk with the pre-made input for the program.


All times are GMT -5. The time now is 02:58 PM.