Hi Maurice, Amran,
I had a similar wish, because I want only users with an account to
receive a mail with the URL to the ticket (and OTRS).
IMHO it should be a nice feature, if one could write some rules in the
responses. But until that is possible...
I think at this point there is only one way (or at least only one EASY
way) of doing this:
By making sure that tickets of e-mail senders that do NOT yet have an
account end up in a separate QUEUE (with the auto replies set to your
liking).
Named like "OTHERS" or whatever. Best to make sure that existing
customers do NOT have access to this QUEUE (TO field)
Tickets from sender WITH an account (then) can end up in any of the
queues you have matched the system e-mail address(es) to.
For this to be possible, the sender's e-mail address of the incoming
e-mail will need to be checked against the email field in the
customer_user table of OTRS.
If there is no match: put in the "OTHERS" queue, by setting the
'X-OTRS-Queue' token. Else proceed as normal.
The simplest way I can think of is by using the PostMaster CMD filter
module, to run an external script that does the check on 'From' address
<-> customer_user.email.
A very simple setup, with a very basic script, I have included below as
a working example:
The CMD module, to be added to Kernel/Config.pm:
# Using /opt/otrs/scripts/test_mail_filter
# Job Name: 5-testMailFilter
$Self->{'PostMaster::PreFilterModule'}->{'9-testMailFilter'} = {
Module => 'Kernel::System::PostMaster::Filter::CMD',
CMD => '/opt/otrs/scripts/test_mail_filter',
#CMD => 'tee /tmp/catcher.$$',
Set => {
'X-OTRS-Queue' => 'OTHERS',
},
};
# when the script runs on a received e-mail it checks if the e-mail
address can be matched
# to an OTRS account, or not. When NOT (script return's 0 code), the
ticket will be placed
# in queue OTHERS.
#
# the commented CMD with 'tee' is a handy one to catch all the e-mails
into a file to see what passes
#
The very simple script, to be placed within reach of the OTRS user
(executable, eg. 755), other fancy OTRS/Perl variants are possible:
(a good example, yet in german, can be found here:
http://www.otrs-forum.de/viewtopic.php?f=25&t=2712)
#!/bin/bash
###########################################
# scripts/test_mail_filter
# the database user (otrs) and password (PASSWORD) need to be adjusted!
# find the From line, and take the e-mail from between the < > part.
sender_mail=`awk '/^(From.*<)(.*)(>*)/,gsub(/.*<|>.*/,"")'`
# set the default (not found) return code
retcode=0
# check if we did find an e-mail address (likely)
if [ "XX" != "X${sender_mail}X" ]
then
# find a login name for the e-mail address
# the database user (otrs) and password (PASSWORD) for database 'otrs'
need to be adjusted!
sender_account=`mysql -N -B -u otrs -pPASSWORD otrs -e "select login
from customer_user where email = \"$sender_mail\""`
# positive match?
if [ "XX" != "X${sender_account}X" ]
then
##echo "X-OTRS-Login=${sender_account}"
# return value set to 'possitive'
retcode=1
fi
fi
# leave with return code.
exit $retcode
# Because OTRS rule in Config.pm applies when the script result is
'true', the script
# has to return a 0 (ok) when NO match is found. This can be turned
around, when for
# some reason a rule will applied when account DOES exist.
###########################################
gr,
Frans
From: [email protected] [mailto:[email protected]] On Behalf Of
Maurice James
Sent: zaterdag 9 mei 2009 05:12
To: 'User questions and discussions about OTRS.'
Subject: Re: [otrs] how to ask a new user to create a account in
autoresponse?
I would like to know this as well. Anyone have the answer out there?
From: [email protected] [mailto:[email protected]] On Behalf Of
Amanpreet Singh
Sent: Friday, May 08, 2009 6:34 AM
To: [email protected]
Subject: [otrs] how to ask a new user to create a account in auto
response?
hi,
i am new to otrs, using otrs 2.2 on a debian system
my problem is, if a person (not a customer) open a ticket,
auto response should ask him to create a new account on customer.pl (By
passing the URL)
& should not pass the Username & password to him/her as passing to the
other Customers.
how should i configure it.
plz help
-Aman
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW!
http://www.otrs.com/en/support/enterprise-subscription/