FAQ
ok so I know this is one of those "weird" requests but here me out.
So far I have an issue with a package for python called "libgmail" which is
basically a gmail interface for python to send messages remoetly.

Works ok except that the 'sendMessage' routine is bad.

This is included in the above attachment

it's used in a program called "ogss" which is an sms interface to gmail to
basically read gmail and then have a command done on a remote machine and
then spat out on the local machine to a log file that's opened and then
emailed back

problem is that the sending back routine fails.

Now I've found a program that will more or less do what is requied but it's
not really exactly what would be used in that it doesn't use the libgmail
routine.

So far the maintainer of both packages seem to be afk or not having their
routines fixed and so far debian/Unbuntu claim that the last version of the
package has been fixed :(

Is there a recommendatin of how to combine/alter so that ogss can transmit?
My main issue is that python is lesser known to me than Chinese (which I
also don't know).

My idea of this is to have a remote email timeclock program which could then
be scripted with any language or just "echo >>blah" if necessary.

Thanks in advance :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090809/674c163f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libgmail.py
Type: text/x-python
Size: 54654 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090809/674c163f/attachment-0003.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ogss.py
Type: text/x-python
Size: 6240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090809/674c163f/attachment-0004.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: send2.py
Type: text/x-python
Size: 2087 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090809/674c163f/attachment-0005.py>

Search Discussions

  • John Haggerty at Aug 12, 2009 at 4:28 am
    just checking to see if there is any input that may have been misdirected to
    a spam filter.
    Would love to see some feedback if I may
    On Sun, Aug 9, 2009 at 6:42 PM, John Haggerty wrote:

    ok so I know this is one of those "weird" requests but here me out.
    So far I have an issue with a package for python called "libgmail" which is
    basically a gmail interface for python to send messages remoetly.

    Works ok except that the 'sendMessage' routine is bad.

    This is included in the above attachment

    it's used in a program called "ogss" which is an sms interface to gmail to
    basically read gmail and then have a command done on a remote machine and
    then spat out on the local machine to a log file that's opened and then
    emailed back

    problem is that the sending back routine fails.

    Now I've found a program that will more or less do what is requied but it's
    not really exactly what would be used in that it doesn't use the libgmail
    routine.

    So far the maintainer of both packages seem to be afk or not having their
    routines fixed and so far debian/Unbuntu claim that the last version of the
    package has been fixed :(

    Is there a recommendatin of how to combine/alter so that ogss can transmit?
    My main issue is that python is lesser known to me than Chinese (which I
    also don't know).

    My idea of this is to have a remote email timeclock program which could
    then be scripted with any language or just "echo >>blah" if necessary.

    Thanks in advance :)
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20090811/1a1a3522/attachment.htm>
  • Chris Rebert at Aug 12, 2009 at 4:46 am

    On Sun, Aug 9, 2009 at 8:42 PM, John Haggertywrote:
    ok so I know this is one of those "weird" requests but here me out.
    So far I have an issue with a package for python called "libgmail" which is
    basically a gmail interface for python to send messages remoetly.
    Works ok except that the 'sendMessage' routine is bad.
    How is it "bad" precisely? Be specific (e.g. error message(s),
    description of observed incorrect behavior).
    This is included in the above attachment
    it's used in a program called "ogss" which is an sms interface to gmail to
    basically read gmail and then have a command done on a remote machine and
    then spat out on the local machine to a log file that's opened and then
    emailed back
    problem is that the sending back routine fails.
    Which routine is that exactly? Please also specify exactly how it is
    failing (e.g. error message(s), description of observed incorrect
    behavior).

    I apologize if these questions are answered in comments in the
    attachments, but to be honest, the fact that you didn't (or couldn't)
    put the specific problematic sections of code (and/or error messages)
    inline in your message makes it less likely that people (such as
    myself) will try to help you due to the volume of code you're making
    people wade through (i.e. people tend not to read large code dumps,
    /especially/ in attachments).

    Cheers,
    Chris
  • John Haggerty at Aug 12, 2009 at 5:02 am

    On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert wrote:

    On Sun, Aug 9, 2009 at 8:42 PM, John Haggertywrote:
    ok so I know this is one of those "weird" requests but here me out.
    So far I have an issue with a package for python called "libgmail" which is
    basically a gmail interface for python to send messages remoetly.
    Works ok except that the 'sendMessage' routine is bad.
    How is it "bad" precisely? Be specific (e.g. error message(s),
    description of observed incorrect behavior).
    In regards to bad would be failing to transmit claiming that the submittal
    is wrong for the transmit string.

    (where username is my gmail username and "password" is my gmail password to
    the test account, 6666666969 is the mobile number in question '00' is my
    "carrier id" from the ogss code example which is just an array location from
    a preformatted part of the string [probably from wikipedia on mobile carrier
    email addresses to cell phones], I actually got desperate and commented out
    the first attempt to transmit which I located in the code as just the
    "instructions" the code fails on re-transmission, I later on looked at the
    file and located that it was a zero byte file of no content. The program
    itself looks for a command from the user's cell phone directly from mms sent
    to the target gmail account prefaced by "Ogss" and anything else is treated
    as a command but since the command failed on the first transmit I don't
    think it's the command per se).

    owner at bouncyinc:~/Desktop/OGSS$ python ogss.py username password 6666666969
    00
    Starting ogss
    Logfile at:/home/owner/ogss.log
    Opening log file for reading
    Parsing user input
    Connecting to Gmail
    Logging into Gmail
    Opening log file for writing
    Listening for commands
    Processing Command
    ls: unrecognized option `---------------------------------------------'
    Try `ls --help' for more information.
    Seding back results
    Traceback (most recent call last):
    File "ogss.py", line 127, in <module>
    main(sys.argv)
    File "ogss.py", line 110, in main
    account.sendMessage(tosend)
    File "/usr/lib/python2.5/site-packages/libgmail.py", line 615, in
    sendMessage
    raise GmailSendError, resultInfo[SM_MSG]
    libgmail.GmailSendError: Please try again.

    I traced the result to the sendMessage routine and noted that anytime it
    tries to send anything it fails this also fails with the standard "docs"
    package for libgmail 0.30 docs from the maintainer's site.

    Now the part where it *does* fail is where it has an issue with looking at
    the trailing info but then it would have logged the info to the file and
    emailed me back junk (which it didn't)

    I assume this could be done on any system just replace 'ls' with 'dir' or
    the equivalent.

    This is included in the above attachment
    it's used in a program called "ogss" which is an sms interface to gmail to
    basically read gmail and then have a command done on a remote machine and
    then spat out on the local machine to a log file that's opened and then
    emailed back
    problem is that the sending back routine fails.
    Which routine is that exactly? Please also specify exactly how it is
    failing (e.g. error message(s), description of observed incorrect
    behavior).

    I apologize if these questions are answered in comments in the
    attachments, but to be honest, the fact that you didn't (or couldn't)
    put the specific problematic sections of code (and/or error messages)
    inline in your message makes it less likely that people (such as
    myself) will try to help you due to the volume of code you're making
    people wade through (i.e. people tend not to read large code dumps,
    /especially/ in attachments).

    Cheers,
    Chris
    --
    http://blog.rebertia.com
    That's ok I understand I hope that helps at least in part.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20090811/58f4431e/attachment.htm>
  • John Haggerty at Aug 13, 2009 at 4:41 am
    Just checking to see if this is more adequate to what you would have wanted
    to see I didn't get any feedback so I wasn't quite sure of this at the
    present time.
    On Tue, Aug 11, 2009 at 11:02 PM, John Haggerty wrote:


    On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert wrote:

    On Sun, Aug 9, 2009 at 8:42 PM, John Haggertywrote:
    ok so I know this is one of those "weird" requests but here me out.
    So far I have an issue with a package for python called "libgmail" which is
    basically a gmail interface for python to send messages remoetly.
    Works ok except that the 'sendMessage' routine is bad.
    How is it "bad" precisely? Be specific (e.g. error message(s),
    description of observed incorrect behavior).
    In regards to bad would be failing to transmit claiming that the submittal
    is wrong for the transmit string.

    (where username is my gmail username and "password" is my gmail password to
    the test account, 6666666969 is the mobile number in question '00' is my
    "carrier id" from the ogss code example which is just an array location from
    a preformatted part of the string [probably from wikipedia on mobile carrier
    email addresses to cell phones], I actually got desperate and commented out
    the first attempt to transmit which I located in the code as just the
    "instructions" the code fails on re-transmission, I later on looked at the
    file and located that it was a zero byte file of no content. The program
    itself looks for a command from the user's cell phone directly from mms sent
    to the target gmail account prefaced by "Ogss" and anything else is treated
    as a command but since the command failed on the first transmit I don't
    think it's the command per se).

    owner at bouncyinc:~/Desktop/OGSS$ python ogss.py username password
    6666666969 00
    Starting ogss
    Logfile at:/home/owner/ogss.log
    Opening log file for reading
    Parsing user input
    Connecting to Gmail
    Logging into Gmail
    Opening log file for writing
    Listening for commands
    Processing Command
    ls: unrecognized option `---------------------------------------------'
    Try `ls --help' for more information.
    Seding back results
    Traceback (most recent call last):
    File "ogss.py", line 127, in <module>
    main(sys.argv)
    File "ogss.py", line 110, in main
    account.sendMessage(tosend)
    File "/usr/lib/python2.5/site-packages/libgmail.py", line 615, in
    sendMessage
    raise GmailSendError, resultInfo[SM_MSG]
    libgmail.GmailSendError: Please try again.

    I traced the result to the sendMessage routine and noted that anytime it
    tries to send anything it fails this also fails with the standard "docs"
    package for libgmail 0.30 docs from the maintainer's site.

    Now the part where it *does* fail is where it has an issue with looking at
    the trailing info but then it would have logged the info to the file and
    emailed me back junk (which it didn't)

    I assume this could be done on any system just replace 'ls' with 'dir' or
    the equivalent.

    This is included in the above attachment
    it's used in a program called "ogss" which is an sms interface to gmail to
    basically read gmail and then have a command done on a remote machine and
    then spat out on the local machine to a log file that's opened and then
    emailed back
    problem is that the sending back routine fails.
    Which routine is that exactly? Please also specify exactly how it is
    failing (e.g. error message(s), description of observed incorrect
    behavior).

    I apologize if these questions are answered in comments in the
    attachments, but to be honest, the fact that you didn't (or couldn't)
    put the specific problematic sections of code (and/or error messages)
    inline in your message makes it less likely that people (such as
    myself) will try to help you due to the volume of code you're making
    people wade through (i.e. people tend not to read large code dumps,
    /especially/ in attachments).

    Cheers,
    Chris
    --
    http://blog.rebertia.com
    That's ok I understand I hope that helps at least in part.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20090812/5689c8da/attachment-0001.htm>
  • John Haggerty at Aug 15, 2009 at 4:46 am
    I'm checking back with some new info.

    Apparently the maintainer of the ogss package indicated that this is
    definately an issue with the libgmail package.

    Now I have already submtted help to the maintainer of libgmail to get some
    help it making his project work again.

    I am also interesetd in how roundabout smtp support could be added to that
    program specifically

    print "Seding back results"
    account.sendMessage(tosend)
    print "Logging..."
    execd.append(int(maxmessage.id,16))
    towrite = str(int(maxmessage.id,16))+"~ "
    for arg in command:
    towrite += arg+" "
    w.write(towrite+"\n")
    print "Listening for commands"

    in the code sample from ogss.py to take that subroutine and turn it around
    to allow the same arguments

    basically take the above

    and add

    -----------------------------------------

    gmail_user = "" #Username
    gmail_pwd = "" #Password
    gmail_alt = " " #Alias ID
    gmail_alias = ""+gmail_alt #nickname
    mailing_list = ""
    class mailz:
    def __init__(self):
    self.files=[""]
    self.mail = MIMEMultipart()

    def attach(self,fil):
    self.files.append(fil)

    def mailprep(self,to, subject, text):
    self.to = to
    self.mail['From'] = gmail_alias
    self.mail['To'] = to
    self.mail['Subject'] = subject
    if (mailtoBcc !="") :
    self.mail['BCC'] = mailtoBcc

    text+="\n\n\n_________________________\nMail generated By PyGmS
    "+ver+"\n - Made By Djays\n http://djsh.net"

    self.mail.attach(MIMEText(text))
    print self.files

    for attach in self.files:
    if (attach != "") :
    part = MIMEBase('application', 'octet-stream')
    part.set_payload(open(attach, 'rb').read())
    Encoders.encode_base64(part)
    part.add_header('Content-Disposition','attachment; filename="%s"'
    %
    os.path.basename(attach))
    self.mail.attach(part)

    def sendmail(self):
    self.mailServer = smtplib.SMTP("smtp.gmail.com", 587)
    self.mailServer.ehlo()
    self.mailServer.starttls()
    self.mailServer.ehlo()
    self.mailServer.login(gmail_user, gmail_pwd)
    self.mailServer.sendmail(gmail_user, self.to, self.mail.as_string())
    self.mailServer.close()
    ----------------------------------------------------------------------------

    I hate to sound like a newb but the problem is that I'm running into
    apathetic maintainers of the software in question which has yet to be
    redacted as "working" and at the present time I have to deal with
    multi-server conglomerates like "Request Tracker" or "Roundup" both of which
    are simply not authenticating into gmail at all.

    At first I thought this was an issue of the ssl certificates not working but
    hen how come it's possible to have any of the code working when it's just
    the sending?

    And how is it possible that generic but different code can be working when
    it's all broken?

    Not to sound in any way belligerent but when this would be my 5th program
    language to solve a simple problem I think this is solveable w/o having to
    resort to the equivalent to a half semester of CS I in python imho.
    On Wed, Aug 12, 2009 at 10:41 PM, John Haggerty wrote:

    Just checking to see if this is more adequate to what you would have wanted
    to see I didn't get any feedback so I wasn't quite sure of this at the
    present time.

    On Tue, Aug 11, 2009 at 11:02 PM, John Haggerty wrote:


    On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert wrote:

    On Sun, Aug 9, 2009 at 8:42 PM, John Haggerty<bouncyinc at gmail.com>
    wrote:
    ok so I know this is one of those "weird" requests but here me out.
    So far I have an issue with a package for python called "libgmail" which is
    basically a gmail interface for python to send messages remoetly.
    Works ok except that the 'sendMessage' routine is bad.
    How is it "bad" precisely? Be specific (e.g. error message(s),
    description of observed incorrect behavior).
    In regards to bad would be failing to transmit claiming that the submittal
    is wrong for the transmit string.

    (where username is my gmail username and "password" is my gmail password
    to the test account, 6666666969 is the mobile number in question '00' is my
    "carrier id" from the ogss code example which is just an array location from
    a preformatted part of the string [probably from wikipedia on mobile carrier
    email addresses to cell phones], I actually got desperate and commented out
    the first attempt to transmit which I located in the code as just the
    "instructions" the code fails on re-transmission, I later on looked at the
    file and located that it was a zero byte file of no content. The program
    itself looks for a command from the user's cell phone directly from mms sent
    to the target gmail account prefaced by "Ogss" and anything else is treated
    as a command but since the command failed on the first transmit I don't
    think it's the command per se).

    owner at bouncyinc:~/Desktop/OGSS$ python ogss.py username password
    6666666969 00
    Starting ogss
    Logfile at:/home/owner/ogss.log
    Opening log file for reading
    Parsing user input
    Connecting to Gmail
    Logging into Gmail
    Opening log file for writing
    Listening for commands
    Processing Command
    ls: unrecognized option `---------------------------------------------'
    Try `ls --help' for more information.
    Seding back results
    Traceback (most recent call last):
    File "ogss.py", line 127, in <module>
    main(sys.argv)
    File "ogss.py", line 110, in main
    account.sendMessage(tosend)
    File "/usr/lib/python2.5/site-packages/libgmail.py", line 615, in
    sendMessage
    raise GmailSendError, resultInfo[SM_MSG]
    libgmail.GmailSendError: Please try again.

    I traced the result to the sendMessage routine and noted that anytime it
    tries to send anything it fails this also fails with the standard "docs"
    package for libgmail 0.30 docs from the maintainer's site.

    Now the part where it *does* fail is where it has an issue with looking at
    the trailing info but then it would have logged the info to the file and
    emailed me back junk (which it didn't)

    I assume this could be done on any system just replace 'ls' with 'dir' or
    the equivalent.

    This is included in the above attachment
    it's used in a program called "ogss" which is an sms interface to gmail to
    basically read gmail and then have a command done on a remote machine and
    then spat out on the local machine to a log file that's opened and then
    emailed back
    problem is that the sending back routine fails.
    Which routine is that exactly? Please also specify exactly how it is
    failing (e.g. error message(s), description of observed incorrect
    behavior).

    I apologize if these questions are answered in comments in the
    attachments, but to be honest, the fact that you didn't (or couldn't)
    put the specific problematic sections of code (and/or error messages)
    inline in your message makes it less likely that people (such as
    myself) will try to help you due to the volume of code you're making
    people wade through (i.e. people tend not to read large code dumps,
    /especially/ in attachments).

    Cheers,
    Chris
    --
    http://blog.rebertia.com
    That's ok I understand I hope that helps at least in part.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20090814/5c5d956f/attachment-0001.htm>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 10, '09 at 12:42a
activeAug 15, '09 at 4:46a
posts6
users2
websitepython.org

2 users in discussion

John Haggerty: 5 posts Chris Rebert: 1 post

People

Translate

site design / logo © 2022 Grokbase