Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Local scan file descriptor

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


crodster2k at yahoo

Oct 24, 2005, 8:48 AM

Post #1 of 2 (137 views)
Permalink
Local scan file descriptor

In exim's online documentation for the local scan API
section 41.2 it says:

extern int local_scan(int fd, uschar **return_text);

The arguments are as follows:

*fd is a file descriptor for the file that
contains the body of the message (the -D file). The
file is open for reading and writing, but updating it
is not recommended. Warning: You must not close this
file descriptor.

Why is updating the file not recommended? Will there
be any problem if the file is updated?

Here's my reason for asking. I am building an e-mail
application. The application will receive an incoming
e-mail message and then immediately send a response
back to the sender. The incoming message does not
need to be kept or delivered anywhere once the
outgoing message has been created for sending.

My thought was instead of constructing a new outgoing
message is to modify the body of the incoming message,
and re-write the delivery address to be the original
senders. The From address would also be modified to
be the applications instead of the original senders.
Once this is done of course Exim will start at the
beginning routing this message and deliver it back to
the original sender with the new message.

It this possible? Is this the best way to accomplish
my goal? If not could you suggest a better way to do
it?

Thanks in advance for your help and feedback.
Rob



__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


ph10 at cus

Oct 31, 2005, 3:44 AM

Post #2 of 2 (136 views)
Permalink
Re: Local scan file descriptor [In reply to]

On Mon, 24 Oct 2005, Rob Butler wrote:

> In exim's online documentation for the local scan API
> section 41.2 it says:
>
> extern int local_scan(int fd, uschar **return_text);
>
> The arguments are as follows:
>
> *fd is a file descriptor for the file that
> contains the body of the message (the -D file). The
> file is open for reading and writing, but updating it
> is not recommended. Warning: You must not close this
> file descriptor.
>
> Why is updating the file not recommended?

Because you have to update it in place. If the host or process dies,
you'll end up with a scrambled file. (Mind you, since the message has
not been completely received, perhaps that won't matter.)

Also, this just feels "dodgy".

> Will there be any problem if the file is updated?

Values such as $message_size and $message_linecount may be incorrect.

> It this possible? Is this the best way to accomplish
> my goal? If not could you suggest a better way to do
> it?

It would be more straightforward to pipe the incoming message to an
application that then generated a suitable reply.

Further more, with your approach you will be copying all the old message
header lines instead of making new ones (Date:, Message-ID: etc). This
just doesn't seem right.

--
Philip Hazel University of Cambridge Computing Service,
ph10 [at] cus Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book: http://www.uit.co.uk/exim-book

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.