Giter VIP home page Giter VIP logo

gmail-relay's People

Contributors

asssaf avatar mtfurlan avatar

Watchers

 avatar

gmail-relay's Issues

TypeError: is not JSON serializable

Hey there,

I've been playing around with this, but haven't been able to get anything to send. I got the authentication part done, but am having issues with the actual message. my "test" file looks like this:

([email protected] is substituted for the actual username that was authenticated)
x-sender: [email protected]
x-receiver: [email protected]
from: MyName [email protected]
to: You [email protected]
Subject: Testing Subject
Hey, did you know that this works?
.

The error I'm getting:
(venv) [root@localhost venv]# cat ../test | ./gmail-relay.py Traceback (most recent call last): File "./gmail-relay.py", line 117, in <module> main() File "./gmail-relay.py", line 110, in main sent = send_message(service, "me", message) File "./gmail-relay.py", line 68, in send_message message = (service.users().messages().send(userId=user_id, body=message) File "/root/venv/lib/python3.4/site-packages/apiclient/discovery.py", line 642, in method actual_path_params, actual_query_params, body_value) File "/root/venv/lib/python3.4/site-packages/apiclient/model.py", line 149, in request body_value = self.serialize(body_value) File "/root/venv/lib/python3.4/site-packages/apiclient/model.py", line 258, in serialize return simplejson.dumps(body_value) File "/usr/lib64/python3.4/json/__init__.py", line 230, in dumps return _default_encoder.encode(obj) File "/usr/lib64/python3.4/json/encoder.py", line 192, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib64/python3.4/json/encoder.py", line 250, in iterencode return _iterencode(o, 0) File "/usr/lib64/python3.4/json/encoder.py", line 173, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: b'eC1zZW5kZXI6IHRlZGRqb2huc29uQGdtYWlsLmNvbQp4LXJlY2VpdmVyOiB0ZWRkam9obnNvbjk5QHlhaG9vLmNvbQpGcm9tOiBNeXNlbGYgUGVyc29uYWxseSA8dGVkZGpvaG5zb25AZ21haWwuY29tPgpUbzogWW91IDx0ZWRkam9obnNvbjk5QHlhaG9vLmNvbT4KU3ViamVjdDogSSBsb3ZlIGl0CkhleSwgZGlkIHlvdSBrbm93IHRoYXQKLgo=' is not JSON serializable

I'm thinking the issue is either because my test input file is not formatted correctly (RFC 2822) or maybe because I'm using python 3 instead of 2?

Any help would be appreciated, thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.