Page 2 of 2

Re: Stopping Spam Idea

Posted: Sun Feb 17, 2008 11:37 pm
by Bill H
What is the goal of this discussion?
How about simply being a worthwhile mental exercise? I have found the conversation interesting, and it has made me think a bit. Seems like a sufficient purpose in and of itself.

Re: Stopping Spam Idea

Posted: Tue Feb 19, 2008 8:06 pm
by Chris Corbyn
I hadn't chimed into this thread until now but just in case you're not aware of it, RFC 2046 defines a "message/external" content type.

The standard content-type is message/rfc822 since it renders a message according to RFC 822 (or more recently 2822). message/external actually "downloads" the message from a remote source which can be a remote mailbox, a file on disk or an FTP site for example. Other sources could be implemented easily enough. The way it works is by sending only the headers and when opened the mail client downloads the content from the remote source.

Re: Stopping Spam Idea

Posted: Tue Feb 19, 2008 8:09 pm
by Benjamin
Chris Corbyn wrote:I hadn't chimed into this thread until now but just in case you're not aware of it, RFC 2046 defines a "message/external" content type.

The standard content-type is message/rfc822 since it renders a message according to RFC 822 (or more recently 2822). message/external actually "downloads" the message from a remote source which can be a remote mailbox, a file on disk or an FTP site for example. Other sources could be implemented easily enough. The way it works is by sending only the headers and when opened the mail client downloads the content from the remote source.
I wonder how many mail clients actually support that.

Re: Stopping Spam Idea

Posted: Tue Feb 19, 2008 8:11 pm
by Chris Corbyn
astions wrote:
Chris Corbyn wrote:I hadn't chimed into this thread until now but just in case you're not aware of it, RFC 2046 defines a "message/external" content type.

The standard content-type is message/rfc822 since it renders a message according to RFC 822 (or more recently 2822). message/external actually "downloads" the message from a remote source which can be a remote mailbox, a file on disk or an FTP site for example. Other sources could be implemented easily enough. The way it works is by sending only the headers and when opened the mail client downloads the content from the remote source.
I wonder how many mail clients actually support that.
Never tested it, but I'm going to :)

EDIT | RFC 2046 is not a small-time non-important RFC by the way... it's the second in a series of 5 major RFCs which define MIME message structures.

Re: Stopping Spam Idea

Posted: Wed Feb 20, 2008 3:16 am
by mpetrovich
RFC 2046 defines a "message/external" content type.
I wonder how many mail clients actually support that?
Never tested it, but I'm going to
Well this is pretty fascinating. So, after a few hours of research, I sent myself a message using using "message/external" headers. I sent this to Thunderbird and a SquirrelMail Webmail account. What I got was the text file with the parameters for the "message/external" header. In Thunderbird and SquirrelMail, it came in as an attachment. In this case I used an Anonymous FTP as the access-type, although my test target did not really exist. I was wanting to see if I would get an error or it would try to find it, or give me a notice. Either this might not be supported yet, or my headers were not correct.

Re: Stopping Spam Idea

Posted: Wed Feb 20, 2008 4:11 am
by Chris Corbyn
mpetrovich wrote:Either this might not be supported yet, or my headers were not correct.
If you post here I'd be willing to help you out :)

Re: Stopping Spam Idea

Posted: Wed Feb 20, 2008 1:56 pm
by mpetrovich
Here is the code I used, with the php mail function. I started with using anon-ftp as the access type as a test. The first example gives me the name, site, access-type, and directory as a text attachment.

Code: Select all

 
    $MailCR = "\n";
    $headers  = 'From: Me <me@mydomain.com>'.$MailCR;
    $headers .= 'MIME-Version: 1.0'.$MailCR;
    $headers .= 'Content-Type: Message/External-body'.$MailCR;
    $headers .= 'name="myfile.txt"'.$MailCR;
    $headers .= 'site="mydomain.com"'.$MailCR;
    $headers .= 'access-type="anon-ftp"'.$MailCR;
    $headers .= 'directory="testmail"'.$MailCR;
    $mymail = mail('dest@yourdomain.com', "Test External Mail", '', $headers);
 
There is also an access-type="URL" which actually might be better to use (RFC 2017). I have been trying that as well. If I could use URL="http://mysite.com/messages/message.php?m=messageid" I could do some cool stuff. As configured, this just gives me the same thing. Although, the URL is rendered as a link by the e-mail program.

Code: Select all

 
    $headers  = 'From: Me <me@mydomain.com>'.$MailCR;
    $headers .= 'MIME-Version: 1.0'.$MailCR;
    $headers .= 'Content-Type: Message/External-body'.$MailCR;
    $headers .= 'access-type=URL'.$MailCR;
    $headers .= 'URL="http://mysite.com/messages/test.txt"'.$MailCR;
    $headers .= 'size=748'.$MailCR;
    $mymail = mail('dest@yourdomain.com', "Test External Mail", '', $headers);
 

Re: Stopping Spam Idea

Posted: Wed Feb 20, 2008 3:26 pm
by Chris Corbyn
Without studying your headers any closer than structurally, they're invalid ;) When lines wrap in a singe headers they need some linear whitespace in front of the wrapped sections, and semi-colons before each parameter.

Code: Select all

$MailCR = "\n";
    $headers  = 'From: Me <me@mydomain.com>'.$MailCR;
    $headers .= 'MIME-Version: 1.0'.$MailCR;
    $headers .= 'Content-Type: message/external-body;'.$MailCR;
    $headers .= ' name="myfile.txt";'.$MailCR;
    $headers .= ' site="mydomain.com";'.$MailCR;
    $headers .= ' access-type="anon-ftp";'.$MailCR;
    $headers .= ' directory="testmail"'.$MailCR;
    $mymail = mail('dest@yourdomain.com', "Test External Mail", '', $headers);
I'd be a bit jubious as to whether the mail() function won't screw with those headers too.

Re: Stopping Spam Idea

Posted: Thu Feb 21, 2008 12:59 am
by mpetrovich
I fixed the headers per your instructions. I get the same response, so it must have been forgiving. I am wondering if the email programs simply display the message/external-body parameters and that is all there is.

Re: Stopping Spam Idea

Posted: Thu Feb 21, 2008 3:24 am
by Chris Corbyn
Yeah I tried a few approaches and couldn't get it working. You still had it a bit wrong according to the RFC (you need the content-type and a content-id header on the body headings). It sends the body as an attachment if you use external-body on the main message headers, but if you do this it just gives a blank screen:

Code: Select all

From: Chris Corbyn <chris@w3style.co.uk>       
To: chris@w3style.co.uk
MIME-Version: 1.0
Subject: External body test
Content-Type: multipart/mixed; boundary="_=_foo_=_"
 
--_=_foo_=_
Content-Type: message/external-body; access-type=anon-ftp; name="/test.txt";
 site=ftp.swiftmailer.org
Content-Transfer-Encoding: 7bit
 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-ID: <foobar123456@swiftmailer.org>
 
--_=_foo_=_--