Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Sending Gmail through Rebol

 [1/10] from: sabufrancis::rediffmail::com at: 13-Sep-2008 23:47


Hi I thought I should share this with this list. I believe that this may help some. I had spent almost two days searching for an answer and finally I got it: Yes, you can send emails from Rebol to a gmail SMTP server. This is how you do it: Install stunnel from www.stunnel.org Then make a configuration file; say smtpconfig.txt as given below ;;;;;;;;;;;;;;;;;;; ; SMTP configuration for Gmail output = SMTPgmail.log taskbar = yes cert = stunnel.pem client = yes [smtps] protocol = smtp accept = 192.168.2.25:8025 <http://192.168.2.25:8025> connect = smtp.gmail.com:587 <http://smtp.gmail.com:587> ;;;;;;;;;;;;;;;;;;; The "accept" parameter should be the local IP address of your computer. The port 8025 should be free. If it is not, use some other free port. The gmail SMTP address and the port (the "connect" parameter) should be as per the latest Google documentation for it. (They had changed it a year or so back, so don't expect that 587 also will remain constant) Now start stunnel thus:
> stunnel smtpconfig.txt
Now in Rebol give your net settings thus:
>> system/schemes/esmtp/host: "192.168.2.25" >> system/schemes/esmtp/port-id: 8025 >> system/schemes/esmtp/user: "you-gmail.com" >> system/schemes/esmtp/pass: "mypasswd"
Obviously, "you-gmail.com" and "mypasswd" will be as per your context. Now you can happily send emails using the regular Rebol "send" function. I suspect a similar strategy will be useful for other SMTP servers on which Rebol usually fails (because of incomplete/non-support of TLS, SSL) I tested this even for Google for Applications (i.e. for domains hosted on Google gmail service) and it worked. I have tested it only on the Windows platform but I think it should work similarly if not exactly the same on Linux too. (stunnel is available for Linux also) In the above configuration file; I used it only for gmail SMTP. I guess I it should also work for gmail POP. You would require to add the following (not tested) and pick up mails from 192.1682.2.25:8110 (or whatever you had configured for "accept" parameter) ;;;;;;;;;;;;;;; [spop3] accept = 192.168.2.25:8110 connect = pop.gmail.com:995 ;;;;;;;;;;;;;;;;;; One last thing; as per info gleaned from http://forum.eprompter.com/lofiversion/index.php?t307.html there are some precautions in the stunnel configuration file: a) you shouldn't add "protocl = smtp" for SMTP/SSL but you need to add it if the protocol is SMTP/TLS (Which is where I was stuck for hours before I got the solution). b) Also for POP/TLS you should add "protocol = pop3" and if it is just POP/SSL then you should remove it. phew! Cheers Regards Sabu Francis

 [2/10] from: compkarori::gmail::com at: 13-Sep-2008 21:37


Sabu If you have R/command you can send email directly without stunnel. On Sun, Sep 14, 2008 at 7:17 AM, Sabu Francis <sabufrancis-rediffmail.com> wrote:
> Hi > I thought I should share this with this list. I believe that this may > help some. I had spent almost two days searching for an answer and > finally I got it: Yes, you can send emails from Rebol to a gmail SMTP > server. This is how you do it: > > Install stunnel from www.stunnel.org
-- Graham Chiu http://www.synapsedirect.com Synapse - the use from anywhere EMR.

 [3/10] from: fergus4::bellatlantic::net at: 15-Sep-2008 21:37


Sabu, Do you have an example of how it is done with stunnel? -Alan

 [4/10] from: sabufrancis::rediffmail::com at: 17-Sep-2008 13:37


Hi Pardon for not replying earlier. For some reason, I am not receiving the replies . .. I have to check my spam folder. -> Graham I am a legal user of the Rebol SDK which has a version of Rebol/C I tried sending an email via Gmail SMTP with it but didn't work. I may have done something wrong or maybe Rebol SDK does not have the functionality or maybe I need to upgrade. I have to check into it -> Alan Stunnel is a program that runs separately from Rebol. Download it from www.stunnel.org and run it by giving the configuration file that I had noted earlier thus: stunnel smtpconfig.txt stunnel is a "two-headed" software One head points towards the Rebol program and the other head points towards Gmail. Once stunnel has fired up; the head pointing towards Rebol receives the data from Rebol's send function. It then passes the data to the other head which sends it to the Gmail SMTP server To put it more simply: Once stunnel is running fine with the correct configuration; then you don't have to make any changes to your Rebol program. Simply use the send function to send the email. Read Rebol docs to learn about the send function Regards Sabu Francis

 [5/10] from: fergus4::bellatlantic::net at: 17-Sep-2008 12:39


Sabu wrote: and run it by giving the configuration file that I had noted earlier thus: stunnel smtpconfig.txt I did not see that config file. Was it in a separate message? Thanks, Alan

 [6/10] from: compkarori::gmail::com at: 18-Sep-2008 2:14


Sabu On Wed, Sep 17, 2008 at 9:07 PM, Sabu Francis <sabufrancis-rediffmail.com> wrote:
> -> Graham > I am a legal user of the Rebol SDK which has a version of Rebol/C I > tried sending an email via Gmail SMTP with it but didn't work. I may > have done something wrong or maybe Rebol SDK does not have the > functionality or maybe I need to upgrade. I have to check into it
I modified the smtp protocol to use SSL to get this working. I posted the code a couple of years ago .. but can't lay my hands on it now. -- Graham Chiu http://www.synapsedirect.com Synapse - the use from anywhere EMR.

 [7/10] from: pwawood::gmail::com at: 18-Sep-2008 8:04


Graham Is this the posting? http://www.rebol.org/ml-display-message.r?m=rmlNLJC The link to the code in your old message seems to be broken. Regards Peter On 18 Sep 2008, at 06:28, Graham Chiu wrote:

 [8/10] from: compkarori::gmail::com at: 18-Sep-2008 2:14


Yeah and the site is down. On Thu, Sep 18, 2008 at 1:04 PM, Peter W A Wood <pwawood-gmail.com> wrote:
> Graham > Is this the posting? http://www.rebol.org/ml-display-message.r?m=rmlNLJC
<<quoted lines omitted: 28>>
> 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.

 [9/10] from: compkarori::gmail::com at: 18-Sep-2008 6:15


Ok, managed to bring up the site again. The vm remapped to a new IP address so that NAT was no longer working! Try http://compkarori.no-ip.biz:8010/Rebol_Scripts On Thu, Sep 18, 2008 at 2:37 PM, Graham Chiu <compkarori-gmail.com> wrote:
> Yeah and the site is down. > On Thu, Sep 18, 2008 at 1:04 PM, Peter W A Wood <pwawood-gmail.com> wrote:
<<quoted lines omitted: 45>>
> http://www.synapsedirect.com > Synapse - the use from anywhere EMR.
-- Graham Chiu http://www.synapsedirect.com Synapse - the use from anywhere EMR.

 [10/10] from: sabufrancis::rediffmail::com at: 18-Sep-2008 14:03


Alan The contents of smtpconfig.txt is given below. (Copy from ;;;;; Start to ;;;;; End into a text editor and save it separately as smtpconfig.txt) In my first email it was garbled because I had sent that email using HTML. Hopefully you should get the corrected one now: ;;;;;;;;;;;;;;;;;;;Start ; SMTP configuration for Gmail output = SMTPgmail.log taskbar = yes cert = stunnel.pem client = yes [smtps] protocol = smtp accept = 192.168.2.25:8025 <http://192.168.2.25:8025> connect = smtp.gmail.com:587 <http://smtp.gmail.com:587> ;;;;;;;;;;;;;;;;;;;End Regards Sabu Francis

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted