Comments (13)
IIRC Gmail requires STARTTLS, can you try with:
"starttls://just-username:[email protected]:587" ?
from bottle-cork.
Result:
Browser: "Please check your mailbox".
MongoDB: User added to pending_registrations
collection.
Email: No email sent to new user.
BUT:
Email was sent to secondary email address of sending email account (gmail) from google called:
"Suspicious sign in prevented"
With text:
"Someone recently used your password to try to sign in to your Google Account ****@gmail.com. This person was using an application such as an email client or mobile device.
We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:
Friday, November 15, 2013 7:13:25 AM UTC
IP Address: ... (ec2----.*****.amazonaws.com.)
Location: Chicago, IL, USA
If you do not recognize this sign-in attempt, someone else might be trying to access your account. You should sign in to your account and reset your password immediately".
from bottle-cork.
Update:
The troubleshooting steps in the email (ie https://support.google.com/mail/answer/14257) do not resolve the problem.
Another suggested solution (set up 'application specific passwords') is in the comments here:
http://stackoverflow.com/a/13732320/1063287
Gmail Account > Settings > Accounts > Other Google Account settings > Security > Connected applications and sites > Review permissions > Watch a video
However:
An application-specific password can only be created when you are signed up for 2-step verification.
(Interesting however that Fedora 19 GNOME access did not require 2-step verification sign up).
This requires using a code that will be sent to your phone, plus your regular password to access your email.
I am now looking for a less complex way of getting this working.
from bottle-cork.
This is how Google authentication works. You'll have to create an application-specific password once and then use it for sending email indefinitely.
from bottle-cork.
For reference:
After enabling 2-step authentication and creating an application-specific password for the web application, the user registration email is received.
from bottle-cork.
@oshihirii, @FedericoCeratto I have completed the 2-step authentication and am using the application specific password in this format: starttls://just-username:[email protected]:587
Did you use your gmail prefix for the username?
I keep getting this after 200 code but I never get 'Please check your inbox'
localhost - - [2014-12-19 23:47:55,015] Error sending email: [Errno 65] No route to host
Traceback (most recent call last):
File "/Users/phil/Envs/stp/lib/python2.7/site-packages/cork/cork.py", line 847, in _send
session = SMTP(self._conf['fqdn'])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 250, in __init__
(code, msg) = self.connect(host, port)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 310, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 285, in _get_socket
return socket.create_connection((host, port), timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 65] No route to host
from bottle-cork.
I searched the error and came across this, perhaps it will help in troubleshooting?
http://stackoverflow.com/questions/17708141/connecting-to-gmail-from-python
I'm working on application locally, but this is my code block that references starttls
:
hostname = "mongodb://localhost:27017/"
connection = pymongo.MongoClient(host=hostname)
mb = MongoDBBackend(db_name='users', initialize=True,hostname = hostname)
smtp_url = "starttls://username:[email protected]:587"
email_sender = "[email protected]"
aaa = Cork(backend=mb, email_sender=email_sender, smtp_url=smtp_url)
from bottle-cork.
@oshihirii thanks for the response, in case it is of interest @FedericoCeratto
I got it to work by changing a line in cork.py.
in def send_email(self, email_addr, subject, email_text):
i added some lines for debugging, but I think it's ~ line 847 - 849. I changed
session = SMTP(self._conf['fqdn'])
to
session = SMTP('%s:%s' % (self._conf['fqdn'], self._conf['port']))
and now it works!
from bottle-cork.
good to hear it works!
from bottle-cork.
@paperview: the SMTP() syntax is equivalent:
SMTP('smtp.gmail.com:587').ehlo() == SMTP('smtp.gmail.com', 587).ehlo() == SMTP(host=
smtp.gmail.com', port=587).ehlo() --> returns True, they are all working correctly
You probably had connectivity issues at the time. Can you reproduce the behavior you described?
from bottle-cork.
Hey @FedericoCeratto , thanks for the response. For me, the port wasn't included in the smtp call. The line read session = SMTP(self._conf['fqdn'])
where self._conf['fdqn']
was 'smtp.gmail.com' and self._conf['port']
(not included in the call) was '587'. I'm not sure why the port parameter was missing in my cork.py. I don't recall removing it, but I've done crazier things.
from bottle-cork.
Ohh I get it, the code was updated after that, as part of #43
from bottle-cork.
I see, thank you. Just FYI if I use pip to get cork, I seem to still get the older version.
from bottle-cork.
Related Issues (20)
- SQLiteBackend.Table.iteritems() yields wrong data HOT 2
- Doco links to dead-ish downloads page on Github
- Best way to add more user fields to user profile? HOT 1
- Registration email fails if TEMPLATE_PATH is not /views/ HOT 2
- Login timeout too short HOT 1
- make doc error HOT 1
- Subclassing User HOT 2
- Security issue? problematic defaults for hashlib.pbkdf2_hmac HOT 1
- Registration does not check pending_registrations collection for existence of the user name HOT 4
- http://cork.firelet.net/ is down HOT 1
- Missing logging for auditing HOT 5
- pip update? HOT 1
- Documentation website is down HOT 1
- mongo backend doesn't work with mongdb 3.4
- Email Not Sent - Auth Error HOT 6
- TypeError @ _setup_cookie when signing/logging in HOT 1
- Docs not accessible
- Question ? Cork without beaker
- There's an error when installing
- MySQL server has gone away HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bottle-cork.