pilerget fails to resolve attachment pointer; pileraget works

Issue #230 resolved
phofmann-smedia created an issue

When we retrieve a mail via pilerget, some attachments are missing:

$ pilerget 4000000052cd29df04d0335c00eae012ef21

...

Content-Type: image/gif; name=avatar_a1b25bc82413418af4be32e7a834295b
Content-Transfer-Encoding: base64
Content-ID: <avatar_a1b25bc82413418af4be32e7a834295b>
Content-Disposition: attachment; 
        filename=avatar_a1b25bc82413418af4be32e7a834295b

ATTACHMENT_POINTER_4000000052cd29df04d0335c00eae012ef21.a2_XXX_PILER

However, when we retrieve the attachment directly using pileraget, it works:

$ pileraget 4000000052cd29df04d0335c00eae012ef21 2
R0lGODlhMAAwAOffAB1clh9dlyBemCNeniJfmRdjoiVhmxlkoy9flSZinClhohtlpChjnTFhlx1m
pilknjNimB9npytlnzRjmSxloCFoqDVkmi1moSNpqTZlmy9noiRqqjdmnDBooyZrqzFppDponihs
...

We can also successfully download the attachment in question via the web application. The database looks fine to me as well:

mysql> select * from attachment where piler_id = '4000000052cd29df04d0335c00eae012ef21';
+------+--------------------------------------+---------------+-----------------------------------------+-----------+------------------------------------------------------------------+------+------+---------+
| id   | piler_id                             | attachment_id | name                                    | type      | sig                                                              | size | ptr  | deleted |
+------+--------------------------------------+---------------+-----------------------------------------+-----------+------------------------------------------------------------------+------+------+---------+
| 4520 | 4000000052cd29df04d0335c00eae012ef21 |             1 | attachment-icon                         | image/png | 591e4f31f531e78b25427b61203c43a8061a136b6523f33195a20ccd4d51930e | 1499 |    0 |       0 |
| 4521 | 4000000052cd29df04d0335c00eae012ef21 |             2 | avatar_a1b25bc82413418af4be32e7a834295b | image/gif | ab266241e989954438fe106a1e9e20b4241ae2dd5f4ef74d817effe614e8aa76 | 2455 |    0 |       0 |
+------+--------------------------------------+---------------+-----------------------------------------+-----------+------------------------------------------------------------------+------+------+---------+
2 rows in set (0.00 sec)

In turn, this leads to unverified mails. (We're not using PILERGETD, so the PHP application reads the output of pilerget.)

Note that this only affects some mails with attachments. Sometimes it works, sometimes it doesn't.

I already tried to debug the C code -- to no avail. I'll probably continue to do so, though.

We're using piler 0.1.24 on Ubuntu 12.04.

Any hints? I'll happily provide any missing information. :)

Comments (5)

  1. Janos SUTO repo owner

    Well, I'd like you to download the latest master branch (see the "Downloads" link above), compile it (but don't install it for now). Then go to the src directory, and run pilerget again:

    LD_LIBRARY_PATH=. ./pilerget 4000000052cd29df04d0335c00eae012ef21
    

    And let's see if it helps.

  2. Janos SUTO repo owner

    Well, 0.1.25 is on its way. Currently doing some gui enhancements, so I need some more time before releasing it. However in the meantime you are free to upgrade to the current master branch. So I recommend you to stop the piler daemon, perform a make install, upgrading the binaries then update the database schema, see the upgrade doc on the web page.

  3. Log in to comment