Example with 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 $OpenTRSEmail = '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 $OpenTRSEmail 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 $OpenTRSEmail it will be dispatched to the topic=>queue.