beginning.... 1 #!/usr/bin/perl -w 2 3 ################### 4 #parts of the script are from the perldesk email.pl file 5 #the rest are my own modifications 6 #Neil Watson Mon Aug 12 10:17:47 EDT 2002 7 ################## 8 9 #scalars from these includes 10 use vars qw($dbhost $dbname $dbuser $dbpass $ticketad $hdtime); 11 12 require "/usr/local/apache/cgi-bin/include/conf.pl"; 13 require "/usr/local/apache/cgi-bin/include/lang/en.inc"; 14 15 my ($user, $callemail, $status, $category, $ownership); 16 my ($staffemail, @staffemail, $callid); 17 my ($ref, %global, $sender); 18 19 use strict; 20 use warnings; 21 22 ############## 23 #parse incoming support email 24 ############## 25 26 use MIME::Parser; 27 use MIME::Entity; 28 use MIME::Body; 29 use Mail::Sender; 30 First sender: 60 #if subject is emplty, send reply and stop here 61 if ((!$subject) || ($subject eq "")){ 62 63 $sender = new Mail::Sender; 64 65 $sender->Open({ 66 smtp =>'mail', 67 to =>"$from", 68 from =>"$ticketad", 69 fake_from =>"$ticketad", 70 subject =>"Help Desk Response", 71 headers => "Errors-To: postmaster\@mydomain.com"}); 72 73 $sender->Body; 74 $sender->SendEnc(<<'*END*'); 75 Please resend your request with a subject line intact, if you are replying to a staff response, please keep the subject line intact for tracking purposes, if this is a new request, please give it a suitable subject line. 76 77 Thank You, 78 Customer Support 79 *END* 80 $sender->Close; 81 exit; 82 } Sender later on 183 if ($callemail != $from) { 184 185 $sender = new Mail::Sender; 186 187 $sender->Open({ 188 smtp =>'mail', 189 to =>"$from", 190 from =>"$ticketad", 191 fake_from =>"$ticketad", 192 subject =>"Help Desk Submission", 193 headers => "Errors-To: postmaster\@mydomain.com"}); 194 195 $sender->Body; 196 $sender->SendEnc(<<'*END*'); 197 Sorry, you seem to have sent this help desk response to a call which is not owned by you. If you believe this to be a mistake, plea se check that you are sending this response from the email address used when logging this call. 198 199 Thank You, 200 Customer Support. 201 *END* 202 $sender->Close; 203 $dbh->disconnect(); 204 exit; 205 }