- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Send mails via sendmail out from application
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 10:25 PM
тАО11-24-2003 10:25 PM
we want to send out mails from an application.
Therefor the application create a tmp.-file
which contain all necessary information (e.g):
->>>> top of file
MAIL FROM: x.y@domain.com
RCPT TO: z.y@Ndomain.com
DATA
TO: x y
From: z y
Date: Fri, 08 Aug 2003 20:57:47 +0001
Subject: Testmail
Nachrichtentext
.
<<<<----end of file
We used the following command:
cat tmp-file | sendmail -bs -fit-operations@domain.com
What can I say, IT WORKS! BUT sendmail write out the following messages:
220 norskehp. ESMTP Sendmail 8.9.3 (PHNE_24419)/8.7.1; Tue, 25 Nov)
250 x.y@domain.com... Sender ok
250 y.z@domain.com... Recipient ok
354 Enter mail, end with "." on a line by itself
250 MAA05087 Message accepted for delivery
503 Need MAIL before RCPT
503 Need MAIL command
500 Command unrecognized: "TO: x y
500 Command unrecognized: "From: y z
500 Command unrecognized: "Date: Fri, 08 Aug 2003 20:57:47 +0001"
500 Command unrecognized: "Subject: Testmail"
500 Command unrecognized: "Nachrichtentext"
500 Command unrecognized: "."
Any suggestions from the smart guys??
Regards,
-Andraes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2003 10:45 PM
тАО11-24-2003 10:45 PM
Re: Send mails via sendmail out from application
Change your tmp file so it only contains the text of the message (don't need the closing dot either), and then use mailx to send the message. eg.
/usr/bin/mailx -s "Subject" x.y@domain.com < tmp-file
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2003 12:01 AM
тАО11-25-2003 12:01 AM
Re: Send mails via sendmail out from application
It seems it sends the lines after DATA to sendmail outside the data block, even though it should work the way you use it. So I would make sure if the text "Nachrichtentext" is indeed in the mail you receive...
Graham's solution is a lot nicer, and more generic. The only limit is that your from address is the address of the user sending the mail, not the address you want to specify.
Another thing you could try BTW:
cat tmpfile | telnet 0 25
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2003 12:06 AM
тАО11-25-2003 12:06 AM
Re: Send mails via sendmail out from application
thanks for your ideas. But two weak points:
1. mailx uses the sender of the processuser
2. cat tmpfile | telnet 0 25 also produces the same error messages
Regards,
-Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2003 12:16 AM
тАО11-25-2003 12:16 AM
SolutionThen call it the following way:
cat tmpfile | sendmail -fx.y@domain.com z.y@domain.com
I have tried, and this works for me, so it should work for you too... You can even add a -F'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2003 12:22 AM
тАО11-25-2003 12:22 AM
Re: Send mails via sendmail out from application
- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2003 12:31 AM
тАО11-25-2003 12:31 AM
Re: Send mails via sendmail out from application
ELMARS HINT HITS!
Thanks to you all and have a nice day.
Regards,
-Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-25-2003 12:46 AM
тАО11-25-2003 12:46 AM
Re: Send mails via sendmail out from application
we found the absolute solution:
cat neu.txt | /usr/sbin/sendmail -t
Then sendmail read also the SMTP tags.
Regards,
-Andreas