sendmail subject


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sendmail subject
# 8  
Old 04-30-2007
Quote:
Originally Posted by zazzybob
Code:
echo "Subject: Testing" | cat - text | /usr/lib/sendmail -F me@here.com -t you@there.com

Cheers
ZB
Thanks dude I was also looking for something like this!!!
# 9  
Old 04-30-2007
Quote:
Originally Posted by zazzybob
Code:
echo "Subject: Testing" | cat - text | /usr/lib/sendmail -F me@here.com -t you@there.com

Cheers
ZB
Can you tell me why its this "cat - text" It didn't work without the "-" The subject was empty. Sorry I might be asking a dumb question...
# 10  
Old 04-30-2007
Sure.

The "-" is a synonym for STDIN - standard input. So what we're saying here is conCATenate STDIN (in our case, the echo command) and the "text" input file, then pipe everything through to sendmail.

e.g.
Code:
$ echo "foo" | cat - /etc/hosts
foo
192.168.0.1 host1
192.168.0.2 host2

Cheers
ZB
# 11  
Old 04-30-2007
You can also use the following syntax (tested whith ksh) :
Code:
{ echo "Subject: Testing" ; cat  text ;} | /usr/lib/sendmail -F me@here.com -t you@there.com

Jean-Pierre.
# 12  
Old 04-30-2007
Or:

Code:
sendmail -f me@here.com -t\
< <(printf "%s\n" "To: you@there.com" \
"Subject: Testing" "$(<inputfile)")


P.S. Use pipe if your shell doesn't support process substitution:

Code:
printf "%s\n" "To: you@there.com" \
"Subject: Testing" "$(<file)"\
|sendmail -f me@here.com -t

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Clarifying sendmail configuration - sendmail-client offline

Hi all, I have read about sendmail running as 2 separate process. 1 as a MSP, and the other as the real daemon or MTA. In my current configuration, the sendmail-client is disabled. Both submit.cf and sendmail.cf are left as default untouch I do not specified any mailhost... (3 Replies)
Discussion started by: javanoob
3 Replies

2. UNIX for Advanced & Expert Users

Sendmail questions, SCO 5.0.6 sendmail 8.11.0

I am running SCO 5.0.6 and using sendmail 8.11.0 and having issues with smtp authentication. When trying to send mail the following message will kick back. (reason: 530 5.7.1 Authentication required) 530 5.7.1 Authentication required Not sure what needs to be tweeked in sendmail.cf but I... (1 Reply)
Discussion started by: ziggy6
1 Replies

3. UNIX for Advanced & Expert Users

AIX - Sendmail - add hostname to subject of outgoing mail

Hello, I'm configuring sendmail on an AIX 7.1 server (bos.net.tcp.client 7.1.1.15). I've gotten sendmail to send mail through our Novell GroupWise server, so that mail from a user on the server appears to come from their GroupWise account, and replies to the email would go to their GroupWise... (0 Replies)
Discussion started by: eyebeam
0 Replies

4. AIX

Sendmail

How do I run sendmail in non-daemon mode in AIX (3 Replies)
Discussion started by: ranasarkar
3 Replies

5. Solaris

Sendmail

I have sendmail enabled in my Solaris 10 boxes. It has being flagged as an violation to unix security standard as the port 25 is listening. I want to run the sendmail to run in non-daemon mode so that the queue is processed. Please help. (0 Replies)
Discussion started by: ranasarkar
0 Replies

6. UNIX for Dummies Questions & Answers

How to set Subject in Sendmail in Crontab

Hello All, I am trying to send a file through email everyday from one of my Linux (x86_64) system. I've scheduled Sendmail in Crontab like this- 00 8 * * * /usr/sbin/sendmail name@xxx.co.uk < /home/file1.out This entry in crontab is working very fine and I am receiving file file1.out... (10 Replies)
Discussion started by: NARESH1302
10 Replies

7. Shell Programming and Scripting

Unable to populate subject field of the email while using sendmail

Hi, Can anyone kindly provide some information about how to populate the subject field of the email while using the sendmail utility ? Itried the following command line argument : echo -e "Body of the email" | /usr/lib/sendmail -f from@from.com -t to@to.com -s " Subject of the email" ... (4 Replies)
Discussion started by: sdiptanil
4 Replies

8. Red Hat

sendmail help

Dear All how the root user i.e root@localhos.localdomain can be masqueraded in sendmail i want to masquerade the above to say test@test.com Regards and thanks in advance (3 Replies)
Discussion started by: surfer24
3 Replies

9. Shell Programming and Scripting

sendmail subject to append dynamically.

Hi, I have to use sendmail from command line, and we need to append a static string in subject to a new value from file.Is there any way to do it. Thanks Shrikrishna (1 Reply)
Discussion started by: shrikrishna
1 Replies

10. UNIX for Advanced & Expert Users

sendmail

When I try to use mailx on AIX 5.2 I get the following message: "The flags you gave make no sense since you're not sending mail." The type of command sent is as follows: mailx -s "Test" -c gilstanden@hotmail.com < sendmail.pid but it just gives the message referenced previously. Do I need to... (1 Reply)
Discussion started by: gstanden
1 Replies
Login or Register to Ask a Question