I'm putting together a script that will search my mail archives for emails that meet certain criteria and output the files to a text file.
I can manually cat that text file and pipe it into sendmail and it will work (i.e. cat /pathtofile/foo.txt | sendmail -t
me@company.com)
My script sends a list of the files to a text file and is suppost to read the filename on each line and email it to me but all im getting is a text blank emails so it doesn't appear to be reading lines correctly.
(i.e. cat /tmp/foo.txt | while read i; echo "$i" | sendmail -t
me@company.com)
I don't know if it makes a diffrence but the text file lines are automatically formatted like this:
./1312288621.V804I59c1aaa3M731667.sam.company.local:To: "My Name" <me@company.com>,
./1312289223.V804I59c1aad4M503269.sam.company.local:To: "My Name" <me@company.com>
The only parts that of the file that are needed are:
1312288621.V804I59c1aaa3M731667.sam.company.local
1312289223.V804I59c1aad4M503269.sam.company.local