Re: TCPIP$SMTP_SEND_FROM_FILE, what's its future???

From: Alan Winston - SSRL Central Computing (winston_at_SSRL.SLAC.STANFORD.EDU)
Date: 09/29/04


Date: Wed, 29 Sep 2004 21:29:51 GMT

In article <415AF8CD.5060809@Flying-Disk.com>, Alan Frisbie <Usenet01REMOVE@Flying-Disk.com> writes:
>JF Mezei wrote:
>> "Keith A. Lewis" wrote:
>>
>>> The MAIL$SEND_* routines are supported and work with tcp/ip. For myself,
>>> I'll stick to those.
>
>> Those routines do not allow you to create anything else than text files, and
>> lack much more flexibility that SFF grants if you use it with privs (such as
>> specifying the from address).
>
>I wish there were some way to allow this *without* privs, perhaps
>with an identifier. I have an application at a customer's site
>which needs to send an e-mail, but with a return address pointing
>at the user's (yuck) Microsoft Exchange Server account. For
>example, VMS user FRISBIE needs to send mail with a "From:" address
>of Alan.Frisbie@Example.com. Can anyone think of an easy way to
>do this without privs?

Hoff has already given a good answer for using the send-from-file services.
But it also doesn't take any elevated privileges to connect to an SMTP server
(try telnetting to port 25 and see), and once you do that you can put in any
From: address you like.

A perl routine that handles this is Dan Sugalski's SMAIL, which you can find as
part of his nodewatch script at www.sidhe.org/vmsperl/scripts/nodewatch.zip

I use this all the time. (I have an online-requisitions program that needs to
send email on behalf of the authenticated user who's using it, so my script
ends up 'forging' the From: address. I think you probably want to forge the
Reply-to: as well.)

There's nothing magic about Perl, and you could use the same tricks in other
languages (except for an absence of socket support in DCL); this is just a
handy routine that already works.

-- Alan