Stopping Spam Idea

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: Stopping Spam Idea

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Stopping Spam Idea

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Stopping Spam Idea

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Stopping Spam Idea

Post 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.
mpetrovich
Forum Commoner
Posts: 55
Joined: Fri Oct 19, 2007 2:02 am
Location: Vancouver, WA, USA

Re: Stopping Spam Idea

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Stopping Spam Idea

Post 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 :)
mpetrovich
Forum Commoner
Posts: 55
Joined: Fri Oct 19, 2007 2:02 am
Location: Vancouver, WA, USA

Re: Stopping Spam Idea

Post 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);
 
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Stopping Spam Idea

Post 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.
mpetrovich
Forum Commoner
Posts: 55
Joined: Fri Oct 19, 2007 2:02 am
Location: Vancouver, WA, USA

Re: Stopping Spam Idea

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Stopping Spam Idea

Post 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_=_--
Post Reply