[Info-vax] $ mail/subj="test" NL: smtp%"John.Doe at gmail.com" failed

Jan-Erik Soderholm jan-erik.soderholm at telia.com
Sat May 5 05:37:52 EDT 2012


Paul Sture wrote 2012-05-05 10:26:
> On Fri, 04 May 2012 16:19:33 +0200, Jan-Erik Soderholm wrote:
>
>> Some other packages supports encryption or SMPT AUTH. I use the built-in
>> SMTP support in the Python port for OpenVMS for my outgoing mails from
>> my office/hobbyist OpenVMS box.
>
> That's a good tip thank you.

My COM file to send MAIL AUTH using Python is below.
It takes two params, a receiver and a filename, the file
is MIME-encoded and attached to the mail.

-----------------------------------------------------------------
$ type util:[pymail]pymail.com
$ def mailto "''p1'"
$ def mailfile "''p2'"
$ python

#
# Import the rellevant modules.
#

from vms.rtl.lib import delete_logical, get_logical, set_logical
import smtplib
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart

#
# Fetch the two logaicals.
#

try:
   tmp1, mailto_logical, tmp2 = get_logical('MAILTO','LNM$FILE_DEV')
except:
   print "Logical MAILTO not found."
   raise

try:
   tmp1, mailfile_logical, tmp2 = get_logical('MAILFILE','LNM$FILE_DEV')
except:
   print "Logical MAILFILE not found."
   raise


#
# Set up a few variables.
# Using a fixed "sender" address here.
#

attfile  = mailfile_logical
me = "janne at jescab2.dyndns.org"
you = mailto_logical

#
# Create the body of the mail.
#

msg = MIMEMultipart()

#
# Read the datafile and attach.
#

fp = open(attfile, 'rb')
att_tmp = MIMEApplication(fp.read())
fp.close()
att_tmp.set_param('name', attfile)
msg.attach(att_tmp)

#
# Setup some header data.
#

msg['Subject'] = attfile
msg['From'] = me
msg['To'] = you

#
# Send the mail using my ISP smtp server and using the
# user/pw I have got from my ISP.
#

s = smtplib.SMTP('mailout.telia.com',25)
s.login('my_user','my_pw')
s.sendmail(me, [you], msg.as_string())
s.quit()
$
-----------------------------------------------------------------



>
> I have up until now avoided Python, but I see it being used for things
> like Dropbox, de-duplication backup systems and non-PHP* websites too.

I have been using the Python port for VMS for several years. Not becuse
it is Python per see, but becuse the large number of realy usefull
tools that are included out-of-the-box. See the list at:
http://www.vmspython.org/DownloadAndInstallationPython

I have so far used at least these modules:

pyPdf, A Pure-Python library built as a PDF toolkit
rdb, Python module for accessing a Rdb database
reportlab, Toolkit for programatically creating PDF documents
suds, Suds is a lightweight SOAP python client for consuming Web Services
xlwt, Package is for writing data and format information to Excel files.


The "installation" is realy simple. Just download two LD container
files and run a few lines at boot:

$ ld CONNECT util:[python]jfplib0004a.dsk lda1:
$ mount/system lda1: JFPLIB0004A
$ @lda1:[000000]lib_startup
$!
$ ld CONNECT util:[python]JFPPY0100A.dsk lda2:
$ mount/system lda2: JFPPY0100A
$ @lda2:[000000]python_startup

That's it.

$ python
Python 2.7.2+ (default, Oct  4 2011, 21:13:00) [DECC] on OpenVMS
Type "help", "copyright", "credits" or "license" for more information.
 >>>  [Exit]

$


>
> * Over the last few months I have seen some extremely aggressive attacks
> against Wordpress and other popular PHP solutions.
>
> Methinks it's time to look at alternatives.
>




More information about the Info-vax mailing list