Hello,

First I would like to say if I need to have this issue in Mailhandler or Mailcomment - I'm not sure where things are going wrong. I was following the directions here: http://drupal.org/node/1045918.

I'm not sure what details I should provide that would make this the most useful. Here are a few details:
Drupal version: 6.19
Mail comment version: 6.x-2.0-alpha6
OS: Centos 5.5
PHP: 5.2.13

Here is the export from my mailcomment feed parser:


$feeds_importer = new stdClass;
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'board_list_comments';
$feeds_importer->config = array(
  'name' => 'Board List Comments',
  'description' => 'Board list comment feed importer',
  'fetcher' => array(
    'plugin_key' => 'MailhandlerFetcher',
    'config' => array(
      'filter' => 'comments',
    ),
  ),
  'parser' => array(
    'plugin_key' => 'MailhandlerParser',
    'config' => array(
      'if_auth_fails' => 'remove',
      'default_commands' => 'status:1
taxonomy: [155]',
      'command_plugin' => array(
        'MailhandlerCommandsDefault' => 'MailhandlerCommandsDefault',
      ),
      'authenticate_plugin' => 'MailhandlerAuthenticateDefault',
    ),
  ),
  'processor' => array(
    'plugin_key' => 'FeedsCommentProcessor',
    'config' => array(
      'input_format' => 0,
      'update_existing' => 0,
      'expire' => -1,
      'mappings' => array(
        0 => array(
          'source' => 'parent_nid',
          'target' => 'nid',
          'unique' => FALSE,
        ),
        1 => array(
          'source' => 'parent_cid',
          'target' => 'pid',
          'unique' => FALSE,
        ),
        2 => array(
          'source' => 'subject',
          'target' => 'subject',
          'unique' => FALSE,
        ),
        3 => array(
          'source' => 'origbody',
          'target' => 'comment',
          'unique' => FALSE,
        ),
        4 => array(
          'source' => 'authenticated_uid',
          'target' => 'uid',
          'unique' => FALSE,
        ),
      ),
      'author' => 0,
    ),
  ),
  'content_type' => '',
  'update' => 0,
  'import_period' => '0',
  'expire_period' => 3600,
  'import_on_create' => 1,
);

Right now, every email that is imported gets created as a new node instead of a comment for an existing node.

Any help is appreciated. Thanks!

Sean

Comments

danepowell’s picture

I'm assuming that you're getting a notification (message) from the website, and replying to that message. You expect this reply to be posted as a comment, but it's posted as a new node. Is that right?

Does the notification message that you receive contain a Mail Comment signature in the body and/or threading information in the headers? A Mail Comment signature looks like "reply above this line to post attachments", and at the bottom of the body there should be a long URL that has the corresponding parent node ID, comment ID, and user ID encoded in it. The threading information should also be in an in-reply-to header, with this same encoded URL as a value.

pyrello’s picture

Dane,

Your assessment is correct.

Here is the raw output of the email (with identifiying details changed or omitted):

Delivered-To: sean@example.com
Received: by 10.231.182.85 with SMTP id cb21cs20572ibb;
        Sat, 7 May 2011 13:20:08 -0700 (PDT)
Received: by 10.100.215.12 with SMTP id n12mr3411000ang.154.1304799607864;
        Sat, 07 May 2011 13:20:07 -0700 (PDT)
Return-Path: <admin@example.com>
Received: from dev.example.com ([url omitted] [[ip omitted]])
        by mx.google.com with ESMTPS id w9si12655278anj.27.2011.05.07.13.20.06
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sat, 07 May 2011 13:20:06 -0700 (PDT)
Received-SPF: neutral (google.com: [ip omitted] is neither permitted nor denied by best guess record for domain of admin@example.com) client-ip=[ip omitted];
Authentication-Results: mx.google.com; spf=neutral (google.com: [ip omitted] is neither permitted nor denied by best guess record for domain of admin@example.com) smtp.mail=admin@example.com
Received: from localhost.localdomain ([127.0.0.1] helo=dev.example.com)
	by dev.example.com with esmtp (Exim 4.69)
	(envelope-from <admin@example.com>)
	id 1QInyu-0007Rw-T1
	for sean@example.com; Sat, 07 May 2011 15:20:04 -0500
Date: Sat, 7 May 2011 14:20:04 -0600
To: sean@example.com
From: Anonymous <admin@example.com>
Subject: Re: [CGIN] Starting a new thread
Message-ID: <0.7211.79.1304799604.34d4889f40190c058d8351783e195382@dev.example.com>
X-Priority: 3
X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
Errors-To: admin@example.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="b1_252e36548f602f55452ee118e36b13d8"
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - dev.example.com
X-AntiAbuse: Original Domain - example.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - example.com


--b1_252e36548f602f55452ee118e36b13d8
Content-Type: text/plain; charset = "utf-8"
Content-Transfer-Encoding: 8bit

Reply ABOVE THIS LINE to post to this thread
Greetings sean@example.com,
Comment by Sean: ???
???

Read more http://dev.example.com/node/7211#comment-79
--
This is an automatic message from CGIN To manage your subscriptions, browse  
to http://dev.example.com/user/5789/notifications You can  
unsubscribe at  
http://dev.example.com/notifications/unsubscribe/subscription/8?timestamp=1304799604&signature=ff77d34d48881b4dc1a3afa9187aab59
View original post:  
http://dev.example.com/mailcomment/redirect/%3C5789.7211.79.1304799604.eca06522d89e2bc81be8432a12529c78%40dev.example.com%3E


--b1_252e36548f602f55452ee118e36b13d8
Content-Type: text/html; charset = "utf-8"
Content-Transfer-Encoding: 8bit

Reply ABOVE THIS LINE to post to this thread<br>Greetings sean@example.com,<br>Comment by Sean: ???
	<p>???</p>
Read more http://dev.example.com/node/7211#comment-79<br><br><br>--<br>This is an automatic message from CGIN
To manage your subscriptions, browse to http://dev.example.com/user/5789/notifications
You can unsubscribe at http://dev.example.com/notifications/unsubscribe/subscription/8?timestamp=1304799604&signature=ff77d34d48881b4dc1a3afa9187aab59<br> View original post: http://dev.example.com/mailcomment/redirect/%3C5789.7211.79.1304799604.eca06522d89e2bc81be8432a12529c78%40dev.example.com%3E



--b1_252e36548f602f55452ee118e36b13d8--

I think that the items that you mention are included, but I am not sure.

Thanks for the prompt reply!

Sean

danepowell’s picture

When you reply to the message, what address are you replying to? I.e., what is the address of your Mailhandler mailbox? admin@example.com or something@dev.example.com? Note that in the Mail Comment configuration, the 'server string for message id' must match the domain of the receiving address.

pyrello’s picture

Does that include sub-domains? So, if my mailbox is at list@mail.example.com, my 'server string for message id' should be set to mail.example.com?

Thanks!

danepowell’s picture

That's exactly right. If your mailbox is mail.example.com, but your server string is example.com, that could be the cause of the failures.

danepowell’s picture

Status: Active » Postponed (maintainer needs more info)
pyrello’s picture

I changed it so that the server line domain and the mailhandler email address match up. The do not match the domain that the server is on (dev version). Any chance this is what is causing the issue?

Sean

danepowell’s picture

Actually, as I'm looking through the code, I realize that it's not utterly imperative that the 'Server string for Message ID' (Server String) match your domain name.

The Server String variable is used to create the Message-ID header, which, according to RFCs, should be universally unique. That's why you want to use a Server String that's unique to your Drupal installation- in most cases, that would be the domain name.

Thus, the Server String is embedded in all outgoing messages. Upon reply, the Server String is verified to ensure that the message is part of a thread that originated with your site. If you've changed the Server String variable in the meantime, note that this could cause messages to be handled incorrectly!

In conclusion: you should set your Server String to be the actual URL by which you access your Drupal installation, but keep in mind that changing this setting will invalidate any previously-sent Mail Comment emails.

Jhef.Vicedo’s picture

Version: 6.x-2.0-alpha6 » 6.x-1.0

Hi,

I get the email notification and retrieval to work, but comment via email fails. But I dont think retrieved messages contain the comment ID required for threading. I see this Message ID from the email headers:

In-Reply-To: <1.1401.0.1304762785.975670fd7a74c8abbb6edd4ee7900ce4@example.com>

I think that zero (0) is supposed to be the Comment ID.

Any help is much appreciated.

Thanks,

danepowell’s picture

Version: 6.x-1.0 » 6.x-2.0-alpha6

Jhef.Vicedo- please open a new issue. We are only dealing with the 6.x-2.x branch here. FYI, you are correct, the format is uid.nid.cid.time.signature@server string.

pyrello- I assume you're still having trouble? Have you tried beta1? Based on the message that you posted above, can you confirm that there is a user with uid 5789, node with nid 7211, and comment with cid 79? If so, then we can at least say that the problem is on the receiving side, not the sending side.

scarr’s picture

Subscribing

pyrello’s picture

Okay, so I have tried running the import just using my comment feed importer. I get the following error:
Unable create comment with empty NID
I don't know if this helps or not.

Thanks!

Sean

UPDATE: After a little digging, I have discovered that this error is generated from FeedsCommentProcessor.inc which is part of the feed_comment_processor module.

Another thing that I noticed is that when the message comes from the site, it has a message id like this:
Message-ID: <5789.7426.0.1307081625.c58f54a7623bfd2c8321376e26068745@mail.cgin.coop>
But the message that gets sent out from my email client (gmail), it looks like:
Message-ID: <BANLkTimtpEmcTUVuwXHymHMANJMbs8Ek-w@mail.gmail.com>
And the original message id is contained in a references section:
References: <5789.7426.0.1307081625.c58f54a7623bfd2c8321376e26068745@mail.cgin.coop>

Is that as it should be?

UDPATE #2: I have finally gotten this to work. It still does not work for all of my use cases, but I have gotten an email to be correctly added as a comment both in response to a node creation notification and a comment creation notification, but only in response to running the import for the comment feed processor. I'm going to open a separate issue for why it doesn't work when you run all the importers together during cron.

Thanks so much for all the help!

pyrello’s picture

Version: 6.x-2.0-alpha6 » 6.x-2.0-beta1
Status: Postponed (maintainer needs more info) » Fixed

Setting to fixed because it appears to just be my own confusion in setting this up as opposed to an actual issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.