on the topic of eMails (was Re: 1st time Revolution user question)
Andre Garzia
soapdog at mac.com
Thu Jul 14 15:45:31 EDT 2005
On Jul 14, 2005, at 2:59 PM, Alcy wrote:
>
> What are my options to send and receive emails with a Revolution
> stack?
>
> Thanks
> Alcy
Hi There Alcy,
this will be a big email. I promisse I'll try to keep it small and
direct without my constant ramblings about my newtons and embedding
webservers in any appliances that plug into power sockets :-D
There are many ways one can send emails. Some are nothing but big
hacks, others are more elegant and professional tools. I will be
listing things here by memory, so I might get something wrong. In the
end of the email I'll try to sum up some URLs for your pleasure and
amusement. Let us begin talking about "what is email anyway!?"
Okay, Everyone wants to send email! but what are you calling email?
The category division I am making here is in no way academic but
you'll see my point. Let's assume that there are two kinds of email,
plain text ones and "HTML Plus Attachments" ones. What do you want to
use? The thing is, the html and/or attachment one will need to deal
with MIME Generating part, and this is not hard but it's very boring
and sometimes masoquism (hey, I can have mime boundaries inside mime
boundaries inside mime boun...)
so let us talk about solutions. I'll begin with the best one I can
remember which is:
(1) Shao Sean libEmail and libSMTP libraries. Shao Sean created
this two gems that can to lots of cool things. The libEmail will
generate an email enclosure (will not send, but generate the chunk
that is the email) with MIME, Attachments and whatever you want.
libSMTP will take care of sending the email. It works fine!
(2) My own Raw SMTP stack. I use Shao Sean works but sometimes
you stumble on the following scenario. You want to send an email, but
you don't have the senders configuration and configuring it is too
much, how do you work this out? If you can't think how this can
happen, let us think of a software that will report back falliures to
a central using eMail. Do you really need the client to enter his
email configuration, will the client like this or find this too
invasive? You just need the report. So what I did was to create a
stack that will use SMTP to talk directly to the receiver SMTP server
and deliver the email. Let us clarify: Sending an email usually works
like this, your mail program talk to your SMTP server, your SMTP
server talks to the destination SMTP server and deliver the thing. I
skipped the first part, so we don't need the client configuration. It
works fine for some cases. Some servers will make a reverse check to
see if the stack is actually a SMTP server, and if it is not, will
think that our beautifull stack is actually some spam server or relay
agent and will block the email. It depends on the server but since I
create that for uses like reporting tools and feedback, you just need
to make sure that the report email actually loves our stack.
(3) Are you on a unix environment (linux, *bsd, MacOS X)? Then
use sendmail. Sendmail is a tool bundled with all unix I know about,
and it can send email from the command line. Just wrap your email on
a nice chunk and send it using the shell() command and sendmail tool.
(4) RevMail command, this will not send the email but open the
users default email app with your email in it. It works but sometimes
feel like a not elegant solution.
(5) Are you on macos classic or macos x? AppleScript to the
rescue!!! Use applescript to send the email for you, you can script
mail.app or the terminal. It works very fine.
(6) create your own email sending tool! read the RFCs and go for
it, one learns so much by reinventing the wheel (I am serious), you
might go with one of the above solutions but in your spare time,
pursuing this solution will teach you much more about email and
sockets then you'd ever learn by simply using high level tools.
Now the reading email part... err... I never done this, I like
sending mails, not reading them :-) I can think two ways only!
(1) I do think Sarah created a libPOP library that can do POP3
reading. and I think someone on the list actually used this on a spam
filter.
(2) Let the client default app fetch the mails, parse the mbox
file. There are two standards for storing emails, mbox and maildir.
Both are easy to parse.
Most of the solutions quoted here are available thru RevOnline.
Shao Sean site moved and I don't know the new address, but it
used to be at shaosean.tk
Sarah page is: http://www.troz.net/Rev/index.html
Cheers happy mailing
andre
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list