[REBOL] Re: send/header command fails
From: compkarori:gmai:l at: 25-Aug-2009 12:04
Ben
Try this .. in prot-esmtp.r replace the existing insert function with
this one so that you can set the from header to
{web server <someone-rebol.com>}
insert: func [
"INSERT called on port"
port "Opened port"
data
] [
if string? data/1 [
use [ e ][
either parse/all data/1 [ thru "<" copy e to ">" to end ][
if error? try [ data/1: to-email e ][
net-error "ESMTP: invalid from address"
]
][ net-error "ESMTP: invalid from address" ]
]
]
if not all [
block? :data
parse data [email! into [some email!] string!]
][net-error "ESMTP: Invalid command"]
confirm-command port ["MAIL FROM: <" data/1 ">"]
foreach addr data/2 [
confirm-command port ["RCPT TO: <" addr ">"]
]
net-utils/confirm port/sub-port data-check
system/words/insert port/sub-port replace/all copy data/3 "^/." "^/.."
system/words/insert port/sub-port "."
net-utils/confirm port/sub-port write-check
]
On Sat, Aug 22, 2009 at 4:25 AM, Ben Brannen<ben.brannen-gmail.com> wrote:
> Thanks everyone for the help. Several replies helped me out.
>
> * trace/net on function so I could see whats going on. =A0Thanks Graham
> * and the comment by Gabriele...
> ...SEND assumes...that the From field in the header is of type
> email!....Thank you. I was able to work around this.
>
> I'll also look into the mezz function if I get time. =A0Thanks for the code T
> im.
>
> -ben
>
> On Thu, Aug 20, 2009 at 4:23 PM, Gabriele
> Santilli<santilli.gabriele-gmail.com> wrote:
>>
>> On Thu, Aug 20, 2009 at 5:38 PM, Ben Brannen<ben.brannen-gmail.com> wrote
> :
>>
>>> sorry .... forgot to answer the original question:
>>> whats the difference with trace/net on?
>>> (series of 'xx' replace private data)
>>
>> SEND assumes, perhaps incorrectly, that the From field in the header
>> is of type email!.
>>
>> You could change system/user/name and system/user/email instead to get
>> a better From line in your message.
>>
>> Regards,
>> =A0 =A0Gabriele.
>> --
>> To unsubscribe from the list, just send an email to
>> lists at rebol.com with unsubscribe as the subject.
>>
>>
--
Graham Chiu
http://www.synapsedirect.com
Synapse - the use from anywhere EMR.