Advertisement

08.02.2008 at 11:05PM PDT, ID: 23616941
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Change to an email-to-cgi mime script

Asked by dwebber in CGI Scripting, Parsers, WebApplications

Tags: , ,

I have an email-to-cgi script below that processes an incoming email with an mp3 file attachment (a voicemail message) and forwards it out as though it came from me and not the voice email service I'm using.

The email-to-cgi script works great except that it can't forward "based on any input in the subject line of the incoming email"

There are voice email services that allow callers to enter a series of numbers at the end of their voicemail message that gets inserted into the subject line of the voice email.

What I'd like is to have my script revised so that when a voice email message is received, it will forward the message to an email address based on what's in the subject line of the incoming email with the voicemail attachment and also place a portion of what's in the subject line of the incoming email (like the series of numbers being entered after leaving a message as described above) included in the subject line of the outgoing email after it leaves my email-to-cgi script.  


Is this possible?



Here's the email-to-cgi script I'm using now

--------------------------------------------------------------------------------


#!/usr/bin/perl -w
use strict;
use MIME::Parser;
use MIME::Lite;

my $attachdir='/usr/home/domainname.com/cgi-bin/extract_&_send/';

my $parser=new MIME::Parser;
$parser->ignore_errors(1);
$parser->extract_uuencode(1);
$parser->tmp_recycling(0);
$parser->output_to_core(1);
my $entity=$parser->parse(\*STDIN);
my $from=$entity->head->get('From');
my $subject=$entity->head->get('Subject');
my @parts=$entity->parts;
my $aname='attachment001';
while(my $part = shift(@parts)) {
if($part->parts) {
push @parts,$part->parts; # Nested multi-part
next;
}
my $type=$part->head->mime_type || $part->head->effective_type;
if($type !~ /^(text|message)/i) { # Not a text, save it
my $filename=$part->head->recommended_filename || $aname;
$aname++;
my $io=$part->open("r");
$filename = "voicemail.mp3";
open(F,"> $attachdir/$filename");
my $buf;
while($io->read($buf,1024)) {
print F $buf;
}
close(F);
$io->close;
my @email=<STDIN>;

   my $msg = MIME::Lite->new(
       To => 'to-email@att.net',
       From => 'from-email@att.net',
       Bcc => 'bcc-email@att.net',
       Subject => 'Inquiry on Listing #1',
       Type => 'multipart/mixed',
   );

   $msg->attach(Type =>'TEXT',
       Data =>"To Whom it May Concern:

Content of my email message goes here

Kindest Regards,

Administrator"

 );

   $msg->attach(
       Type => 'audio/x-mpeg',
       Path => "$attachdir/$filename",
   );

   $msg->send;

}
}
exit;  Start Free Trial
[+][-]08.04.2008 at 10:17AM PDT, ID: 22154169

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 08:14PM PDT, ID: 22157868

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 09:01PM PDT, ID: 22158065

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 09:31PM PDT, ID: 22158156

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 09:03PM PDT, ID: 22167051

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 09:05PM PDT, ID: 22167059

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 09:32PM PDT, ID: 22167152

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: CGI Scripting, Parsers, WebApplications
Tags: email-to-cgi mime script, N/A, N/A
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.06.2008 at 06:28AM PDT, ID: 22169930

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 07:55AM PDT, ID: 22170929

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 05:51PM PDT, ID: 22176612

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628