Menu

#2 No valid stamp detected

closed-fixed
5
2007-09-19
2007-09-05
No

Coming from https://bugzilla.mozilla.org/show_bug.cgi?id=229686 I installed pennypost, and sent two hashcash stamped mails to myself. Neither is displaying a valid stamp in my inbox, though the header is present and can be verified through the command line.

Maybe it's because my TB 2.0.0.6 displays only a time for mails from today, no date. And if it would display a date, that would be with dots, not slashes, as I'm in Germany. But disabling the date check didn't solve it either. I still don't understand what this date is used for. AFAIK TB just displays the time corresponding to the Date header, which can be easily faked. This is not a way to get at the time the mail was actually received. And if cou can get at the hashcash header, you should be able to get at the Date header as well and avoid those ugly hacks.

Discussion

1 2 > >> (Page 1 of 2)
  • Martin von Gagern

    Logged In: YES
    user_id=733620
    Originator: YES

    I should add that there is the "invalid stamp" icon in the header pane, and that clicking on it tells me the validity was unknown. So ppost is installed and active, it only doesn't parse its own headers, or so it would seem.

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-05

    Logged In: YES
    user_id=1476495
    Originator: NO

    This means that the stamp program is not responding in a timely fashion and crashes. Have you tried sending out stamped emails with pennypost and does that part work?
    Also what OS are you on?

     
  • Martin von Gagern

    Logged In: YES
    user_id=733620
    Originator: YES

    > Have you tried sending out stamped emails with pennypost and does that part work?

    Yes, that part works all right - after all, I was trying to verify my own stamps.

    > Also what OS are you on?

    Gentoo Linux.

    I constructed a wrapper around the pennypost jar executable, and found out that wrapper wasn't even called. The I restarted TB, and now it got called and even verified one stamp. If I switch to the second stamped mail, the stamp Icon is like invalid again, although the info box claims valid. It looks like I could click on any arbitrary mail now and get the same combination, an invalid icon and the box saying valid, no matter what the mail actually is. Timestamps tell me that ppost hasn't called the external program since.

    After some more experimenting it looks like this: ppost only ever runs on the first email selected after starting TB. If it is a stamped mail, the external program will be invoked, and the icon and dialog box will update accordingly. No matter whether the first mail selected is stamped or not, for any other mail selected, be it stamped of not, ppost won't run the external program again, will always display the invalid stamp icon, and always keep the info box as it was for the first selected mail. No messages are written to the error console.

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-05

    Logged In: YES
    user_id=1476495
    Originator: NO

    Dear Martin,
    Thanks for the update. I'll try to re-test the scenario on Ubuntu. In the mean time some things I think might help pin-point the problem:

    The wrapper you constructed wont be called if you use Java to launch the pennypost executable, because the extension will directly invoke java with tha jar path.

    Try putting in the path of your script in place of the stamp program and then uncheck "use java to lanch" option. This will treat the script you supply directly as an executable to be launched.
    You can use/modify the ppost launch script supplied in the same folder as the ppost.jar

    Also even before a stamp is verified externally, pennypost tries to fill in as much info as possible into the stamp info dialog. Try alternating between a hashcash and mbound stamped mail and see if you still see stale stamp info while the stamp is being verified?

    Thanks,
    Ali

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    Confirmed.

    I too have sent a few messages from one of my email accounts to another:

    * Hash was calculated
    * headers were added

    But no stamp was detected

    Lance

     
  • Martin von Gagern

    Logged In: YES
    user_id=733620
    Originator: YES

    I already disabled Java to get the wrapper working, that should be all right.
    BTW, why doesn't the program by default simply use the java binary from the current PATH, if one is available?

    I now sent myself an mbound-stamped mail, and still the info dialog claims it's valid hashcash. So I guess it's the plugin itself, not only the invocation of the external program, that doesn't execute any more. Although stamping while it is in this state does work. Are TB Add-ons reentrant?

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-05

    ppost.js with debug errors switched on

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-05

    Logged In: YES
    user_id=1476495
    Originator: NO

    Hi,
    It seems i was unable to re-create this error on ubuntu and centos.
    I'm attaching a new copy of the file that makes calls to the external program with some debug code in. It should log errors to the console now.

    If you could drop the file (replacing existing one) into the chrome\content folder where the extension is installed (and this is in the parent of the folder you see when you click autodetect for the ppost.jar) and then try, it should log any errors to the error console.
    File Added: ppost.js

     
  • Martin von Gagern

    Logged In: YES
    user_id=733620
    Originator: YES

    Hi Ali!

    OK, no debug output from your modifications. But I got bold, added lots of debug messages, and traced the issue back to show_headers. This gets set to 2 once at the beginning, is reset to 1 after the first mail has been checked, and stays at 1 ever after, with the result that ppost won't ever see the stamp headers again.

    Have you tried to reproduce this with show_headers=1?

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-06

    Logged In: YES
    user_id=1476495
    Originator: NO

    Hi Martin,

    I see you have come very close to the problem. Thanks for the effort on this one. Now there is a lot of code in messageWindowOverlay.js that we rely on thunderbird calling automatically and I suspect it does not.

    show_headers set to 1 is normal header mode and will not detect any stamps. 2 is all header mode. However the function msHdrViewload should be called "each time you open a new message" by Thunderbird setting show_headers to 2 and setting the stage. After which the function updateStamp() should be called next (again by thunderbird native code).

    I have added a few alerts to these functions and you should see the following alert boxes pop-up every time you open a message (which is what I see when I test).
    1. msHdrViewload called
    2. updateStamp called

    This should happen even if the message is not stamped at all.

    No exception alerts should get shown (though i've added them in)

    I'm attaching the file in. You already know where to find it in your install.

    Thanks,
    Ali
    File Added: messageWindowOverlay.js

     
  • Martin von Gagern

    Logged In: YES
    user_id=733620
    Originator: YES

    msHdrViewload is only called once here, and that is when TB (2.0.0.6 by the way) starts up, even before the first mail is displayed. Maybe this could have something to do with me using IMAP, I don't know.

    Anyway, you might perhaps wish to have a look at my favorite TB Add-on, enigmail. They are doing some similar stuff, and they have been around long enough now to be quite good at it. I had a quick look myself and can see that they have a handler for an event called beforeStartHeaders as part of their gMessageListeners collection. Their access to headers seems to be more controlled, though, by not requesting all headers but adding the headers that they need to a char pref called mailnews.headers.extraExpandedHeaders. Maybe ppost can do something similar?

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-06

    Logged In: YES
    user_id=1476495
    Originator: NO

    Hi Martin,
    Finally I've found the missing bit between our configurations.
    It seems there is a setting "mailnews.reuse_message_window" accessible through the config editor (Thunderbird Options - Advanced tab). It was set to true for me and I'm assuming it is set to false for you.

    For now the fix is to turn in on to true. In the mean time i'll explore your suggestions and see if I get get it working more reliably

    Thanks,
    Ali

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    mailnews.reuse_message_window was set to true on my system, so their seems more going on here than just that.

    Sorry,

    Lance

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-07
    • labels: --> Thunderbird Extension
    • assigned_to: nobody --> dimension7
     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-07

    messageWindowOverlay redone stamp detection

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-07

    Logged In: YES
    user_id=1476495
    Originator: NO

    Hi Lance and Martin,
    I've re-done the stamp detection bits.
    New messageWindowOverlay.js is attached. Drop it into chrome/content folder for the extension, replacing the existing file.

    Lance you can locate the extensions folder using the path displayed in Stamp program when you do auto detect.

    You'll need to restart thunderbird. Also enable Normal header mode from the view menu after restart.
    Let me know if this finally fixes it.

    Many Thanks,
    Ali
    File Added: messageWindowOverlay.js

     
  • Martin von Gagern

    Logged In: YES
    user_id=733620
    Originator: YES

    Hi Ali!

    Yes, your latest attachment does work, in that it now does verify my stamps, and update the icon for every new mail I select. The stamping headers were displayed in the header pane, but I got rid of that using extensions.enigmail.hideHeaders which hides foreign headers just as easily. It would be great if such common functionality could be shared among plugins, but I don't know how feasible this would be.

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    Could you please email me messageWindowOverlay.js? You might want to repost it too. Something very, very weird is happening when I try to download it. I can download ppost.js just fine, but messageWindowOverlay.js just confuses my downloader--the % complete keeps bouncing all over the place. Firefox just ignores the request. Very odd.

    Thanks,

    Lance
    Lance@TheHaverkamps.net

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    The server issue has cleared, I can download the patch. I closed T'bird & drug the file into the extension's chrome folder then answered "overwrite". I then started T'bird and wrote myself an email from one account to the other....No stamp was detected...with either full or normal headers.

    Upon checking the email headers:
    x-hashcash:1:20:070907:Lance@TheHaverkamps.net::1a1bc1fbd9751a53:4229d2de
    x-stampprotocols: mbound:0:10:3000:5000;hashcash:1:17

    The stamp was, in fact, there.

    Could you verify that the correct messageWindowOverlay.js md5 hash is bbbcfc25f857a09acea4c82b30b7fb72 ?

    Sorry,

    Lance

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-07

    uploaded again for Lance. MD5 ce54c1e29e0e3ffcceed8366f40706c6

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-07

    Logged In: YES
    user_id=1476495
    Originator: NO

    Hi Lance,
    the MD5 i'm getting is ce54c1e29e0e3ffcceed8366f40706c6, probably because i may have change the file a bit again. I'm attaching it in again.

    The fact that you can now see the headers tell me that
    1. you have correctly replaced the old file
    2. My code is working (at least partly) for you ensureStampExtraHeaders() and msHdrViewload() is definitely getting called.

    There are a couple of things that you could do if the new file still gives trouble:
    1. Double check if your email address entered is in the extensions config under general settings (I know this sounds silly but it will save you a lot of effort just in case...)
    2. Check the error console for any evident errors
    3. You can add javascript alert statements of the form
    alert('<function> called');
    (dont forget the terminating semi-colon) in some functions in the messageWindowOverlay.js and find out where things are going wrong.
    The function you should focus on are updateStamp(), getMyValidEmails(), getCorrectHeader() - if you read through my comments in these functions you will get a fair idea of whats going on there.

    If your alert is not shown it means there was an error either at you alert (because you forgot a closing quote or semi-colon) or before it.

    You will need to restart thunderbird after any changes you make to the file (yes I know this can be very annoying...)

    Let me know what your findings.

    Thanks,
    Ali
    File Added: messageWindowOverlay.js

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    Hi,

    Something is getting messed-up somewhere. I am still mostly unable to download that file on my MEPIS/Ubuntu machine, either the new or old version. I borrowed my son's WinXP box, which downloads it every time, but I'm getting a different MD5 hash:

    I'm getting: bbbcfc25f857a09acea4c82b30b7fb72 for the new file.
    You have: ce54c1e29e0e3ffcceed8366f40706c6 listed for the new file.

    As earlier, I see the 2 lines of PPost headers in T'bird, but PPost never detects the stamp.

    I can read most of the file...I wonder if something simple, like "end-of-file" is getting cut-off?

    Try emailing me the file so I can see if sourceforge is cutting-off something, Lance@TheHaverkamps.net

    Lance

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    Progress!

    OK, There was a difference in the messageWindowOverlay.js file content. After what should have been the end of the file I kept getting a line with some spaces & tabs followed by a carriage return or two. After deleting those extra lines the MD5 hash matches what you say it should be. No idea what's causing this.

    On further investigation (which you recommended earlier) I find the email addresses are CASE SENSITIVE. If Bob sets his configuration email as Bob@xyz.com, but someone sends email to bob@xyz.com, no stamp is detected. That's a problem, as the receiver has no control over how over how the sender types the address; BOB@xyz.com, bob@xyz.COM or Bob@XYZ.COM will all fail.

    Also, all stamps are now displaying as stale unless I turn-off date validation. I use American in both T'bird & Linux, I've tried setting PPost to American, European & ISO...all show stale. Only turning-off date validation shows "good" stamp.

    Lance

     
  • Ali Lokhandwala

    Ali Lokhandwala - 2007-09-09

    Logged In: YES
    user_id=1476495
    Originator: NO

    Hi Lance,
    Thanks for the update. Your effort is much appreciated. I'll fix the case sensitivity issue in the next release. Infact I'm enabling regular expressions search in emails that will eliminate that issue automatically.

    Regarding the date issue, can you please:
    1. Send me the date you see for any email received today (usually you should only see time, no date)
    2. Send me date you see on any email received in the past. (if possible check on both windows and unix)
    3. Send me copy of a penny post generated stamp on your system.

    If you wish to investigate this further by yourself the function to look at is localVerify(). You will see date parsing logic near the middle part of the function.

    Thanks,
    Ali

     
  • Lance W. Haverkamp

    Logged In: YES
    user_id=1271859
    Originator: NO

    Hi,

    Here's a full set of headers for a stamped message from one f my accounts to another, it will show date & stamp.

    Further below that is an older (unstamped) set of headers.

    I don't use Windows on this machine...my son's machine has XP, let me know if information from his setup would help.

    From - Sat Sep 8 20:07:37 2007
    X-Account-Key: account2
    X-UIDL: UID2013-1184696421
    X-Mozilla-Status: 0001
    X-Mozilla-Status2: 00000000
    X-Mozilla-Keys:
    Return-path: <Lance@SpringsChurch.net>
    Envelope-to: Lance@TheHaverkamps.net
    Delivery-date: Sat, 08 Sep 2007 22:07:25 -0400
    Received: from [71.211.31.108] (port=64388 helo=[192.168.1.10])
    by amelia.asmallorange.com with esmtpsa (TLSv1:AES256-SHA:256)
    (Exim 4.66)
    (envelope-from <Lance@SpringsChurch.net>)
    id 1IUCCr-0000NG-2E
    for Lance@TheHaverkamps.net; Sat, 08 Sep 2007 22:07:25 -0400
    Message-ID: <46E35558.4010806@SpringsChurch.net>
    Date: Sat, 08 Sep 2007 20:07:20 -0600
    From: "Lance W. Haverkamp" <Lance@SpringsChurch.net>
    User-Agent: Thunderbird 2.0.0.6 (X11/20070728)
    MIME-Version: 1.0
    To: "Lance W. Haverkamp" <Lance@TheHaverkamps.net>
    Subject: time & date
    X-Enigmail-Version: 0.95.3
    x-mbound:0:12:3000:070908:Lance@TheHaverkamps.net::773b919f79c209bf:e55a1d3d
    x-stampprotocols: mbound:0:10:3000:5000;hashcash:1:17
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 7bit

    Here's the older one:

    From - Fri Sep 7 10:03:08 2007
    X-Account-Key: account2
    X-UIDL: UID1962-1184696421
    X-Mozilla-Status: 0001
    X-Mozilla-Status2: 00000000
    X-Mozilla-Keys:
    Return-path: <john.weigel@juno.com>
    Envelope-to: lance@thehaverkamps.net
    Delivery-date: Fri, 07 Sep 2007 11:59:44 -0400
    Received: from m28.lax.untd.com ([64.136.30.91]:59364)
    by amelia.asmallorange.com with smtp (Exim 4.66)
    (envelope-from <john.weigel@juno.com>)
    id 1ITgF8-0004gr-5O
    for lance@thehaverkamps.net; Fri, 07 Sep 2007 11:59:44 -0400
    Received: from m28.lax.untd.com (localhost [127.0.0.1])
    by m28.lax.untd.com with SMTP id AABDQC7LXABHXFKA
    for <lance@thehaverkamps.net> (sender <john.weigel@juno.com>);
    Fri, 7 Sep 2007 08:59:17 -0700 (PDT)
    X-UNTD-OriginStamp: rSeOzE6CKoVjJGZolh37Tlf7FKkfBYuOlmVggBb1Sq7tdHHGHMh3yg==
    Received: (from john.weigel@juno.com)
    by m28.lax.untd.com (jqueuemail) id MW2Z7H22; Fri, 07 Sep 2007 08:59:00 PDT
    To: lance@thehaverkamps.net
    Date: Fri, 7 Sep 2007 09:28:41 -0600
    Subject: CELL Phone "Do Not Call" list
    Message-ID: <20070907.095836.-192145.10.john.weigel@juno.com>
    X-Mailer: Juno 5.0.33
    MIME-Version: 1.0
    Content-Type: multipart/alternative; boundary=--__JNP_000_0bbf.44db.75d6
    X-Juno-Line-Breaks: 8-6,7,9-10,12-16,17-32767
    From: John Weigel <john.weigel@juno.com>
    X-ContentStamp: 3:5:2155302756
    X-UNTD-Peer-Info: 127.0.0.1|localhost|m28.lax.untd.com|john.weigel@juno.com
    X-Spam-Status: No, score=0.2
    X-Spam-Score: 2
    X-Spam-Bar: /
    X-Spam-Flag: NO

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.