Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postmark::InvalidMessageError when attempting to send mail

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, "[email protected]"]

-- 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 => "[email protected]"

  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?

like image 823
Vitalyp Avatar asked Apr 24 '26 03:04

Vitalyp


2 Answers

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.

like image 129
Milan Gornik Avatar answered Apr 26 '26 19:04

Milan Gornik


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."

like image 35
Chris Fletcher Avatar answered Apr 26 '26 19:04

Chris Fletcher