GMail will not open the .txt application created by the iPhone App, depending on size - I think there is an error in my MIME

I created aand sent a short email with the .txt app in the iPhone app.

  • If the attachment is about 10 lines long, GMail opens it just fine.

  • If it is more than 20 or so lines, GMail throttles - it will not open the attachment, will not load the attachment, or even send an email.

  • In addition, if I send the same letter to my colleague and he opens it with his Mac OS Mail client, everything will be fine.

For example, the contents of a text file (this length will be opened only in GMail):

ACCELEROMETER READINGS
-0.0724487,-0.941833,-0.235458,2009-07-11 15:18:46 -0700
-0.0724487,-0.941833,-0.271683,2009-07-11 15:18:47 -0700
-0.0724487,-0.923721,-0.253571,2009-07-11 15:18:48 -0700
-0.0543365,-0.923721,-0.326019,2009-07-11 15:18:49 -0700
-0.0724487,-0.959946,-0.181122,2009-07-11 15:18:50 -0700
-0.0543365,-0.923721,-0.253571,2009-07-11 15:18:51 -0700
-0.108673,-0.923721,-0.380356,2009-07-11 15:18:52 -0700
-0.0724487,-0.923721,-0.271683,2009-07-11 15:18:53 -0700

GPS READINGS

HEADING READINGS
211.421,2009-07-11 15:18:46 -0700
206.421,2009-07-11 15:18:49 -0700
184.421,2009-07-11 15:18:50 -0700
195.421,2009-07-11 15:18:51 -0700
198.421,2009-07-11 15:18:53 -0700

If the file is twice this size, GMail cannot handle it, but again Mail can. So what could be the problem? I created the letter as follows:

SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail = @"founders@gmail.com";
testMsg.toEmail = @"andrewljohnson@trailbehind.com";
testMsg.relayHost = @"smtp3.webfaction.com";
testMsg.requiresAuth = YES;
testMsg.login = @"andrewljohnson";
testMsg.pass = @"********";
testMsg.subject = @"iPhone Instrument Readings";
testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS!
testMsg.delegate = self;

NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:@"text/plain",kSKPSMTPPartContentTypeKey, @"Hey Kevin,\nHere are some GPS readings for you to filter.\n\nLove, \nTrailBehind",kSKPSMTPPartMessageKey,@"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
NSData *fileData = [NSData dataWithContentsOfFile:fileName];    
NSDictionary *attached = [NSDictionary dictionaryWithObjectsAndKeys:@"text/directory;\r\n\tx-unix-mode=0644;\r\n\tname=\"readings.txt\"",kSKPSMTPPartContentTypeKey, @"attachment;\r\n\tfilename=\"readings.txt\"",kSKPSMTPPartContentDispositionKey,[fileData encodeBase64ForData],kSKPSMTPPartMessageKey,@"base64",kSKPSMTPPartContentTransferEncodingKey,nil];

testMsg.parts = [NSArray arrayWithObjects:plainPart,attached,nil];
[testMsg send];
+1
6

[fileData encodeBase64ForData], encodeBase64ForDataWrapped, . , , , base64 -.

+1

WireShark, , . ( GMail) , , .

, - - , , GMail , SMTP- . , , , IMO.

IMAP- GMail - ?

+1

- pop.gmail.com smtp.gmail.com Mail Mac OS X.

+1

, ? , , , , GPS , , , , !

, - , , 4 ...

!

0

, MIME . MIME . , \r\n , CRNL . MIME, , , . , .

. , , .txt. , rx.

, , . , .

0

, , , MIME "text/directory", , . (. RFC)

, , , .txt text/directory MIME , - , , GPS- - .

, "text/directory" "text/plain"!

-1

Source: https://habr.com/ru/post/1712919/


All Articles