AW: [otrs] Customer ID and name

Hello Martin, thanks for your answer. I am not that used with configuring all the mail stuff, so could you shortly explain, how mails are processed by otrs and how procmail is involved? What do I have to configure, so that procmail is used? Thanks in advance for your effort! By Ralph -----Ursprüngliche Nachricht----- Von: Martin Edenhofer [mailto:martin@edenhofer.de] Gesendet: Freitag, 20. September 2002 16:07 An: otrs@otrs.org Betreff: Re: [otrs] Customer ID and name Hi Ralph, On Fri, Sep 20, 2002 at 01:51:52PM +0200, Ralph M?ller wrote:
since a while I am playing around with otrs, and I have to say it is really hot stuff!
Nice! :)) Thanks!
Now I have a question concerning the customer ID. Is it possible to assign the customer ID automaticaly, for instance according the domain-part of the sender address (when a new mail arrives and opens a new ticket)? And is it possible to assing a customer-name to a customer ID? This would make it easier to search cases from a particular customer.
Yes, you can do. At first, the design of OTRS is to use an external customer
db. Normally there is (in the most cases) an existing customer db.
How can you assign a customer ID automaticaly with domain:
==========================================================
You can do this with procmail. Add the follwing after "Remove all X-OTRS".
[~otrs/.procmailrc]
# --
# Remove all X-OTRS Header (allow this only for trusted email)
# e. g. from *@example.com
# --
:0 fhw :
* !^X-OTRS-Ident: ahfiw2Fw32r230dddl2foeo3r
| grep -vi '^X-OTRS-'
## START OF OUR EXAMPLE
# --
# find FROM and add domain to X-OTRS-CustomerNo
# --
:0hc
FROM=| formail -X "From:"|perl -e '$i=<STDIN>; $i=~s/^From:
//;$i=~s/\(.*?\)//;$i=~s/<(.*?)>/$1/;$i=~s/ //g;$i=~s/.*@(.*)/$1/;print $i'
:0 fhw :
| formail -I "X-OTRS-CustomerNo: $FROM"
## END OF OUR EXAMPLE
[...]
Note: If the shell of the otrs user is /bin/false (default) you have to add
on the
top of the procmailrc "SHELL=/bin/bash":
[...]
SYS_HOME=$HOME
SHELL=/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
MONTHFOLDER=`date +%Y-%m`
[...]
This is just an example. You also can call an CMD program (not this perl -e
stuff)
which do lookups in your own customer db.
You also can do queue filtering with procmail
(http://otrs.org/pages/index.pl?Action=Ext&Site=Docu/xheader_otrs_queue.html
).
How can you link your customer db with otrs:
============================================
If your customer db has a web frontend. So add an html link in the dtl
templates
e. g. Kernel/Output/HTML/Standard/TicketView.dtl ->
"http://yourdb/customer.php?CustomerID=$Data{"CustomerID"}">$Data{"Cust
omerID"}</a>"
Click on this link and the customer data will be shown.
If you don't have a web frontend. Write a little CMD program like
"show_customer.sh"
or "show_customer.pl" with an argument as customer id. Add to the dtl where
the customer data should be the following:
[...]
<table>
<tr>
<td>
Customer Info:
</td>
<td>
An other wish is a reminder time/date. It would be nice, if I could give a ticket the status 'waiting_for_reminder' together with a response deadline, after which the ticket would come up again. This would be helpful if one have sent an answer to a customer, but the customer does not response. After the reminder has expired, one can contact the customer again or close the case.
This is planed for 0.5 Beta9. :)
Thanks again for your great work! By Ralph
Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- Perfection is our goal, excellence will be tolerated. -- J. Yahl _______________________________________________ OpenTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Hi Ralph, On Mon, Sep 23, Ralph Müller wrote:
thanks for your answer. I am not that used with configuring all the mail stuff, so could you shortly explain, how mails are processed by otrs and how procmail is involved? What do I have to configure, so that procmail is used?
I think it makes sense to give you a very rough introduction in procmail. Procmail is some sort of filter which is automaticly used by your Mail Transfer Agend (MTA e.g. sendmail). So anytime an e-mail arrives at the MTA it looks in the homedirectory of a user (e.g. the otrs user) and in case it has a valid .procmailrc it pipes the e-mail through this filter. And the filter can than say "let's pipe this e-mail to the otrs system or let's delete it", depending on the rules. In case you are not familiar with procmail. Have a look at "man procmail", "man procmailex" or google. [for all those gurus]: It is just a simplified way of describing it. take care Stefan -- Stefan Wintermeyer That was a right-pretty speech, sir. But I ask you, what is a contract? Webster's defines it as "an agreement under the law which is unbreakable." Which is unbreakable! Excuse me, I must use the restroom. (Lionel Hutz) "The Simpsons"

On Mon, Sep 23, 2002 at 11:30:38AM +0200, Stefan ich brauche was zum trinken Wintermeyer wrote:
I think it makes sense to give you a very rough introduction in procmail. Procmail is some sort of filter which is automaticly used by your Mail Transfer Agend (MTA e.g. sendmail). So anytime an e-mail arrives at the MTA it looks in the homedirectory of a user (e.g. the otrs user) and in case it has a valid .procmailrc it pipes the e-mail through this filter. And the filter can than say "let's pipe this e-mail to the otrs system or let's delete it", depending on the rules.
In case you are not familiar with procmail. Have a look at "man procmail", "man procmailex" or google.
[for all those gurus]: It is just a simplified way of describing it.
Thanks Stefan! :) I'll describe how procmail and OTRS works together. Procmail is modifying the email by a matching role. In our case procmail appends an X-Header to the email. In our CustomerID example (which are two procmail rols) procmail appends an X-OTRS-CustomerNo to the email. [...] ## START OF OUR EXAMPLE # -- # find FROM and add domain to X-OTRS-CustomerNo # -- :0hc FROM=| formail -X "From:"|perl -e '$i=<STDIN>; $i=~s/^From: //;$i=~s/\(.*?\)//;$i=~s/<(.*?)>/$1/;$i=~s/ //g;$i=~s/.*@(.*)/$1/;print $i' :0 fhw : | formail -I "X-OTRS-CustomerNo: $FROM" ## END OF OUR EXAMPLE [...] After this role the email will be piped through the PostMaster.pl. The PostMaster.pl is scanning this email (specifically the X-OTRS-Headers) and puts the value of X-OTRS-CustomerNo into the CustomerID of the ticket. A second example (simpler). The next procmail role is matching all emails where in the To: or Cc: is an email with *@example.com (e. g. support@example.com) and appends an "X-OTRS-Queue: example" header. [...] # -- # Examples for queue presorting. # -- :0 fhw : * TO:.*@example.com | formail -I "X-OTRS-Queue: example" [...] After this role the email will be piped through the PostMaster.pl. The PostMaster.pl is scanning this email (specifically the X-OTRS-Headers) and puts the email into the example queue. -=> Of course you have to lern the procmail syntax (man procmailex), but if you got this, you will be able to do "all kind" of sorting, matching, modifying ... with emails. PS: There are more X-OTRS-Header for use, e. g. X-OTRS-Priority and X-OTRS-State (more doc/X-OTRS-Headers.txt). Is it clear to you? Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- nohl: 1:06pm up 9 days, 5:43, 3 users, load average: 0.06, 0.03, 0.00
participants (3)
-
Martin Edenhofer
-
Ralph Müller
-
Stefan Wintermeyer