OTRS CVS - Manual
Prev | Chapter 7. Receiving emails | Next

# Example for filtering/dispatching by Procmail and a webform

This is an example for a webform to generate an email for OTRS. You will find this perl scrtipt in $OTRS_HOME/scripts/webform.pl

You have a Topic, From, Email, Subject and Message field.

Change the config settings for the webform:

    # --
    # web form options
    # --
    my $Ident = 'ahfiw2Fw32r230dddl2foeo3r';
    # sendmail location and options
    my $Sendmail = '/usr/sbin/sendmail -t -i -f ';
    # email where the emails of the form will send to
    my $OTRSEmail = 'otrs-system@example.com';
    # topics and dest. queues
    my %Topics = (
        # topic => OTRS queue
        'Info' => 'info',
        'Support' => 'support',
        'Bugs' => 'bugs',
        'Sales' => 'sales',
        'Billing' => 'billing',
        'Webmaster' => 'webmaster',
    );

Take care, that your used $OTRSEmail and the used OTRS queues exists in your OTRS system.

Now, change the OTRS .procmailrc from:

    # --
    # Remove all X-OTRS Header (allow this only for trusted email)
    # e. g. from *@example.com
    # --
    :0 fhw :
    * !^From.*@example.com
    | grep -vi '^X-OTRS-'

to:

    # --
    # Remove all X-OTRS Header (allow this only for trusted email)
    # just not emails with "X-OTRS-Ident: ahfiw2Fw32r230dddl2foeo3r" header!
    # --
    :0 fhw :
    * !^X-OTRS-Ident: ahfiw2Fw32r230dddl2foeo3r
    | grep -vi '^X-OTRS-'

If a email is generated by the webform.pl and sent to the $OTRSEmail it will be dispatched to the topic=>queue.

Prev | Home | Next
Filtering/dispatching by Procmail (for more complex dispatching) | Up | Sending emails