Forum: Ruby on Rails ActionMailer - Message-id issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dylan M. (Guest)
on 2006-03-29 21:51
(Received via mailing list)
Whenever I send e-mails through rails, part of the header comes out
as follows:

From: removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
Message-Id: <removed_email_address@domain.invalid>

With Outlook 2003 SP2's new "anti-phishing" feature, it's tagging all
of these e-mails as junk. I tried sending the same content from my
mail software, using the same e-mail addresses and everything. The
headers come out nearly identical, except that the Message-Id from my
mail software has @domain1.com at the end, not @iMac.local.tmail. I'm
assuming Outlook is comparing the From domain and the Message-id
domain, deciding they don't match, and marking it as junk.

My question is, is there a way to change the message id domain? I've
tried setting it manually using:

@headers = { 'message-id' => 'removed_email_address@domain.invalid'>

but it doesn't work, as the resulting e-mail message still has the
iMac.local.tmail domain.

Thanks!
Keith (Guest)
on 2006-06-16 16:50
I am having most email sent from ActionMailer get tagged as Junk (by Mac
Mail). I tried changing the id (which did not fix my problem) but maybe
it will for outlook.

locate your ActionMailer project files and edit utils.rb
(I am on a Mac and my path to the utils.rb is
/opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/utils.rb)

I commented out the first couple of lines and added the bottom one

Here is a snippet:
def TMail.new_message_id( fqdn = nil )
   #fqdn ||= ::Socket.gethostname
   #"<#{random_tag()}@#{fqdn}.tmail>"
   "<#{random_tag()}@yourdomainname.com>"
end

This did not fix my problem though. Simple text or simple emails get
tagged as junk, however, if you sent a larger html email with links to
external images, etc.. they do not get tagged as junk.

I think it probably has something to do with mime-types and scoring
systems. Hope this helps!

Dylan M. wrote:
> Whenever I send e-mails through rails, part of the header comes out
> as follows:
>
> From: removed_email_address@domain.invalid
> To: removed_email_address@domain.invalid
> Message-Id: <removed_email_address@domain.invalid>
>
> With Outlook 2003 SP2's new "anti-phishing" feature, it's tagging all
> of these e-mails as junk. I tried sending the same content from my
> mail software, using the same e-mail addresses and everything. The
> headers come out nearly identical, except that the Message-Id from my
> mail software has @domain1.com at the end, not @iMac.local.tmail. I'm
> assuming Outlook is comparing the From domain and the Message-id
> domain, deciding they don't match, and marking it as junk.
>
> My question is, is there a way to change the message id domain? I've
> tried setting it manually using:
>
> @headers = { 'message-id' => 'removed_email_address@domain.invalid'>
>
> but it doesn't work, as the resulting e-mail message still has the
> iMac.local.tmail domain.
>
> Thanks!
This topic is locked and can not be replied to.