tomolimo / mailanalyzer

Mail Analyzer GLPI Plugin may be used to combine CC mails into one Ticket
25 stars 10 forks source link

use email passed in special field instead of the email sender #18

Closed andreaontheweb closed 6 years ago

andreaontheweb commented 6 years ago

Hello' I'm looking for a solution to my problem. I'm sending an email for generating ticket anonymous to a glpi receiver. I'd like to use your plugin for change the email address or the requester using the provided one instead of the mail sender, this because I use the same smtp server. But as a read in your documentation special chars (@) are not allowed. Any suggestions?

tomolimo commented 6 years ago

Hello @andreaontheweb

But as a read in your documentation special chars (@) are not allowed.

Where did you see this? I can't remember,

thank you Regards, Tomolimo

andreaontheweb commented 6 years ago

Maybe I misunderstood your code. Anyway I need to receiving an anonymous new email and use the ##form field as requester. Do you think is possible with your plugin?

tomolimo commented 6 years ago

Hello,

Yes, it should be possible if your ##From respect the so called 'OnBehalfOf':

image

As seen on the screen copy, when you want to forward an email 'OnBehalfOf' to a GLPI receiver, you need to have ##From: "LastName, FirstName" <blabla@domain.com> for example (see below for more examples), in the message that is forwarded.

A regular expression: /##From\s*:\s*(["']?(?'last'[\w.\-' ]+)[, ]\s*(?'first'[\w+.\-' ]+))?.*?(?'email'[\w_.+\-]+@[\w\-]+\.[\w\-.]+)?\W*$/im will verify this syntax, so it must be really like shown.

In LastName authorized chars are:

And in FirstName authorized chars are:

And the email part must be compliant to standard email notation.

The comparison is case insensitive.

  1. The GLPI user who matches LastName, FirstName must be unique in GLPi
  2. This user must have at least one email address.
  3. The user must be active and not deleted.

Examples of good expressions:

From: Olimo, Tom

From : Olimo Tom tom@domain.com

from: 'Olimo Tom' tom.olimo@domain.com

from : "Olimo, Tom" "tom.olimo@domain.com"

and so on

regards, Tomolimo

andreaontheweb commented 6 years ago

Mm I'm receiving email from anonymous so I have no user to compare with.

tomolimo commented 6 years ago

the user to compare with is the one of the users already defined in GLPI

andreaontheweb commented 6 years ago

I'm missing something. So sorry. I have enabled the allow anonymous ticket creation option. So anyone send an email could create a ticket. I'd like to use your plugin for change the sender with the fields present in the ##from: tag

tomolimo commented 6 years ago

Hello @andreaontheweb What you need to understand is that the

from: tag

must represent a valid GLPI user. If so, then it's perfect just try it :smiley:

regards, Tomolimo

andreaontheweb commented 6 years ago

Dear to molino, tank's for your support, but I tried to learn more about your wonderful plugin. But I don't thin is what I need. I'm able to match añ email ticket with an user but what I really need is change the email of the reply to the user, not only assign newly created ticket to an user. Thank 's again.

tomolimo commented 6 years ago

You're welcome