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. [EMAIL PROTECTED])
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
_______________________________________________
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