Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Post By Email: Base64 Encoding?
Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Feb 1, 2013 - 10:10 pm

Hi guys, I was getting Failed Post Data Validation errors in the Toolbox/Email Post Log, and tracked it down to the validateData() function. Specifically, it fails on the No topic post has been entered and post cannot be saved branch of logic.

Strange that $this->newpost['postcontent'] would be empty, I thought, so traced it back to $content.

When I logged the $content of the email/post, it was clearly a Base64-encoded message. So I'm not 100% sure this is the root of the issue, since possibly the software is actually getting a different part of a multipart MIME message and using that, but thought I would ask if you've seen this. Any further guidance you can give me for what to check next?

Thanks!

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 2, 2013 - 4:41 am

One of the main concerns with this plugin is the large disparity and non-standard nature of email clients so let's start by asking what client you are using and is that using the php imap or pop code?

andy-signature.png
YELLOW
SWORDFISH
Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Feb 3, 2013 - 3:26 pm

Outlook 2010 is the client. PBE is using the IMAP code.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 4, 2013 - 5:44 am

Oh dear... I am going to have to check here if anyone has access to that and can try it out. I don't have it available myself. So - will need to run some tests I am afraid.

andy-signature.png
YELLOW
SWORDFISH
Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Feb 6, 2013 - 12:14 am

I have it working now. I will post the code soon (I have a ton of error logging in there from trying to figure out what was happening that I need to clean up first).

Do you guys use Github by chance for your source control? Just thinking this would be a perfect scenario for me to issue a pull request and then you guys could review my changes, and, if acceptable of course, merge them into your master branch at your leisure.

Anyway, the long and short of it is that the content-transfer-encoding parameter is rather important. :-)

And it may appear on the primary body part of the message, or if the primary body type is multipart, then you have to pick up the encoding from the TEXT/HTML part (since the code is fetching the body specifically from the 1.2 HTML part).

It will make more sense when you see the code, I am sure. Thanks!

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 6, 2013 - 2:57 am

No we do not use Github - we run our own svn server.

I am intrigued and eager to discover what you came up with. I did find this morning that one of my colleagues has been testing with OutLook - but the previous version - with what appeared to be success. I must also say that most of the code handling the gritty bits are actually modelled from either the WP post original or other third party apps.so this was quite a big learning curve for us.

Please do share. actually just sending a copy of your code file to 'support at simple-press dot com' would be great - I can run compares easily enough...

andy-signature.png
YELLOW
SWORDFISH
Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Feb 6, 2013 - 11:00 pm

I spent a bit of time cleaning up the code (and then retesting) to decompose the nested logic a bit...just to prevent my shooting myself in the foot later with that code, and also to make it more aesthetically pleasing for my own personal satisfaction. :-)

I sent it to you at the above given address--let me know if you don't get it and I'll get it to you somehow.

Thanks!

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 7, 2013 - 11:24 pm

it was received... Andy was unavailable today so will look at it tomorrow...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625