mime

Conversion from MimeMessage to byte array

感情迁移 提交于 2019-12-13 10:46:49
问题 I need to convert MimeMessage into byte array, but while converting some characters are not coded correctly. Code lookis like this: // message is MimeMessage ByteArrayOutputStream baos = new ByteArrayOutputStream(); message.writeTo(baos); byte[] bytes = baos.toByteArray(); This conversion doesn't work correctly, as output I'm receving wrong formatted email body: <html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en" lang=3D"en" > <body style=3D"background-color: #ffffff;" > ... 3D

Why can't insert my subject of gmail header info into a sqlite3 database?

风流意气都作罢 提交于 2019-12-13 04:56:09
问题 The code have been tested that all the message_id,uid,subject gmail header info can be inserted into my sqlite3 database. <?php $db='/home/email.db'; // function get_gmail can get all the message_id,uid,subject gmail header info. function get_gmail(){ $email_data=array(); $hostname = '{imap.gmail.com:993/imap/ssl}'; $username = 'xxxx@gmail.com'; $password = 'yyyy'; $inbox = imap_open($hostname,$username,$password); $nums=imap_num_msg($inbox); for ($i=1;$i<=$nums;$i++){ $overview = imap_fetch

VERP and perl postfix not working

醉酒当歌 提交于 2019-12-13 04:34:43
问题 So I have a script that I'm trying to get VERP running correctly on. It's using MIME::Lite and postfix as the mail server. Here is the code: use strict; use MIME::Lite; use LWP::Simple; use Mail::Verp; my $email = 'someuser@somesite.com'; Mail::Verp->separator('+'); my $verp_email = Mail::Verp->encode('root@somesite.net', $email); my $content = '<html><body>Hi!</body></html>'; my $msg = MIME::Lite->new( Subject => 'Hi', From => 'root@somesite.net', To => $email, 'Return-Path' => $verp_email,

Custom MIME Type for PHP File

假装没事ソ 提交于 2019-12-13 02:36:47
问题 Okay, so I have a weird one for you all today. I'm looking into creating a custom MIME type for a .php file. I've read some pro's/con's on this and it won't be for much other than some experimentation to see what can really be done. My company's initials are TTP and so we decided it'd be kinda fun to have all of our .php pages re-written to a custom .ttp extension. I've attempted my normal cPanel X route with adding it in, and I've also tried adding the change into the .htaccess file. It work

Mime / Base 64 encoding

余生颓废 提交于 2019-12-13 02:21:27
问题 I need a way to encode a string to Mime/Base64 in Delphi 7 and PHP These two encoders must be compatible :) 回答1: The unit EncdDecd has been included since Delphi 6; below are the Mime compatible base64 functions it contains. This cached post from FlexVN (the original post is not always on-line) explains how to do the base64 thing between PHP and Delphi using the EncdDecd unit. unit EncdDecd; interface uses Classes, SysUtils; procedure EncodeStream(Input, Output: TStream); procedure

Detecting language of email body

試著忘記壹切 提交于 2019-12-12 15:12:55
问题 I need to implement an automated email reply system. Here for the system i need to check the incoming emails and reply the email in the same language in which the email was received. How can i do such a thing , please suggest some ideas? Thanks in advance. Appending one more query: In the email headers there is one more header of the kind: Content-Type: text/plain; charset=ISO-8859-1 How good it can prove in determining the language of the email body? e.g (all headers taken out from gmail):

Mime Encoded-Word parsing in Objective-C

不羁的心 提交于 2019-12-12 14:23:42
问题 Do OS X or iOS provide an API to parse MIME Encoded-Word? These lovely strings: =?iso-8859-1?Q?=A1Hola,_se=F1or!?= Alternatively, is there a known open-source library that does this? 回答1: I took @NickolayO.'s answer, added base-64 support with QSStrings and shortened the code by using componentsSeparatedByString: and stringByReplacingOccurrencesOfString:withString: . I've made the code available on GitHub. Here's a snippet for convenience: @implementation NSString (MimeEncodedWord) - (BOOL)

Can attachments be in a nested multipart in MIME?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 12:15:55
问题 I know that each part of a multipart email message can be a multipart itself. Are attachments added only as top-level parts, or can they be in a nested multipart as well? For example of what I mean, here attachment1.doc is nested, while attachment2.doc would be a top-level part. multipart/mixed |---Title: text/plain |---Text content: text/plain |---Nested multipart: multipart/mixed | |--- attachment1.doc (BASE64) |---attachment2.doc (BASE64) I'm asking because I encountered this code from

MIME type check useless for file upload? (in particular, using the Javascript File API)?

柔情痞子 提交于 2019-12-12 12:05:41
问题 I've got a server script receiving an uploaded file from Javascript. Client-side, using a File object (from the W3C File API) and code similar to this line: if (file.type.indexOf("text") == 0) { ... } one can perform a check of the file type. Apparently, this uses a MIME type (which returns these strings). In my journeys here through SO, I ventured across this worthy contributor, who maintains that MIME types are useless. Are MIME types indeed basically useless in a file upload situation, and

HTTP: Illegal chunked encoding

岁酱吖の 提交于 2019-12-12 10:02:48
问题 I have a .NET client-application which uses a third-party library to access a server via http. The library throws the following error: The server committed a protocol violation. Section=ResponseBody Detail=Response chunk format is invalid The software is already installed dozens of times, so i think it must be an issue in the customers system, my suspicion is the proxy between. I have used Fiddler to get a first hint. While sniffing Fiddler notice a protocol violation: Illegal chunked