I don't have email fetch setup on my site but this is what I would suggest you look to change.
If your users are using Outlook, they can specify in their "Organization" field what company they work for.
This would be in the include\class.pop3.php file.
function createTicket($mid,$emailid=0){
global $cfg;
$mailinfo=$this->getHeaderInfo($mid);
$var=imap_utf8($mailinfo);
$var=$mailinfo;
$var=$mailinfo?imap_utf8($mailinfo):'';
$var=$mailinfo?imap_utf8($mailinfo):'';
$var=Format:($this->getBody($mid));
$var=$cfg->saveEmailHeaders()?$this->getHeader($mid):'';
$var=$emailid?$emailid:$cfg->getDefaultEmailId(); //ok to default?
$var=$var?$var:$var; //No name? use email
if($cfg->useEmailPriority())
$var=$this->getPriority($mid);
$ticket=null;
$newticket=true;
//Check the subject line for possible ID.
if(ereg ("{1,10}",$var,$regs)) {
$extid=trim(preg_replace("/", "", $regs));
$ticket= new Ticket(Ticket:($extid));
//Allow mismatched emails?? For now NO.
if(!$ticket || strcasecmp($ticket->getEmail(),$var))
$ticket=null;
}
also in class.mailparse.php
function getError(){
return PEAR:($this->struct)?$this->struct->getMessage():'';
}
function getFromAddressList(){
return Mail_RFC822:($this->struct->headers);
}
function getToAddressList(){
//Delivered-to incase it was a BBC mail.
return Mail_RFC822:($this->struct->headers?$this->struct->headers:$this->struct->headers);
}
function getCcAddressList(){
return $this->struct->headers?Mail_RFC822:($this->struct->headers);
}
function getSubject(){
return $this->struct->headers;
}
function getOrganization(){
return $this->struct->headers;
}
I would believe this would allow outlook users with an "Organization" field to generate tickets with a company name in the field. This should propagate into the company field in OSticket.
I believe, outlook users w/ organization fields filled out are being parsed by the /pear/mail library, but the field isn't being utilized.
Try this out, tell me if it works or if it doesn't suit your needs.
This will not resolve the inability to change the field afterward.
I have an idea about creating an edit button on the /staff/viewticket.inc.php page but my head hurts and I'm not really an OSticket developer.