Skip to content

Commit

Permalink
support for mms.ae and bump verison to 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
monde committed Nov 7, 2008
1 parent fb6693b commit 30fdc63
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 8 deletions.
5 changes: 5 additions & 0 deletions History.txt
@@ -1,3 +1,8 @@
### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert

* 1 minor enhancement
* added mms.ae support

### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth)

* 2 minor enhancments
Expand Down
3 changes: 3 additions & 0 deletions Manifest.txt
Expand Up @@ -9,6 +9,7 @@ conf/bellsouth.net.yml
conf/mediamessaging.o2.co.uk.yml
conf/messaging.nextel.com.yml
conf/mms.3ireland.ie.yml
conf/mms.ae.yml
conf/mms.alltel.com.yml
conf/mms.att.net.yml
conf/mms.dobson.net.yml
Expand Down Expand Up @@ -75,6 +76,7 @@ test/fixtures/luxgsm-image-01.mail
test/fixtures/maroctelecom-france-mms-01.mail
test/fixtures/mediamessaging_o2_co_uk-image-01.mail
test/fixtures/mmode-image-01.mail
test/fixtures/mms.ae-image-01.mail
test/fixtures/mms.mycricket.com-pic-and-text.mail
test/fixtures/mms.mycricket.com-pic.mail
test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail
Expand Down Expand Up @@ -132,6 +134,7 @@ test/test_messaging_nextel_com.rb
test/test_messaging_sprintpcs_com.rb
test/test_mms2r_media.rb
test/test_mms_3ireland_ie.rb
test/test_mms_ae.rb
test/test_mms_alltel_com.rb
test/test_mms_att_net.rb
test/test_mms_dobson_net.rb
Expand Down
1 change: 1 addition & 0 deletions README.txt
Expand Up @@ -49,6 +49,7 @@ Corpus of carriers currently processed by MMS2R:
* Sprint: pm.sprint.com, messaging.sprintpcs.com
* T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk
* TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com
* UAE MMS: mms.ae
* Unicel: unicel.com, info2go.com
(note: mobile number is tucked away in a text/plain part for unicel.com)
* Verizon: vzwpix.com, vtext.com
Expand Down
5 changes: 5 additions & 0 deletions conf/mms.ae.yml
@@ -0,0 +1,5 @@
---
ignore:
application/smil:
- /^pres\.smil/i

2 changes: 1 addition & 1 deletion lib/mms2r.rb
Expand Up @@ -39,7 +39,7 @@ class MMS2R::Media
##
# MMS2R library version

VERSION = '2.1.2'
VERSION = '2.1.3'

end

Expand Down
14 changes: 7 additions & 7 deletions mms2r.gemspec

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions test/fixtures/mms.ae-image-01.mail
@@ -0,0 +1,45 @@
Delivered-To: tommy.tutone@example.com
Received: by 10.150.52.17 with SMTP id z17cs418249ybz;
Sun, 19 Oct 2008 08:25:15 -0700 (PDT)
Received: by 10.67.116.8 with SMTP id t8mr1482898ugm.57.1224429913824;
Sun, 19 Oct 2008 08:25:13 -0700 (PDT)
Return-Path: <+2068675309@mms.ae>
Received: from domail2.emirates.net.ae (domail2.emirates.net.ae [213.42.1.94])
by mx.google.com with ESMTP id k27si2760421ugd.20.2008.10.19.08.25.12;
Sun, 19 Oct 2008 08:25:13 -0700 (PDT)
Received-SPF: softfail (google.com: domain of transitioning +2068675309@mms.ae does not designate 213.42.1.94 as permitted sender) client-ip=213.42.1.94;
Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning +2068675309@mms.ae does not designate 213.42.1.94 as permitted sender) smtp.mail=+2068675309@mms.ae
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_p5dJ87KpgxrrG0Dfvu/kYQ)"
Received: from dpmail4.emirates.net.ae ([213.42.3.217])
by domail2.emirates.net.ae (I&ES Mail Server 4.2)
with ESMTP id <0K8Z00MO0S48DH00@domail2.emirates.net.ae> for
tommy.tutone@example.com; Sun, 19 Oct 2008 19:24:08 +0400 (GST)
Received: from mms.ae ([195.229.243.167]) by dpmail4.emirates.net.ae
(I&ES Mail Server 4.2) with SMTP id <0K8Z00L51ASLJ320@dpmail4.emirates.net.ae>
for tommy.tutone@example.com; Sun, 19 Oct 2008 19:24:24 +0400 (GST)
Date: Sun, 19 Oct 2008 19:24:24 +0400 (GMT)
From: +2068675309@mms.ae
To: tommy.tutone@example.com
Message-id: <48FB5115.006B87.11159@mmrl02>
X-Mailer: HUAWEI EmailGateway 1.0
X-Mms-Message-ID: 101919242497100101339
X-Mms-Message-Class: Personal
X-Mms-Priority: Normal


--Boundary_(ID_p5dJ87KpgxrrG0Dfvu/kYQ)
Content-type: image/jpeg; name=19102008.jpg
Content-transfer-encoding: Base64
Content-disposition: inline; filename=19102008.jpg
Content-Location: 19102008.jpg

/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAXQ3JlYXRl
ZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcMCAcHBwcPCwsJDBEPEhIRDxER
ExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEFBQUHBgcOCAgOHhQRFB4eHh4e
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e/8AAEQgAAQAB
AwEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAH/8QAFBABAAAAAAAAAAAAAAAAAAAA
AP/EABUBAQEAAAAAAAAAAAAAAAAAAAcI/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQAC
EQMRAD8AlgA6WW//2Q==

--Boundary_(ID_p5dJ87KpgxrrG0Dfvu/kYQ)--
46 changes: 46 additions & 0 deletions test/test_mms_ae.rb
@@ -0,0 +1,46 @@
require File.join(File.dirname(__FILE__), "..", "lib", "mms2r")
require File.join(File.dirname(__FILE__), "test_helper")
require 'test/unit'
require 'rubygems'
require 'mocha'
gem 'tmail', '>= 1.2.1'
require 'tmail'

class TestMmsAe < Test::Unit::TestCase
include MMS2R::TestHelper

def test_only_valid_content_should_be_retained_for_mms_with_image_and_text
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join)
mms = MMS2R::Media.new(mail)
assert_equal 1, mms.media.size
assert_equal 1, mms.media['image/jpeg'].size
assert_file_size(mms.media['image/jpeg'].first, 337)
assert_match(/19102008.jpg$/, mms.media['image/jpeg'].first)
mms.purge
end

def test_number_should_return_correct_number
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join)
mms = MMS2R::Media.new(mail)
number = mms.number()
assert_equal number, "+2068675309"
mms.purge
end

def test_subject_should_return_correct_subject
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join)
mms = MMS2R::Media.new(mail)
assert_equal "", mms.subject
mms.purge
end

def test_attachment_should_return_jpeg
mail = TMail::Mail.parse(load_mail('mms.ae-image-01.mail').join)
mms = MMS2R::Media.new(mail)
image = mms.default_media
assert_equal 337, image.size
assert_equal "19102008.jpg", image.original_filename
mms.purge
end

end

0 comments on commit 30fdc63

Please sign in to comment.