3

I use Rails 3 + Postmark-Rails.

At first, I created account on postmarkapp.com to get my api key.

I Activated my signature by email link [for example, "vitalyp@dot.com"]

-- After that, I added this to application.rb

config.action_mailer.delivery_method   = :postmark
config.action_mailer.postmark_settings = { :api_key => "fdcb..." }

I use this method to send emails:

class UserMailer < ActionMailer::Base
  default :from => "vitalyp@dot.com"

  def do_my_mail(to, subj)
    mail(:to => to, :subject => subj)
  end

I get this error:

Postmark::InvalidMessageError
Sender signature not defined for From address.

Any ideas?

Bob Gilmore
  • 12,608
  • 13
  • 46
  • 53
Vitalyp
  • 1,069
  • 1
  • 11
  • 20
  • 1
    Did you add DKM and SPF records to your domain name? http://support.postmarkapp.com/customer/portal/articles/64739-what-is-dkim-and-spf-and-why-should-i-use-it- – Chris Fletcher Apr 12 '12 at 12:16
  • No, I skipped that step. Is it can be answer to my question? – Vitalyp Apr 12 '12 at 12:20
  • I think this is just recommendation: "In order to ensure effective email delivery, we highly recommend that you setup email authentication in your DNS records.." – Vitalyp Apr 12 '12 at 12:20

2 Answers2

5

SPF and DKIM are recommended, not required. However, sender signature is required (as stated in the documentation).

Are you sure you are using the same From address as the one used to create the sender signature? This can happen if you are using different email.

  • Maybe, I need use the **Sender Signature**, that match the Server domain? For example, if My Server domain is http://beer.com, the email signature should be 'ahoy@beer.com'? – Vitalyp Apr 13 '12 at 09:11
  • 1
    Actually, you must use exactly the same address as you defined signature for. If you defined sender signature for support@myapp.com, you can only send using From: support@myapp.com. If you want to use one address for several purposes, you can make them distinct by using + syntax. For example: support+foo@myapp.com and support+bar@myapp.com are valid addresses to use as From when you have signature defined for support@myapp.com – Milan Gornik Apr 13 '12 at 13:04
  • In addition, it is also possible to send using many different From addresses without defining sender signature for each. For example, if you are hosting forum and need to send on behalf of many users. In that case, contact Postmark support and support staff will lead you through the process of enabling that feature. – Milan Gornik Apr 13 '12 at 13:06
4

Postmark uses sender signatures to make sure you don't use their service for spam purposes:

From http://developer.postmarkapp.com: "Sender signatures are needed in order to verify that, well, you really own the mailbox, and that you are not a spammer (yes, we hate spam too). You must have a sender signature for each from address used in your application."

Chris Fletcher
  • 2,367
  • 1
  • 16
  • 19
  • Sorry, but I don't think that SPF and DKIM on my side is important. The error message is tell about "not defined signature". – Vitalyp Apr 12 '12 at 12:35
  • I already read the article "What is DKIM and SPF and why should I use it?" there http://support.postmarkapp.com/customer/portal/articles/64739-what-is-dkim-and-spf-and-why-should-i-use-it- , it says that DKIM and SPF are recommendation only – Vitalyp Apr 12 '12 at 12:36
  • 1
    I'm guessing that documentation page is a little outdated. Maybe sender signatures were just a recommendation at one point, but the developer homepage is pretty explicit that it's a requirement now. – Chris Fletcher Apr 12 '12 at 13:12