E-Mail saving & loading
[1/5] from: philb::upnaway::com at: 9-Jul-2002 10:16
Hi Guys,
I have a problem with my email client .... if I save an email that is addressed
to multiple users andd then reload it in using import-email the to field only
gets set with a single user.
I have isolated the code to the following
rebol []
; Make the Header
lv-hdr: make system/standard/email
[
Subject: "Subject Line"
to: [[user1--test--com][user2--test--com]]
from: [me--test--com]
date: to-idate now
Content-Type: {text/plain; charset="iso-8859-1"}
]
; Convert the email to text
lv-em-text: rejoin [net-utils/export lv-hdr "^/" "Test Message"]
; I save the email text here
print lv-em-text
; Try to import it here
lv-em: import-email lv-em-text
probe lv-em
halt
The impoorted email has only 1 entry in its to field.
Is this a bug in import-email? or net-utils/export?
It seems inconsistent that I can save the email but then cant re-load back in
with the same infomation.
Any ideas?
Cheers Phil
[2/5] from: g:santilli:tiscalinet:it at: 9-Jul-2002 12:46
Hi philb,
On Tuesday, July 09, 2002, 4:16:32 AM, you wrote:
puc> Is this a bug in import-email? or net-utils/export?
NET-UTILS/EXPORT in not smart enough to guess you are exporting an
email header, and that the block in the TO field should be treated
differently.
It renders it as:
To: [user1--test--com][user2--test--com]
while it should be:
To: [user1--test--com], [user2--test--com]
You can solve it by doing:
lv-hdr: make system/standard/email
[
Subject: "Subject Line"
to: "[user1--test--com], [user2--test--com]"
from: [me--test--com]
date: to-idate now
Content-Type: {text/plain; charset="iso-8859-1"}
]
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[3/5] from: gscottjones:mchsi at: 9-Jul-2002 7:16
From: phil
> I have a problem with my email client .... if I save an email that is
addressed
> to multiple users andd then reload it in using import-email the to field
only
> gets set with a single user.
<snip>
rest of email can be seen at:
http://www.escribe.com/internet/rebol/m23847.html
Hi, Phil,
I was checking it out when Gabriele made reference to one essential issue
and one work around:
http://www.escribe.com/internet/rebol/m23855.html
Knowing that you are working on your most-excellent REBOL email client, I
suspect that your sample script shows how you hoped to store multiple email
addresses, namely:
> lv-hdr: make system/standard/email [
> Subject: "Subject Line"
<<quoted lines omitted: 3>>
> Content-Type: {text/plain; charset="iso-8859-1"}
> ]
suggests to me that you hoped to store the multiple email addresses in a
block. In addition to Gabriele's suggestion, I can find two alternative
approaches that you can explore. One is to present the block as a string,
with a comma or semicolon separator:
...
to: "[user1--test--com], [user2--test--com]"
...
Another approach is to hack the parser. The "offending" routine can be seen
with:
probe mail-list-rules
where the mail list rule considers addresses as being separated by a comma
or semicolon:
maillist: [
mailbox (append addr-list to-email addr)
[[thru "," | thru ";"] maillist | none]
]
Appending the option of addresses as being separated by a space will "fix"
the problem.
append mail-list-rules/maillist/3/1 [| thru " "]
What I fear is that this "fix" might end up "breaking" something else. I
have no easy way to test this concern. (If it works for the purposes of
your program, then great, but warning to other users, I would hesitate
adding this to a user.r file, since it may break other scripts.)
I personally do not think that this is a bug, per se, in that the parse
rules seem to follow the standards. But as Gabriele points out, I guess the
rules could be just a bit "smarter" to accept a more REBOL way of
storing/presenting multiple addresses.
These are just my thoughts. Keep up the good-work on the email client, and
I hope that this helps.
--Scott Jones
[4/5] from: philb:upnaway at: 10-Jul-2002 1:38
Hi Gabriele/Scott,
Thanks for the suggestions .... I worked around the 'problem' by converting
the block of email addresses to a comma seperated list (As both you and Gabriele
suggested) just before I save the email, but after the email has been sent.
This has solved the problem, which was ocurring when saving an email that is
addressed to multiple recipients then sending at a later date or time.
Cheers Phil
=== Original Message ===
From: phil
> I have a problem with my email client .... if I save an email that is
addressed
> to multiple users andd then reload it in using import-email the to field
only
> gets set with a single user.
<snip>
rest of email can be seen at:
http://www.escribe.com/internet/rebol/m23847.html
Hi, Phil,
I was checking it out when Gabriele made reference to one essential issue
and one work around:
http://www.escribe.com/internet/rebol/m23855.html
Knowing that you are working on your most-excellent REBOL email client, I
suspect that your sample script shows how you hoped to store multiple email
addresses, namely:
> lv-hdr: make system/standard/email [
> Subject: "Subject Line"
<<quoted lines omitted: 3>>
> Content-Type: {text/plain; charset="iso-8859-1"}
> ]
suggests to me that you hoped to store the multiple email addresses in a
block. In addition to Gabriele's suggestion, I can find two alternative
approaches that you can explore. One is to present the block as a string,
with a comma or semicolon separator:
....
to: "[user1--test--com], [user2--test--com]"
....
Another approach is to hack the parser. The "offending" routine can be seen
with:
probe mail-list-rules
where the mail list rule considers addresses as being separated by a comma
or semicolon:
maillist: [
mailbox (append addr-list to-email addr)
[[thru "," | thru ";"] maillist | none]
]
Appending the option of addresses as being separated by a space will "fix"
the problem.
append mail-list-rules/maillist/3/1 [| thru " "]
What I fear is that this "fix" might end up "breaking" something else. I
have no easy way to test this concern. (If it works for the purposes of
your program, then great, but warning to other users, I would hesitate
adding this to a user.r file, since it may break other scripts.)
I personally do not think that this is a bug, per se, in that the parse
rules seem to follow the standards. But as Gabriele points out, I guess the
rules could be just a bit "smarter" to accept a more REBOL way of
storing/presenting multiple addresses.
These are just my thoughts. Keep up the good-work on the email client, and
I hope that this helps.
--Scott Jones
[5/5] from: philb:upnaway at: 10-Jul-2002 2:04
Hi Gabriele/Scott,
For those of you with access to the IOS developer server the latest source to
my email client is avaiable under the users/philb/email-client/source folder.
Just click on the readmail icon.
Cheers Phil
=== Original Message ===
From: phil
> I have a problem with my email client .... if I save an email that is
addressed
> to multiple users andd then reload it in using import-email the to field
only
> gets set with a single user.
<snip>
rest of email can be seen at:
http://www.escribe.com/internet/rebol/m23847.html
Hi, Phil,
I was checking it out when Gabriele made reference to one essential issue
and one work around:
http://www.escribe.com/internet/rebol/m23855.html
Knowing that you are working on your most-excellent REBOL email client, I
suspect that your sample script shows how you hoped to store multiple email
addresses, namely:
> lv-hdr: make system/standard/email [
> Subject: "Subject Line"
<<quoted lines omitted: 3>>
> Content-Type: {text/plain; charset="iso-8859-1"}
> ]
suggests to me that you hoped to store the multiple email addresses in a
block. In addition to Gabriele's suggestion, I can find two alternative
approaches that you can explore. One is to present the block as a string,
with a comma or semicolon separator:
....
to: "[user1--test--com], [user2--test--com]"
....
Another approach is to hack the parser. The "offending" routine can be seen
with:
probe mail-list-rules
where the mail list rule considers addresses as being separated by a comma
or semicolon:
maillist: [
mailbox (append addr-list to-email addr)
[[thru "," | thru ";"] maillist | none]
]
Appending the option of addresses as being separated by a space will "fix"
the problem.
append mail-list-rules/maillist/3/1 [| thru " "]
What I fear is that this "fix" might end up "breaking" something else. I
have no easy way to test this concern. (If it works for the purposes of
your program, then great, but warning to other users, I would hesitate
adding this to a user.r file, since it may break other scripts.)
I personally do not think that this is a bug, per se, in that the parse
rules seem to follow the standards. But as Gabriele points out, I guess the
rules could be just a bit "smarter" to accept a more REBOL way of
storing/presenting multiple addresses.
These are just my thoughts. Keep up the good-work on the email client, and
I hope that this helps.
--Scott Jones
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted