?
Solved

Interactive perl script

Posted on 2010-01-05
14
Medium Priority
?
870 Views
Last Modified: 2013-12-26
I am using one Perl program daily to test my MMS program. I need to make this Perl program interactive.
Program needs to ask
[1] Source Number (this number filled in the scripts
[2] Ask Destination number
[3] Date: needs options a) current date time b) User input
[3] X-Mms-Transaction-ID: and X-Mms-Message-ID:  suppose to same. We can fill Random String
[4] Other field is entry option or skips default

Here is my script and I giving description here:

[1] use strict;
[2] use Net::SMTP;

[3]# Mailhost
[4] my $smtp = Net::SMTP->new('127.0.0.1:5000',
[5]            Hello => 'fixeddoamin.com',    <--------------------------------This is fixed
[6]             Debug => 1 # turn it 1 to see std output,0 to not see it
[7]            );
[8]$smtp->mail('+SenderNumber/TYPE=PLMN@abctest.com');  <------SenderNumber required User Input, "/TYPE=PLMN@" is fixed and abctest.com is fixed(script needs skip and pur default doamin) or user Input
[9]$smtp->to('+RecipientNumber/TYPE=PLMN@Mydomain'); <-------------------RecipientNumber required User Input, "/TYPE=PLMN@" is fixed and abctest.com is fixed(script needs skip and pur default

[10]$smtp->data();
[11]$smtp->datasend('Date: Fri, 19 Jun 2009 15:52:59 -0700 (PDT) <----------------------Current date with this format or User Input showing with above format
[12]From: +SenderNumber/TYPE=PLMN <-------Line [8] Value will filled here
[13]Sender: +SenderNumber/TYPE=PLMN <-------Line [8] Value will filled here
[14]To: +RecipientNumber/TYPE=PLMN <-------Line [9] Value will filled here
[15]Subject: Test2 <--- User Input or Skip with default
[16]Mime-Version: 1.0 <--- User Input or Skip with default
[17]Content-Type: multipart/related; type="application/smil";
[18]        boundary="----=_Part_0_6662015.1212101578925";
[19]        start="<SMILTemplate_1.xml>"
[20]X-Mms-3GPP-MMS-Version: 5.5.0 <--- User Input or Skip with default
[21]X-Mms-Message-Type: MM4_forward.REQ <--- User Input or Skip with default
[22]X-Mms-Transaction-ID: "myid002" <--- User Input or Random string ---- Both are same
[23]X-Mms-Message-ID: "myid002" <--- User Input or Randon String--------Both are same
[24]X-Mms-Message-Class: Personal
[25]X-Mms-Ack-Request: Yes <--- User Input or Skip with default
[26]X-Mms-Delivery-Report: Yes <--- User Input or Skip with default
[27]X-Mms-Priority: Normal
[28]X-Mms-Read-Reply: No
[29]X-Mms-Originator-System: address@myfisrtdoamin.com <--- User Input or Skip with default

<------------------From here onwards all Fixed content------->
------=_Part_0_6662015.1212101578925
Content-Id: <SMILTemplate_1.xml>
Content-Type: application/smil;Name="123.smil"
Content-Location: SMILTemplate_1.xml
Content-Transfer-Encoding: base64

PHNtaWw+PGhlYWQ+PGxheW91dD48cm9vdC1sYXlvdXQgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48cmVnaW9uIGlk
PSJJbWFnZSIgbGVmdD0iMCIgdG9wPSIwIiB3aWR0aD0iMTYwIiBoZWlnaHQ9IjE2MCIvPjxyZWdpb24gaWQ9IlRleHQi
IGxlZnQ9IjAiIHRvcD0iMCIgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48L2xheW91dD48L2hlYWQ+PGJvZHk+PHBh
cj48aW1nIHJlZ2lvbj0iVGV4dCIgc3JjPSJpbWFnZWpwZWdfMS5qcGciLz48L3Bhcj48L2JvZHk+PC9zbWlsPg==
------=_Part_0_6662015.1212101578925
Content-Id: <imagejpeg_1.jpg>
Content-Type: image/jpeg;Name="imagejpeg_1.jpg"
Content-Location: imagejpeg_1.jpg
Content-Transfer-Encoding: base64
0
Comment
Question by:arvind
  • 10
  • 4
14 Comments
 
LVL 39

Expert Comment

by:Adam314
ID: 26180496
see code
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Net::SMTP;
use POSIX 'strftime';

my $SenderNumber = Ask('Enter SenderNumber: ', qr/^\d+$/);
my $RecipientNumber = Ask('Enter RecipientNumber: ', qr/^\d+$/);
my $DateType = Ask('Date (a=Use Current; b=Enter Manually): ', qr/^(aA|bB)$/);
my $DateString;
if($DateType =~ /a/) {$DateString = strftime('%a, %d %b %Y %H:%M:%S', localtime);}
else {$DateString = Ask('Enter Date: ', qr/\S/);}
my $Subject = Ask('Enter Subject: ', qr/\S/);


# Mailhost
my $smtp = Net::SMTP->new('127.0.0.1:5000',
	Hello => 'fixeddoamin.com',    <--------------------------------This is fixed
	Debug => 1 # turn it 1 to see std output,0 to not see it
	);
$smtp->mail("+$SenderNumber/TYPE=PLMN\@abctest.com");
$smtp->to("+$RecipientNumber/TYPE=PLMN\@Mydomain");

$smtp->data();
$smtp->datasend(qq{Date: $DateString
From: +$SenderNumber/TYPE=PLMN
Sender: +$SenderNumber/TYPE=PLMN
To: +$RecipientNumber/TYPE=PLMN
Subject: $Subject
Mime-Version: 1.0
Content-Type: multipart/related; type="application/smil";
  boundary="----=_Part_0_6662015.1212101578925";
  start="<SMILTemplate_1.xml>"
X-Mms-3GPP-MMS-Version: 5.5.0 <--- User Input or Skip with default
X-Mms-Message-Type: MM4_forward.REQ <--- User Input or Skip with default
X-Mms-Transaction-ID: "myid002" <--- User Input or Random string ---- Both are same
X-Mms-Message-ID: "myid002" <--- User Input or Randon String--------Both are same
X-Mms-Message-Class: Personal
X-Mms-Ack-Request: Yes <--- User Input or Skip with default
X-Mms-Delivery-Report: Yes <--- User Input or Skip with default
X-Mms-Priority: Normal
X-Mms-Read-Reply: No
X-Mms-Originator-System: address\@myfisrtdoamin.com <--- User Input or Skip with default
');

sub Ask {
	my ($String, $Re) = @_;
	while(1) {
		print $String;
		my $Input = <STDIN>;
		chomp($Input);
		return $Input if $Input =~ $Re;
		print "Invalid input!\n";
	}
}

Open in new window

0
 
LVL 5

Author Comment

by:arvind
ID: 26187683
Little modification I like here:

----Line 8 and 9 have fixed string "TYPE=PLMN@abctest.com" after 'Enter SenderNumber:" so final out of string willbe mail('+11111111/TYPE=PLMN@abctest.com');  
---Same for line 9.
--Line 37 and 38, can you generate some radon string, means next excute will have new string as System will reject this ID.
--Line 44 required user input
 
I will test this after you post the updated solution.
 
Thnx
0
 
LVL 39

Expert Comment

by:Adam314
ID: 26201640
>>Line 8 and 9 have fixed string...
This string is appended after whatever the user enters

>>Line 44 required user input
You don't have a line 44 in what you posted

>>Line 37 and 38, can you generate some radon string
This will generate a random string between 10 and 20 characters long, using characters between "0" (zero) and "z" (lowercase z).
  my $RandomString = '';
  for (1..(rand(10)+10)) {
      $RandomString .= chr(rand(74)+48);
  }
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Author Comment

by:arvind
ID: 26281585
I tried to execute this script but giving following. Can you please check and let me know ---where I need to tune it?

I am enclosing the final script, which I made with your guidance


Can't find string terminator "}" anywhere before EOF at arvind.pl line 26.
#!/usr/bin/perl 
use strict; 
use warnings; 
use Data::Dumper; 
use Net::SMTP; 
use POSIX 'strftime'; 
 
my $SenderNumber = Ask('Enter SenderNumber: ', qr/^\d+$/); 
my $RecipientNumber = Ask('Enter RecipientNumber: ', qr/^\d+$/); 
my $DateType = Ask('Date (a=Use Current; b=Enter Manually): ', qr/^(aA|bB)$/); 
my $DateString; 
if($DateType =~ /a/) {$DateString = strftime('%a, %d %b %Y %H:%M:%S', localtime);} 
else {$DateString = Ask('Enter Date: ', qr/\S/);} 
my $Subject = Ask('Enter Subject: ', qr/\S/); 
 
 
# Mailhost 
my $smtp = Net::SMTP->new('127.0.0.1:5000', 
        Hello => 'fixeddoamin.com',    
        Debug => 1 # turn it 1 to see std output,0 to not see it 
        ); 
$smtp->mail("+$SenderNumber/TYPE=PLMN\@abctest.com"); 
$smtp->to("+$RecipientNumber/TYPE=PLMN\@Mydomain"); 
 
$smtp->data(); 
$smtp->datasend(qq{Date: $DateString 
From: +$SenderNumber/TYPE=PLMN 
Sender: +$SenderNumber/TYPE=PLMN 
To: +$RecipientNumber/TYPE=PLMN 
Subject: $Subject 
Mime-Version: 1.0 
Content-Type: multipart/related; type="application/smil"; 
  boundary="----=_Part_0_6662015.1212101578925"; 
  start="<SMILTemplate_1.xml>" 
X-Mms-3GPP-MMS-Version: 5.5.0 
X-Mms-Message-Type: MM4_forward.REQ 
X-Mms-Transaction-ID: "$RandomString"
X-Mms-Message-ID: "$RandomString"
X-Mms-Message-Class: Personal 
X-Mms-Ack-Request: Yes 
X-Mms-Delivery-Report: Yes 
X-Mms-Priority: Normal 
X-Mms-Read-Reply: No 
X-Mms-Originator-System: address\@myfisrtdoamin.com <--- User Input or Skip with default 
'); 
 
sub Ask { 
        my ($String, $Re) = @_; 
        while(1) { 
                print $String; 
                my $Input = <STDIN>; 
                chomp($Input); 
                return $Input if $Input =~ $Re; 
                print "Invalid input!\n"; 
        } 
}


my $RandomString = '';
  for (1..(rand(10)+10)) {
      $RandomString .= chr(rand(74)+48);
  }

------=_Part_0_6662015.1212101578925
Content-Id: <SMILTemplate_1.xml>
Content-Type: application/smil;Name="123.smil"
Content-Location: SMILTemplate_1.xml
Content-Transfer-Encoding: base64

PHNtaWw+PGhlYWQ+PGxheW91dD48cm9vdC1sYXlvdXQgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48cmVnaW9uIGlk
PSJJbWFnZSIgbGVmdD0iMCIgdG9wPSIwIiB3aWR0aD0iMTYwIiBoZWlnaHQ9IjE2MCIvPjxyZWdpb24gaWQ9IlRleHQi
IGxlZnQ9IjAiIHRvcD0iMCIgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48L2xheW91dD48L2hlYWQ+PGJvZHk+PHBh
cj48aW1nIHJlZ2lvbj0iVGV4dCIgc3JjPSJpbWFnZWpwZWdfMS5qcGciLz48L3Bhcj48L2JvZHk+PC9zbWlsPg==
------=_Part_0_6662015.1212101578925
Content-Id: <imagejpeg_1.jpg>
Content-Type: image/jpeg;Name="imagejpeg_1.jpg"
Content-Location: imagejpeg_1.jpg
Content-Transfer-Encoding: base64

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgHCAgJCg0LCQoMCggI
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v/AIKXat41+JVp8M/2V/g1GNT+
KeuXU3jK9gQ5+y2GlQyzQ+ZwQvn3KokZPBeLafvCvo7/AIJ7WV5p/wDwRY+A9nf2s1jeRaFIJYLiIxyIftcxwVPIrq/g
b+zZB8LPj38Vviz4r8YXfxN+K/jnVH8/xDqNskL2GlJIfsmnQIvyoiIE3lQodlU4AVaAPzi+P2tfFT9oj/gix8S/2jfD
f7S93p3wx1Pwsj6x8KE8F6e8en3UIihvNPe9b/SVxcK7hjhtrLj5SK+pvht/ysBaZ/2afpP/AKe5KZ8c/wBjKLT/ANmj
9ry6+B66tdeIPi1okbf8IHHfwwaT/agl3TXcKyFUjlmG0sSwAIbqCoXY8C6HrGmf8HAFu19p1xbw237LumWM05jJiW4T
W5N0XmD5SwxnAPTnpQBJ+0J4P+LXwv8A+Cg2h/tefCjwlZ/FKwg8Ct4P8b+EJtTisL0WC3hvI7yxml+QyK5IaNiNwUAA
liyRX/7cviu78NiDwn+xt8cJfFU+2Ozi8V6Ba6DpBmc4QPqMtw0aqSRhgrZHavP/ANo/xJ+2v8Y/2Wfip8HNM/Yog07T
fEdjPpdp4jPxl0iTERf5Lj7M0aHlVB2FwRuxnivPfjIn7cvxZ/Yz8K/Cf/himDw//Yup6Le/2r/wuXR7jz/7Nnil2eVs
Tb5nlYzvO3dnDYwQD7c/ZK+DXjH4SfBLxvqPxJvNOn+JfxD8cX/jTxPaaLn7Bpt1eeWPssBPLqiRIC55LFuWGGP1PXyv
8JPix+094u+MsGjfFT9kyL4PeEWtZZJPEafFPTtbMcqjKR/ZoIVc7zxuzgd6+qKACiiigAooooAKKKKACiiigAooooAK
KKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo
ooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii
gAooooA//9k=
------=_Part_0_6662015.1212101578925--
.');

# Quit connection
$smtp->dataend();
$smtp->quit;

Open in new window

0
 
LVL 5

Author Comment

by:arvind
ID: 26281600
sorry line 44 will be like:

my xmmsorigsystem = Ask('X-Mms-Originator-System: ' , qr/^\d+$/);
0
 
LVL 39

Expert Comment

by:Adam314
ID: 26284544
Line 45 should be:
    });
Not:
    ');
0
 
LVL 5

Author Comment

by:arvind
ID: 26290297
errors while running the script:

Unrecognized escape \d passed through at arvind2.pl line 26.
Semicolon seems to be missing at arvind2.pl line 60.
Semicolon seems to be missing at arvind2.pl line 61.
Semicolon seems to be missing at arvind2.pl line 62.
Semicolon seems to be missing at arvind2.pl line 70.
Semicolon seems to be missing at arvind2.pl line 71.
Semicolon seems to be missing at arvind2.pl line 72.
Bareword found where operator expected at arvind2.pl line 76, near "9j"
        (Missing operator before j?)
Bareword found where operator expected at arvind2.pl line 76, near "4AAQSkZJRgABAQAAAQABAAD"
        (Missing operator before AAQSkZJRgABAQAAAQABAAD?)
Bareword found where operator expected at arvind2.pl line 76, near "2wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgHCAgJCg0LCQoMCggI"
        (Missing operator before wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgHCAgJCg0LCQoMCggI?)
Bareword found where operator expected at arvind2.pl line 78, near "Dg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCACWAJYDASIAAhEBAxEB"
  (Might be a runaway multi-line // string starting on line 77)
Bareword found where operator expected at arvind2.pl line 78, near "8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcI"
        (Missing operator before QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcI?)
Number found where operator expected at arvind2.pl line 81, near "qrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8"
  (Might be a runaway multi-line // string starting on line 79)
Bareword found where operator expected at arvind2.pl line 81, near "8QAHwEAAwEBAQEBAQEBAQAAAAAA"
        (Missing operator before QAHwEAAwEBAQEBAQEBAQAAAAAA?)
Number found where operator expected at arvind2.pl line 84, near "mJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9"
  (Might be a runaway multi-line // string starting on line 82)
Bareword found where operator expected at arvind2.pl line 84, near "9oADAMBAAIRAxEA"
        (Missing operator before oADAMBAAIRAxEA?)
Bareword found where operator expected at arvind2.pl line 87, near "KACiiigAooooAKKKKACiiigAooooAKKKKACiiigAor4k8cftG/F7xP8Atd"
  (Might be a runaway multi-line // string starting on line 85)
Bareword found where operator expected at arvind2.pl line 87, near "4TTxd4x1iWx0T"
        (Missing operator before TTxd4x1iWx0T?)
Bareword found where operator expected at arvind2.pl line 89, near "/4JUfB7x7471mTxD4u1nSJJ9S1GWKONrhxcyoGKxqqj5VUcAdK6H4P/ABrvPid"
        (Missing operator before ABrvPid?)
Bareword found where operator expected at arvind2.pl line 89, near "0X"
        (Missing operator before X?)
Semicolon seems to be missing at arvind2.pl line 89.
Bareword found where operator expected at arvind2.pl line 90, near "3AJ6ZoA"
        (Missing operator before AJ6ZoA?)
Bareword found where operator expected at arvind2.pl line 91, near "/+CyniTwL458B698HPCdn8H4tWtvBmvTWdxJJdnVjD/aCywZOGQmLYXx"
        (Missing operator before aCywZOGQmLYXx?)
Bareword found where operator expected at arvind2.pl line 91, near "6Jxz"
        (Missing operator before Jxz?)
Bareword found where operator expected at arvind2.pl line 94, near "8Aa4"
        (Missing operator before Aa4?)
Bareword found where operator expected at arvind2.pl line 95, near "/8ABMT4u/EXwXfx6R4x0LQDd6ddNAlwkMokRc7JFKuOT95fwrznwT8UvHer"
        (Missing operator before EXwXfx6R4x0LQDd6ddNAlwkMokRc7JFKuOT95fwrznwT8UvHer?)
Number found where operator expected at arvind2.pl line 96, near "/acuqvDJchgu4ExgLt3bcDpnmgD7Wor5q+O/7"
        (Missing operator before 7?)
Bareword found where operator expected at arvind2.pl line 96, near "7S2jfB3xd4X8CaF4O1v4tfGTxRHJL4d8D"
        (Missing operator before S2jfB3xd4X8CaF4O1v4tfGTxRHJL4d8D?)
Bareword found where operator expected at arvind2.pl line 97, near "/bW0GxbXvE37FdlqHh2MeZd2Hhf4oWl9q9tGOSUhaFVuXA/wCWcbAselAH3jRXlnwZ"
        (Missing operator before wCWcbAselAH3jRXlnwZ?)
Bareword found where operator expected at arvind2.pl line 98, near "/AIg+Aby4n0ieaS1urS/tjb3um3UTbZrW5hPMU0bcMvI5BBKkE"
        (Missing operator before tjb3um3UTbZrW5hPMU0bcMvI5BBKkE?)
Bareword found where operator expected at arvind2.pl line 98, near "9lv"
        (Missing operator before lv?)
Bareword found where operator expected at arvind2.pl line 99, near "18OfB3xn"
        (Missing operator before OfB3xn?)
Bareword found where operator expected at arvind2.pl line 100, near "/evESkZbYEWIHIGcgbdz4v7SXirXPhZ/wAFmfgp8W"
        (Missing operator before wAFmfgp8W?)
Bareword found where operator expected at arvind2.pl line 101, near "/2VP2lZIJozHIv/AAqScblIIIyJs9CaAPNf"
        (Missing operator before AAqScblIIIyJs9CaAPNf?)
Bareword found where operator expected at arvind2.pl line 102, near "/bn/aV1"
        (Missing operator before aV1?)
Bareword found where operator expected at arvind2.pl line 102, near "4e"
        (Missing operator before e?)
Bareword found where operator expected at arvind2.pl line 103, near "2JfAWn"
        (Missing operator before JfAWn?)
Bareword found where operator expected at arvind2.pl line 103, near "++BviV4"
        (Missing operator before BviV4?)
Number found where operator expected at arvind2.pl line 104, near "BviV4
5"
        (Missing semicolon on previous line?)
Bareword found where operator expected at arvind2.pl line 104, near "2DP8AvBXwuu"
        (Missing operator before DP8AvBXwuu?)
Bareword found where operator expected at arvind2.pl line 105, near "/Z+/Zq8F"
        (Missing operator before Zq8F?)
Number found where operator expected at arvind2.pl line 106, near "BmsfBaGGLW7bWbjVLK61VtXZpES
4"
        (Missing semicolon on previous line?)
Bareword found where operator expected at arvind2.pl line 106, near "4nmlYt5EUTbVbaAMgZJz5No"
        (Missing operator before nmlYt5EUTbVbaAMgZJz5No?)
Bareword found where operator expected at arvind2.pl line 106, near "4Jw6X4GTQ9S"
        (Missing operator before Jw6X4GTQ9S?)
Bareword found where operator expected at arvind2.pl line 108, near "/tG+O7O68Xa/fa7431XS9L0qx8"
  (Might be a runaway multi-line ff string starting on line 107)
        (Missing operator before a7431XS9L0qx8?)
Bareword found where operator expected at arvind2.pl line 108, near "8U"
        (Missing operator before U?)
Number found where operator expected at arvind2.pl line 109, near "BfHP7LumfB39o7wNoA8U6Ff6F4
21"
        (Missing semicolon on previous line?)
Bareword found where operator expected at arvind2.pl line 109, near "21XVdK1awcvAL61M8"
        (Missing operator before XVdK1awcvAL61M8?)
Bareword found where operator expected at arvind2.pl line 111, near "2V"
        (Missing operator before V?)
Bareword found where operator expected at arvind2.pl line 113, near "2jfD"
        (Missing operator before jfD?)
Bareword found where operator expected at arvind2.pl line 114, near "/SVxcK7hjhtrLj5SK+pvht/ysBaZ"
        (Missing operator before ysBaZ?)
Bareword found where operator expected at arvind2.pl line 114, near "2afpP"
        (Missing operator before afpP?)
Number found where operator expected at arvind2.pl line 115, near "ANmj
9"
        (Missing semicolon on previous line?)
Bareword found where operator expected at arvind2.pl line 115, near "9ry6"
        (Missing operator before ry6?)
Bareword found where operator expected at arvind2.pl line 116, near "0J4P"
        (Missing operator before J4P?)
Bareword found where operator expected at arvind2.pl line 117, near "/7cviu78NiDwn+xt8cJfFU+2Ozi8V6Ba6DpBmc4QPqMtw0aqSRhgrZHavP/ANo"
        (Missing operator before ANo?)
Bareword found where operator expected at arvind2.pl line 117, near "2v8Y"
        (Missing operator before v8Y?)
Bareword found where operator expected at arvind2.pl line 117, near "2Wfip8HNM"
        (Missing operator before Wfip8HNM?)
Bareword found where operator expected at arvind2.pl line 118, near "/Yz8K/Cf"
        (Missing operator before Cf?)
Number found where operator expected at arvind2.pl line 118, near "/Yup6Le/2"
        (Missing operator before 2?)
Bareword found where operator expected at arvind2.pl line 118, near "2r"
        (Missing operator before r?)
Bareword found where operator expected at arvind2.pl line 118, near "7Nnil2eVs"
        (Missing operator before Nnil2eVs?)
Bareword found where operator expected at arvind2.pl line 119, near "/ZK+DXjH4SfBLxvqPxJvNOn+JfxD8cX/jTxPaaLn7Bpt1eeWPssBPLqiRIC55LFuWGGP1PXyv"
        (Missing operator before jTxPaaLn7Bpt1eeWPssBPLqiRIC55LFuWGGP1PXyv?)
Number found where operator expected at arvind2.pl line 120, near "jTxPaaLn7Bpt1eeWPssBPLqiRIC55LFuWGGP1PXyv
8"
        (Missing semicolon on previous line?)
Bareword found where operator expected at arvind2.pl line 120, near "8JPix"
        (Missing operator before JPix?)
Bareword found where operator expected at arvind2.pl line 120, near "094u"
        (Missing operator before u?)
Number found where operator expected at arvind2.pl line 123, near "//9"
        (Missing operator before 9?)
Bareword found where operator expected at arvind2.pl line 123, near "9k"
        (Missing operator before k?)
Global symbol "$RandomString" requires explicit package name at arvind2.pl line 26.
Global symbol "$RandomString" requires explicit package name at arvind2.pl line 26.
syntax error at arvind2.pl line 60, near "--="
syntax error at arvind2.pl line 63, near "Content"
syntax error at arvind2.pl line 73, near "Content"
Illegal octal digit '9' at arvind2.pl line 120, at end of line
Can't find string terminator "'" anywhere before EOF at arvind2.pl line 125.
0
 
LVL 5

Author Comment

by:arvind
ID: 26290328
After little tuning now following errors:

emicolon seems to be missing at arvind2.pl line 26.
Semicolon seems to be missing at arvind2.pl line 30.
Semicolon seems to be missing at arvind2.pl line 31.
Semicolon seems to be missing at arvind2.pl line 34.
Bareword found where operator expected at arvind2.pl line 35, near "3GPP"
        (Missing operator before GPP?)
Semicolon seems to be missing at arvind2.pl line 35.
Semicolon seems to be missing at arvind2.pl line 37.
Semicolon seems to be missing at arvind2.pl line 38.
syntax error at arvind2.pl line 26, near "Date:"
syntax error at arvind2.pl line 35, near "X"
Global symbol "$RandomString" requires explicit package name at arvind2.pl line 37.
Global symbol "$RandomString" requires explicit package name at arvind2.pl line 38.
Execution of arvind2.pl aborted due to compilation errors.
0
 
LVL 5

Author Comment

by:arvind
ID: 26290552
Cleaned up all errors, Now I need your help:

Enter SenderNumber: 16500000000
Enter X-MMS-Originator-System: system-user@mm4.mydomain.com                                                    
Invalid input!
Enter X-MMS-Originator-System: 111
Enter RecipientNumber: 14080000000
Date (a=Use Current; b=Enter Manually): a
Invalid input!
Date (a=Use Current; b=Enter Manually): b
Invalid input!
Date (a=Use Current; b=Enter Manually): A
Invalid input!
Date (a=Use Current; b=Enter Manually): a;
Invalid input!
Date (a=Use Current; b=Enter Manually): Use Curre
use strict;
use warnings;
use Data::Dumper;
use Net::SMTP;
use POSIX 'strftime';
my $SenderNumber = Ask('Enter SenderNumber: ', qr/^\d+$/);
my $XmmsOrig = Ask('Enter X-MMS-Originator-System: ', qr/^\d+$/);
my $RecipientNumber = Ask('Enter RecipientNumber: ', qr/^\d+$/);
my $DateType = Ask('Date (a=Use Current; b=Enter Manually): ', qr/^(aA|bB)$/);
my $DateString;
if($DateType =~ /a/) {$DateString = strftime('%a, %d %b %Y %H:%M:%S', localtime);}
else {$DateString = Ask('Enter Date: ', qr/\S/);}
my $Subject = Ask('Enter Subject: ', qr/\S/);
sub Ask {
        my ($String, $Re) = @_;
        while(1) {
                print $String;
                my $Input = <STDIN>;
                chomp($Input);
                return $Input if $Input =~ $Re;
                print "Invalid input!\n";
        }
}

my $RandomString = '';
  for (1..(rand(10)+10)) {
      $RandomString .= chr(rand(74)+48);
}

# Mailhost
my $smtp = Net::SMTP->new('127.0.0.1:7000',
        Hello => 'fixeddoamin.com',
        Debug => 1 # turn it 1 to see std output,0 to not see it
        );
$smtp->mail("+$SenderNumber/TYPE=PLMN\@abctest.com");
$smtp->to("+$RecipientNumber/TYPE=PLMN\@Mydomain");

$smtp->data();
$smtp->datasend({'Date: $DateString
From: +$SenderNumber/TYPE=PLMN
Sender: +$SenderNumber/TYPE=PLMN
To: +$RecipientNumber/TYPE=PLMN
Subject: $Subject
Mime-Version: 1.0
Content-Type: multipart/related; type="application/smil";
  boundary="----=_Part_0_6662015.1212101578925";
  start="<SMILTemplate_1.xml>"
X-Mms-3GPP-MMS-Version: 5.5.0
X-Mms-Message-Type: MM4_forward.REQ
X-Mms-Transaction-ID: "$RandomString"
X-Mms-Message-ID: "$RandomString"
X-Mms-Message-Class: Personal
X-Mms-Ack-Request: Yes
X-Mms-Delivery-Report: Yes
X-Mms-Priority: Normal
X-Mms-Read-Reply: No
X-Mms-Originator-System: $XmmsOrig

------=_Part_0_6662015.1212101578925
Content-Id: <SMILTemplate_1.xml>
Content-Type: application/smil;Name="123.smil"
Content-Location: SMILTemplate_1.xml
Content-Transfer-Encoding: base64
PHNtaWw+PGhlYWQ+PGxheW91dD48cm9vdC1sYXlvdXQgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48cmVnaW9uIGlk
PSJJbWFnZSIgbGVmdD0iMCIgdG9wPSIwIiB3aWR0aD0iMTYwIiBoZWlnaHQ9IjE2MCIvPjxyZWdpb24gaWQ9IlRleHQi
IGxlZnQ9IjAiIHRvcD0iMCIgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48L2xheW91dD48L2hlYWQ+PGJvZHk+PHBh
cj48aW1nIHJlZ2lvbj0iVGV4dCIgc3JjPSJpbWFnZWpwZWdfMS5qcGciLz48L3Bhcj48L2JvZHk+PC9zbWlsPg==
------=_Part_0_6662015.1212101578925
Content-Id: <imagejpeg_1.jpg>
Content-Type: image/jpeg;Name="imagejpeg_1.jpg"
Content-Location: imagejpeg_1.jpg
Content-Transfer-Encoding: base64

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgHCAgJCg0LCQoMCggI
Cw8LDA0ODg8OCQsQERAOEQ0ODg7/2wBDAQIDAwMDAwcEBAcOCQgJDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4O
Dg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCACWAJYDASIAAhEBAxEB/8QAHwA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xDqNskL2GlJIfsmnQIvyoiIE3lQodlU4AVaAPzi+P2tfFT9oj/gix8S/2jfD
f7S93p3wx1Pwsj6x8KE8F6e8en3UIihvNPe9b/SVxcK7hjhtrLj5SK+pvht/ysBaZ/2afpP/AKe5KZ8c/wBjKLT/ANmj
9ry6+B66tdeIPi1okbf8IHHfwwaT/agl3TXcKyFUjlmG0sSwAIbqCoXY8C6HrGmf8HAFu19p1xbw237LumWM05jJiW4T
W5N0XmD5SwxnAPTnpQBJ+0J4P+LXwv8A+Cg2h/tefCjwlZ/FKwg8Ct4P8b+EJtTisL0WC3hvI7yxml+QyK5IaNiNwUAA
liyRX/7cviu78NiDwn+xt8cJfFU+2Ozi8V6Ba6DpBmc4QPqMtw0aqSRhgrZHavP/ANo/xJ+2v8Y/2Wfip8HNM/Yog07T
fEdjPpdp4jPxl0iTERf5Lj7M0aHlVB2FwRuxnivPfjIn7cvxZ/Yz8K/Cf/himDw//Yup6Le/2r/wuXR7jz/7Nnil2eVs
Tb5nlYzvO3dnDYwQD7c/ZK+DXjH4SfBLxvqPxJvNOn+JfxD8cX/jTxPaaLn7Bpt1eeWPssBPLqiRIC55LFuWGGP1PXyv
8JPix+094u+MsGjfFT9kyL4PeEWtZZJPEafFPTtbMcqjKR/ZoIVc7zxuzgd6+qKACiiigAooooAKKKKACiiigAooooAK
KKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo
ooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii
gAooooA//9k=
------=_Part_0_6662015.1212101578925--
.'});

# Quit connection
$smtp->dataend();
$smtp->quit;

Open in new window

0
 
LVL 5

Author Comment

by:arvind
ID: 26290686
last errors:


Enter SenderNumber: 16500000000
Enter RecipientNumber: 13300000000
Enter X-MMS-Originator-System: system-user@mm4.mydoamin.com
Date (a=Use Current; b=Enter Manually): a
Enter Subject: test message
Net::SMTP>>> Net::SMTP(2.29)
Net::SMTP>>>   Net::Cmd(2.26)
Net::SMTP>>>     Exporter(5.58)
Net::SMTP>>>   IO::Socket::INET(1.29)
Net::SMTP>>>     IO::Socket(1.29)
Net::SMTP>>>       IO::Handle(1.25)
Net::SMTP=GLOB(0x17632b30)<<< 220 icmms-mmsc041 ,UEG 1.0
Net::SMTP=GLOB(0x17632b30)>>> EHLO fixeddoamin.com
Net::SMTP=GLOB(0x17632b30)<<< 502 Command not implemented
Net::SMTP=GLOB(0x17632b30)>>> HELO fixeddoamin.com
Net::SMTP=GLOB(0x17632b30)<<< 250 localhost.localdomain HELO
Net::SMTP=GLOB(0x17632b30)>>> MAIL FROM:<+16503364915/TYPE=PLMN@abctest.com>
Net::SMTP=GLOB(0x17632b30)<<< 250 +16503364915/TYPE=PLMN@abctest.com. OK
Net::SMTP=GLOB(0x17632b30)>>> RCPT TO:<+13308318731/TYPE=PLMN@mydoamin.com>
Net::SMTP=GLOB(0x17632b30)<<< 250 Recepient +13308318731/TYPE=PLMN@mydomain.com. OK
Net::SMTP=GLOB(0x17632b30)>>> DATA
Net::SMTP=GLOB(0x17632b30)<<< 354 Enter mail, end with . on a line by itself
Odd number of elements in anonymous hash at arvind2.pl line 39, <STDIN> line 5.
Not an ARRAY reference at /usr/lib/perl5/5.8.8/Net/Cmd.pm line 391, <STDIN> line 5.
0
 
LVL 5

Author Comment

by:arvind
ID: 26300763
Did you got chance to look into above error?

You can test above script by submited to Sendmail port 25..

Waiting for reply
0
 
LVL 5

Author Comment

by:arvind
ID: 26471968
Adam: Any luck on above error?
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 800 total points
ID: 28580394

#line 39
$smtp->datasend(qq{Date: $DateString
From: +$SenderNumber/TYPE=PLMN
Sender: +$SenderNumber/TYPE=PLMN
To: +$RecipientNumber/TYPE=PLMN
Subject: $Subject
Mime-Version: 1.0
Content-Type: multipart/related; type="application/smil";
  boundary="----=_Part_0_6662015.1212101578925";
  start="<SMILTemplate_1.xml>"
X-Mms-3GPP-MMS-Version: 5.5.0
X-Mms-Message-Type: MM4_forward.REQ
X-Mms-Transaction-ID: "$RandomString"
X-Mms-Message-ID: "$RandomString"
X-Mms-Message-Class: Personal
X-Mms-Ack-Request: Yes
X-Mms-Delivery-Report: Yes
X-Mms-Priority: Normal
X-Mms-Read-Reply: No
X-Mms-Originator-System: $XmmsOrig

------=_Part_0_6662015.1212101578925
Content-Id: <SMILTemplate_1.xml>
Content-Type: application/smil;Name="123.smil"
Content-Location: SMILTemplate_1.xml
Content-Transfer-Encoding: base64
PHNtaWw+PGhlYWQ+PGxheW91dD48cm9vdC1sYXlvdXQgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48cmVnaW9uIGlk
PSJJbWFnZSIgbGVmdD0iMCIgdG9wPSIwIiB3aWR0aD0iMTYwIiBoZWlnaHQ9IjE2MCIvPjxyZWdpb24gaWQ9IlRleHQi
IGxlZnQ9IjAiIHRvcD0iMCIgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiLz48L2xheW91dD48L2hlYWQ+PGJvZHk+PHBh
cj48aW1nIHJlZ2lvbj0iVGV4dCIgc3JjPSJpbWFnZWpwZWdfMS5qcGciLz48L3Bhcj48L2JvZHk+PC9zbWlsPg==
------=_Part_0_6662015.1212101578925
Content-Id: <imagejpeg_1.jpg>
Content-Type: image/jpeg;Name="imagejpeg_1.jpg"
Content-Location: imagejpeg_1.jpg
Content-Transfer-Encoding: base64

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgIDAgIDAwYEAwMDAwcFBQQGCAcJCAgHCAgJCg0LCQoMCggI
Cw8LDA0ODg8OCQsQERAOEQ0ODg7/2wBDAQIDAwMDAwcEBAcOCQgJDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4O
Dg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCACWAJYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAA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IE3lQodlU4AVaAPzi+P2tfFT9oj/gix8S/2jfD
f7S93p3wx1Pwsj6x8KE8F6e8en3UIihvNPe9b/SVxcK7hjhtrLj5SK+pvht/ysBaZ/2afpP/AKe5KZ8c/wBjKLT/ANmj
9ry6+B66tdeIPi1okbf8IHHfwwaT/agl3TXcKyFUjlmG0sSwAIbqCoXY8C6HrGmf8HAFu19p1xbw237LumWM05jJiW4T
W5N0XmD5SwxnAPTnpQBJ+0J4P+LXwv8A+Cg2h/tefCjwlZ/FKwg8Ct4P8b+EJtTisL0WC3hvI7yxml+QyK5IaNiNwUAA
liyRX/7cviu78NiDwn+xt8cJfFU+2Ozi8V6Ba6DpBmc4QPqMtw0aqSRhgrZHavP/ANo/xJ+2v8Y/2Wfip8HNM/Yog07T
fEdjPpdp4jPxl0iTERf5Lj7M0aHlVB2FwRuxnivPfjIn7cvxZ/Yz8K/Cf/himDw//Yup6Le/2r/wuXR7jz/7Nnil2eVs
Tb5nlYzvO3dnDYwQD7c/ZK+DXjH4SfBLxvqPxJvNOn+JfxD8cX/jTxPaaLn7Bpt1eeWPssBPLqiRIC55LFuWGGP1PXyv
8JPix+094u+MsGjfFT9kyL4PeEWtZZJPEafFPTtbMcqjKR/ZoIVc7zxuzgd6+qKACiiigAooooAKKKKACiiigAooooAK
KKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo
ooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii
gAooooA//9k=
------=_Part_0_6662015.1212101578925--
.});

Open in new window

0
 
LVL 5

Author Closing Comment

by:arvind
ID: 31672877
Hi Adam,

If I will face any problems, I will ping you.

Thanks for your help
Arvind
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Six Sigma Control Plans
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question