1

Ask by email not working?

Ask by email is not working

  • The IMAP is working. After running the command python manage.py post_emailed_questions, all the emails are removed from the remote mailbox, as expected.

  • However, no questions appear in the AskBot instance.

Yes. I did go to go to the site's live settings and enable the feature "Email settings" -> "allow asking by email"

Yes. There is no exception raised. Very weird...

Using the latest github code, deployed with Apache + wsgi

http://fashionsteal.com/questions/

Well, there are warnings, but I don't think the warnings matter

fs_com_virtpy/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
  DeprecationWarning
   fs_com_virtpy/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/db/__init__.py:60: DeprecationWarning: Short names for ENGINE in database configurations are deprecated. Prepend default.ENGINE with 'django.db.backends.'
      DeprecationWarning
Evgeny's avatar
13.2k
Evgeny
updated 2011-06-14 15:34:06 -0600
peter's avatar
11
peter
asked 2011-06-13 01:44:01 -0600
edit flag offensive 0 remove flag close merge delete

Comments

Yes, those warnings are not relevant.
Evgeny's avatar Evgeny (2011-06-13 02:16:53 -0600) edit
add a comment see more comments

5 Answers

0

This still doesn't work

{'body_text': 'Imagine you\x92re a small business owner. You have to choose between two\r\npropositions:\r\n\r\n\xa0 \xa0You can pay $62,500 for marketing. You\x92ll get a whole lot of\r\ncustomers coming through your door. No guarantees if they will ever\r\ncome back, but they\x92ll come once.\r\n\xa0 \xa0I\x92ll pay you $21,000. You get $7,000 in about 5 days, another\r\n$7,000 in 30 days and the remainder in 60 days. In exchange, you\x92ll\r\ngive my customers cheap products for the next year.\r\n\r\nI\x92ve been working on local for a long time and I know it\x92s hard to get\r\nsmall businesses to spend money on advertising. Really hard. Even\r\ngetting $200 a month ($2,400 a year) is a high hurdle to meet.\r\n\r\nThere\x92s no way a business will sign up for #1. Most merchants would\r\nlaugh you out of the store if you asked for $60,000.\r\n\r\nExcept they are. In droves.\r\n\r\nAlthough they sound completely different, #1 and #2 are really the\r\nsame\x97it\x92s the Groupon business model.\r\n\r\nBusinesses are being sold incredibly expensive advertising campaigns\r\nthat are disguised as \x93no risk\x94 ways to acquire new customers. In\r\nreality, there\x92s a lot of risk. With a newspaper ad, the maximum you\r\ncan lose is the amount you paid for the ad. With Groupon, your\r\npotential losses can increase with every Groupon customer who walks\r\nthrough the door and put the existence of your business at risk.\r\n\r\nGroupon is not an Internet marketing business so much as it is the\r\nequivalent of a loan sharking business. The $21,000 that the business\r\nin this example gets for running a Groupon is essentially a very, very\r\nexpensive loan. \xa0They get the cash up front, but pay for it with deep\r\ndiscounts over time. \xa0(This post applies to Groupon operations in the\r\nUnited States and Canada; it\x92s different in other parts of the world.)\r\n\r\nIn many cases, running a Groupon can be a terrible financial decision\r\nfor merchants. Groupon\x92s financials also raise questions about its\r\nongoing viability. Buying Groupon stock could be as bad a deal for\r\ninvestors as running a Groupon offer is for merchants. \xa0This is my\r\nopinion, but I have some facts to back it up.\r\n', 'sender': 'Peter peter@gmail.com', 'subject': '=?windows-1252?Q?=5Btag=2C_tag2=5D_Imagine_you=92re_a_small_business_owner=2E?=\r\n\t=?windows-1252?Q?_You_have_to_choose_between_two_propositions=3A?='}

However, another email worked: http://fashionsteal.com/question/4/testtestest

My outbound email is not working. No wonder I didn't get any bounced emails. Will print the exceptions to figure it out. Thanks for all the help.

peter's avatar
11
peter
updated 2011-06-14 00:40:59 -0600, answered 2011-06-14 00:31:07 -0600
edit flag offensive 0 remove flag delete link

Comments

No problems, we should have more logging errors when the emails fail, I'll look into that.
Evgeny's avatar Evgeny (2011-06-14 00:42:40 -0600) edit
add a comment see more comments
0

Even the data was there, it turns out

form.is_valid() was False

That means the following step failed

form = AskByEmailForm(data)

That is why it never attempts to post

If I ignore that by setting

if form.is_valid():

to

if 1:

Then, I get the following error:

AttributeError: 'AskByEmailForm' object has no attribute 'cleaned_data'
peter's avatar
11
peter
answered 2011-06-13 22:46:10 -0600
edit flag offensive 0 remove flag delete link

Comments

Ok, this helps, after form.is_valid() see what is form._errors
Evgeny's avatar Evgeny (2011-06-13 22:51:28 -0600) edit
Also, can you post what is in your "data", which is the parameter to AskByEmailForm?
Evgeny's avatar Evgeny (2011-06-13 22:52:29 -0600) edit
add a comment see more comments
0

{'body_text': 'Imagine you\x92re a small business owner. You have to choose between two\r\npropositions:\r\n\r\n You can pay 62,500 for marketing. You\x92ll get a whole lot of\r\ncustomers coming through your door. No guarantees if they will ever\r\ncome back, but they\x92ll come once.\r\n I\x92ll pay you $21,000. You get $7,000 in about 5 days, another\r\n7,000 in 30 days and the remainder in 60 days. In exchange, you\x92ll\r\ngive my customers cheap products for the next year.\r\n\r\nI\x92ve been working on local for a long time and I know it\x92s hard to get\r\nsmall businesses to spend money on advertising. Really hard. Even\r\ngetting $200 a month ($2,400 a year) is a high hurdle to meet.\r\n\r\nThere\x92s no way a business will sign up for #1. Most merchants would\r\nlaugh you out of the store if you asked for 60,000.\r\n\r\nExcept they are. In droves.\r\n\r\nAlthough they sound completely different, #1 and #2 are really the\r\nsame\x97it\x92s the Groupon business model.\r\n\r\nBusinesses are being sold incredibly expensive advertising campaigns\r\nthat are disguised as \x93no risk\x94 ways to acquire new customers. In\r\nreality, there\x92s a lot of risk. With a newspaper ad, the maximum you\r\ncan lose is the amount you paid for the ad. With Groupon, your\r\npotential losses can increase with every Groupon customer who walks\r\nthrough the door and put the existence of your business at risk.\r\n\r\nGroupon is not an Internet marketing business so much as it is the\r\nequivalent of a loan sharking business. The $21,000 that the business\r\nin this example gets for running a Groupon is essentially a very, very\r\nexpensive loan. They get the cash up front, but pay for it with deep\r\ndiscounts over time. (This post applies to Groupon operations in the\r\nUnited States and Canada; it\x92s different in other parts of the world.)\r\n\r\nIn many cases, running a Groupon can be a terrible financial decision\r\nfor merchants. Groupon\x92s financials also raise questions about its\r\nongoing viability. Buying Groupon stock could be as bad a deal for\r\ninvestors as running a Groupon offer is for merchants. This is my\r\nopinion, but I have some facts to back it up.\r\n', 'sender': 'peter peter@gmail.com', 'subject': '[tag, tag2] test test'}

peter's avatar
11
peter
answered 2011-06-14 00:03:03 -0600
edit flag offensive 0 remove flag delete link

Comments

I gave up.. Does it work for you? I am using gmail imap
peter's avatar peter (2011-06-14 00:04:00 -0600) edit
That helps. The error is "title must be > 10 characters" if the form does not validate, the email should bounce. Is yours really peter@gmail.com?
Evgeny's avatar Evgeny (2011-06-14 00:08:38 -0600) edit
no.............................Ok, let me try it again with longer subject lines..
peter's avatar peter (2011-06-14 00:12:45 -0600) edit
Why don't you use your real email address? Then you would get one about the error, and if this email is not real, you must be spamming someone right now, stop it!
Evgeny's avatar Evgeny (2011-06-14 00:16:01 -0600) edit
well. I am using my real email to send emails, so there is no way the email will be bounced to the wrong user. peter@gmail.com is just an example of that field.
peter's avatar peter (2011-06-14 00:32:50 -0600) edit
add a comment see more comments
0

Possibly it's because the documentation is incomplete, will update tomorrow.

Try formatting subject line as [tag1, tag2] The question title. Notice tags in square brackets.

Does it help?

Evgeny's avatar
13.2k
Evgeny
updated 2011-06-13 02:25:35 -0600, answered 2011-06-13 02:23:03 -0600
edit flag offensive 0 remove flag delete link

Comments

Tried. No go. Does it work for you?
DealsVistaCom's avatar DealsVistaCom (2011-06-13 10:42:48 -0600) edit
Sorry, I will respond in the evening, will add logging messages then you can email the log back to me. Thanks.
Evgeny's avatar Evgeny (2011-06-13 17:43:09 -0600) edit
add a comment see more comments
0

When I do:

python manage.py shell
from askbot import models
user = User.objects.get(id=1)
user.post_question(title = 't', tags='tag', body_text = 'body')

It worked (http://fashionsteal.com/question/2/t) despite there was a warning:

lib/python2.6/site-packages/Coffin-0.3.4-py2.6.egg/coffin/common.py:49: UserWarning: Cannot translate loader: askbot.skins.loaders.load_template_source
  warnings.warn('Cannot translate loader: %s' % loader)
<Question: t>

Now I am really confused...

peter's avatar
11
peter
answered 2011-06-13 21:54:32 -0600
edit flag offensive 0 remove flag delete link

Comments

Well, since you went that far, maybe you can insert two lines "import pdb" and "pdb.set_trace()" in the beginning of the "handle_noargs" function of askbot/management/commands/post_emailed_questons.py, run the management command, and step through the code. I still need to add the logging messages.
Evgeny's avatar Evgeny (2011-06-13 22:35:35 -0600) edit
add a comment see more comments