Skip to main content
Topic: "Missing Key" error on reply-email (Read 728 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

"Missing Key" error on reply-email

I have just updated to 1.1.8 (from 1.1.6). Now I'm willing to resolve an email-problem. Reply emails (post by email) can be viewd in the moderator view, but tagged with "Missing Key". Auto repair is not possible.

I'd suggest that the message-ID is shaped like this, visible in the email body when view "all headers and message" is activated.
Message-ID: <744f8fa1bfcf919a924dc845228ac5c5-20@forum.xxxxxx.yy>

I can see that the reply to the forum contains the same ID as the received notification.
I also experimented - without success - by copying the key into the message body directly, since a short code review tells me that the key is searched for in the header section as well as in the mail body.

Hint: Elkarte is not setup to operate with piping option since the mail server does not support this (I assume that piping is recommended simply because of no mailbox polling delay).
I think that the settings for this (in my case: POP3, TLS, port 110) is not specifically interesting, since the emails arrive and can be viewed in de moderate queue.

Is there any log that I can access in order to localize the cause of the problem?

Re: "Missing Key" error on reply-email

Reply #1

Could you attach a raw example message that fails so I can take a look at what may be happening? 

If it can't find an ID in the message no auto repair is possible, so that behavior is correct.

Re: "Missing Key" error on reply-email

Reply #2

Thanks for your reply. Elkarte could help me to achieve acceptance  in using a forum (at all) in a small group that communicates mainly via email. Just because Elkarte supports reply and post by email.

Here you are (ending .mbs changed  in .txt, further some details replaced by xxxxx).

EDIT: I have just activated "notity" on this thread - I'd be able to test reply by email using the same mail client.

Re: "Missing Key" error on reply-email

Reply #3

That message has no ElkArte post by email 'key' in it :(

The key is, in regex speak
Code: [Select]

This translates to a 32 alpha numeric string followed by a - followed by the letter p, t or m and then a sequence of numbers that correspond to the the specific P T or M ... the system will then check if that key was sent to the email that responded.  It will look


That email has the 32 characters, then the - but it NOT followed by a p, t, or m ??? I'm not sure how that is possible, but what it has is 79aaad41a2afc55bd3c1c17717fad46a-22 which will not process.  I'm not sure where to check TBH

Re: "Missing Key" error on reply-email

Reply #4

Hi, thanks for clarifying,
the message ID is in the header part. So as for test, I now reply without the copy of the message ID in the bode. Should work. This reply is by email. But it appears not to arrive. I just saw that the sender is a "noreply"-address. Hence, reply by email is not activated.

I'll try to analyze what's going wrong in my Elkarte forum setup. Apparently the key is not reflected to the header section as intended in notify emails.
Could you help point to the relevant code?

Re: "Missing Key" error on reply-email

Reply #5

Sorry I missed this post ... the key is added as part of the sendmail function which will be found in the mail.subs.php file

One the ElkArte side follow the information in this guide:

If the sent email has all the right headers (and there is no reason it should not as long as you have followed the above) then the problem would be with the email client that is responding.  Not all email clients are well behaved.

Re: "Missing Key" error on reply-email

Reply #6

I tried two different email-domain addresses, and also answered using not my desktop email-client but also webmail client.
Mail arrive still in moderation queue...

BTW: I see a function function mail_insert_key($message, $unq_head, $line_break) (line 785), which is declared as a "safety net for clients that strip out the message-id and in-reply-to headers".
Indeed, I see such a key - e.g.: ELK-d6aa927ccde3acc5826c9f88a7c6a874, but this is not part of the reply. But when I add this to the reply, it still remains in the moderation queue.

I think I'd add a log file entry where generated keys in mail_insert_key are stored - as an aid to find the final cause of the problem.

Re: \

Reply #7

Finally, I found out the problem in key generation (just in the last days I reentered this area).

Line 46 on Mail.subs.php seems to contain the problem (v. 1.1.8 ):
Code: [Select]
$maillist = !empty($modSettings['maillist_enabled']) && $from_wrapper !== null && $message_id !== null && $priority < 4 && empty($modSettings['mail_no_message_id']);
When I remove the from_wrapper test, the key is generated and the mail arrives in the forum.

Of course, the problem may also originate from the call of sendmail() without the wrapper argument, resp. a configuration setting that is related to wrapper.

It can clearly be seen that the security key is on the bottom of every email, enclosed by square brackets (would be helpful information into the appropriate wiki page.

Re: "Missing Key" error on reply-email

Reply #8

What settings do you have in the maillist area?  Could you take a screen shot and post that? 

Re: "Missing Key" error on reply-email

Reply #9

Here you are...

Re: "Missing Key" error on reply-email

Reply #10

Are you only wanting to support PM reply by email or all posts in general? 

Currently Allow posting to the forum by Email is not enabled.   I'll have to try that setting to see if how the code handles that condition, looks like improvements could be made.

I'll change my test site to use your settings and see what I get


Re: "Missing Key" error on reply-email

Reply #11

All posts in general. Just as Steeley wrote: a replacement for a classic distribution list.

BTW: I experienced - since it's operating now - that the post content in the notification email appears quite towards the bottom of the email (v.1.1.8 ).

QuoteSection with two links and then

The text of the reply is shown below:
The xxxx-Forum Team.
It would make more sense if the standard stuff would be below the posting content.
I see that in dev. 2.0 the standard stuff is better structured. As such predestined to appear to the bottom.

On top of the notification including a post, only the following text should appear before the posting content:
Quote=== automated email containing the following new posting from xxxx-Forum. You can reply to this posting or post a reply direclty in the forum - hints & links see bottom section ===

I doubt whether it is good or not to send notifications in html-formatted mails (as is the case with dev 2.0.

Re: "Missing Key" error on reply-email

Reply #12

You should be able to make outbound adjustments with edits to the Maillist.Templates  to make it what you need.

For the inbound email, that is where the Filters and Parsers come in to play.  The idea is to make what gets posted look like a post and not an email.

Filters run first, and you can do simple find and replace.

Parsers run after Filters and there you can define regex code with the goal of finding either the start of a signature or the start of a quoted message and cut the message at that point.  Of course that only works if they post above the original in the reply.

I have been working on about 6 generic parser regex codes that seem to handle a majority of cases.  I'll post those if interested.

Re: \

Reply #13

Quote from: Spuds – You should be able to make outbound adjustments with edits to the Maillist.Templates  to make it what you need.
Well, the templates section mentions the "template selection list". Hence, I'd believe that the template name is entered elsewhere, where it would be in effect for a specific outbound email class (in this case a "reply-by-email").
According to the header title of the templates section ("Custom bounce email templates"), templates seem only to be related to e.g. error bounce messages.

When I compare to filters resp. parser, a template name is merely optional. They are just simply active on all inbound emails.

Further to templates:
It's the recipient of a reply-by-email (trough notification active) who determines whether or not the posting appears in the email body - via a setting in the account preferences. Despite that, the template (on the admin settings) can indeed determine whether the posting appears e.g. on top of the email? When I inspect the list of template content shortcodes, I would expect a shortcode for "posting content" (to insert on a desired place in the text box "Notification Subject"