WordPress “No Such User Here” Error With Formidable Forms

I set up a domain on Google Apps with some email addresses, and wanted to send contact information from a WordPress form that was using Formidable. However, the emails weren’t being sent correctly from the form. When I sent a message from my Gmail account, the message went through correctly (I set up another email on the same domain for testing purposes).

Inspecting the mail error logs (for me on the shared hosting, was at ~/mail/new/*), I got things similar to the following:

Return-path: <>
Envelope-to: username@zzzzzzz.com
Delivery-date: Thu, 15 Dec 2011 15:19:24 -0700
Received: from mailnull by zzzzzzzz.com with local (Exim 4.69)
id 1RbJe8
for username@zzzzzzzzzz.com; Thu, 15 Dec 2011 15:19:24 -0700
X-Failed-Recipients: admin@mywebsite.com
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@zzzzzzz.com>
To: username@zzzzzzz.com
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1RbJe8@zzzzz.com>
Date: Thu, 15 Dec 2011 15:19:24 -0700

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  admin@mywebsite.com
    No Such User Here

I searched around a bit, and it seems like it was Google Apps rejecting the email that I was sending from the shared hosting environment. To solve this, I wanted to authenticate with Gmail and use that as the SMTP server.

I followed the instructions here and it seemed to work out well. I was able to send emails effectively to the Google Mail account after putting in my testing account’s information as the username/password. This worked with WordPress 3.1.

Hope this helps!

Wordpress Posts Not Saving

I was having a problem where Wordpress post drafts on my main blog were not saving. I would press the schedule/publish/update button when I was in the HTML view mode (the default mode that I edit in), and the text would change from a monospaced font to a non-monospaced font. Nothing would happen otherwise. I would press the button again, and all of the text would completely disappear, and my work would be lost. Nothing would save to the database. I had to go into the quick edit mode on the all posts page to actually edit anything. Clearly this was unacceptable.

Here are the steps I took to fix it:

  • Ensure I was running the latest version of Wordpress (I was)

  • Ensure that all of the plugins that I had were completely up to date

  • Disable any new or flaky plugins, or those dealing with editing that might have caused the problem

  • Somehow proofreading got turned on, and this seemed to cause problems. See here to turn off Wordpress proofreading.

After doing that, things seemed to work much better on the saving front.

Titanium and Database Download From Server

My goal: to have a mobile app that downloads its initial database from the server instead of pulling the data down through the normal API one at a time. This was for speed reasons, and there are probably other implementations and methods to try. Basically, if the app has never synced, pull down the database.

A bunch of posts on the subject (not exactly what I needed, but helpful): Using a local database with Titanium Update database and table content DB install from remote sqlite file The official database documentation Some helpful SQLite documentation for generating the dump from your database A nice way to programmatically modify the table that you dumped with some examples

The project happened to be using joli.js for persistence. My code eventually looked something like this:

function checkForBlankDb(callback) {
  if (models.somemodel.count() === 0) { // never pulled from server
    Ti.API.debug("Going to try to download the database");
    activityIndicator.message = 'Downloading database...';
    activityIndicator.show();
    var xhr = Ti.Network.createHTTPClient();

    xhr.onload = function() {
      var f = Ti.Filesystem.getFile('file:///data/data/myprojectpackage/databases/mydb');
      Ti.API.debug("f.nativePath: " + f.nativePath);

      // key if you have opened the db, I needed to extend Joli to do this
      joli.connection.close();

      // remove the file, not entirely sure this is necessary
      if (f.exists()) {
        Ti.API.debug("deleting the file at nativepath");
        f.deleteFile();
      }

      Ti.API.debug("going to write data");
      f.write(this.responseData); // actually write the data we got
      Ti.API.debug("wrote data");

      Ti.API.debug("reconnecting to database");
      joli.connection = new joli.Connection('mydb');

      Ti.API.debug("should have successfully synced.");
      callback();
    };

    xhr.onerror = function() {
      alert("Could not connect to server to download.");
      // TODO: better error handling
    }

    xhr.open('GET', serverpath + '/downloads/database');
    authenticate(xhr);
    xhr.send();
  } else {
    callback();
  }
}

The long and short of it is that if you do something like opening a database mydb, it stores it at the file path listed up in the code sample (file:///blah). This is only for Android, the path for iOS is different. There are ways to generate that path more dynamically, but this works for now. If you want to see exactly what you are creating, use adb -e shell to check out the file system. The callback stuff makes the asynchronous call basically synchronous, because I wanted to do some things immediately after that required the database being loaded. Most of the time, the initial check would pass, and we would not download the database again (just look for diffs.) Hope this helps!

Form Was Removed From Rails and Is Now Available as a Plugin.

I got this strange error when in my Rails application:

DEPRECATION WARNING: form was removed from Rails and is now available as a plugin. Please install it with rails plugin install git://github.com/rails/dynamic_form.git.

What ended up happening was that I forgot to pass in a local ‘form’ to a partial that was expecting it to be passed in. Rails then didn’t know how to handle the form that I was trying to set, and so it fell back to some default behavior of saying that the way I was using form was deprecated.

What Are Some Great Posts on Debugging Tough Problems?

Even if you are not running the same technology as someone else, you can gain insight into how they solve hairy problems by reading through their summaries of strange fixes.

Today there was a great post on debugging CSRF problems in Rails. I thought it was interesting and had run into something similar but not nearly as convoluted. It was useful to see the steps that the post author took to figure out what was the root cause of the problem, tracking back to what the change in the Rails code base was that caused him to have invalid assumptions.

What are some great debugging posts that you have read in the past? (Maybe even something on Reddit or Hacker News) Share them in the comments!