LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   simple linux script gone wrong (https://www.linuxquestions.org/questions/linux-newbie-8/simple-linux-script-gone-wrong-377352/)

stephen_davies 10-27-2005 05:18 AM

simple linux script gone wrong
 
Hello all,

Thank you for taking the time to read this.

my problem is I have a simple mail script which email an echo mail account which should send it back you a mailing group. I am using Suse 8.2 and my login account name is different from the account I am trying to get to recieve the email bounce back.

this is the script if you can call it one:

date '+This is an external email test on the: %D at: %H:%M'| mail -s 'test email' -r internal-support@*?!?!"?£.com echo@uk.psi.com

the linux box is set to use an Exchange 2003 standard server as a relay and the email does leave the exchange box it just never comes back.

I think my problem lays when testing the script to my email account to see the response I get, the email comes in marked in as stephend@linux.local; on behalf of internal-support@*?!?!"?£.com.

I would like to be able to get rid of this stephend.@linux.local;; on behalf... is there any sugestions ?

Thank you again for reading this thread

unSpawn 10-27-2005 06:00 AM

Maybe try this:
Code:

#!/bin/sh
subj="Test email"
body=$(date '+This is an external email test on the: %D at: %H:%M')
echo -en "Subject: ${subj}\n\n${body}\n" | /usr/sbin/sendmail -F internal-support@my.com -f internal-support@my.com echo@uk.psi.com

Since you're not root it'll have an X-Authentication-Warning header tacked on but that will only be shown if you select to show all headers which MUA's prolly don't do by default.


All times are GMT -5. The time now is 01:34 AM.