Discussion Locked

Sendmail - direct from application

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Red Hat 6.2 Server, running sendmail, Win9x workstations using Server as SAMBA file server, and mail..
A particular Dos based program has the ability to send emails (text to a file) which can be formatted as required, but I am having trouble in setting up the file format.. just testing with sendmail it appears that all emails are sent as 2 files, 1 the header, the second is the body.
Yet the dos program just sends one file, header at top and following is the body.
Can manage to get header details OK, but if I try to include body to message sendmail then has errors, basically if a blank line is detected it errors, I've tried to read the email protocol but haven't managed to understand and implement the seperation of header to body...

Any help please....

6 replies

by kent.manley

I think the format is headers, blank line, then the body of the message.

Does this cause sendmail errors? Try creating a message using your DOS program, then rather than trying to send it directly to sendmail, ftp it over to your account on the sendmail server. then run sendmail yourusername < testfile and see what the result is. An alternative is to cat testfile | sendmail yourusername.

See if you get error messages, and if so, what they are. There may be settings in sendmail you mayhave to modify so it understands the format of the mail incoming from the DOS program.

Hope this helps.

Kent

by gcwoods

Not using a command line, the program generates a file which I then copy to the sendmail message folder to be processed, the file contents as follows..

Return-Path: staff@someone.com
From: staff@someone.com
To: abc@someone.com
Subject: ABC 011710
MESSAGE

ZZZ COMPANY P.O. BOX XYZ SOMEWHERE
PHONE: 07-40456669 FAX: 07-4034956769 EMAIL: abc@someone.com

**** NEW BOOKING REQUEST *****

TO:
FAX NO: 02 93512381(10) PHONE NO: 02 93456234
ATTENTION: Reservations TODAYS DATE: 02/28/2001
***************************************************************************

Please confirm the following reservation at our contract nett rate.

NAME:ABC REF NO: ABC 011710

by william shipway

Try using a command like mailx or mail to send the files. For example this might work:

% mailx -t < textfile

If you have the 'man' pages installed, use those to find out more.

Sendmail expects files in its spool directory to be in two parts, one the header in a particular format, and the other the body of the message. Unless you have a way of splitting the file up, you will have a hard time of it.

http://www.sendmail.org/ is the place to find out more about sendmail.

This discussion is closed to new replies.