[rt-users] RE: PROCMAIL
Bruce Campbell
bruce_campbell at ripe.net
Tue Feb 5 05:29:40 EST 2002
On Mon, 4 Feb 2002, George Warnagiris wrote:
> disclaimer before it hits RT. I have created a procmail recipe that uses
> perl to strip the unwanted text. I though this should be invoked in the
> aliases file like this:
>
> helpdeskus: "| procmail /etc/.procmailrc | /opt/rt2/bin/rt-mailgate --queue
> helpdeskus --action correspond"
>
> It, unfortunately, sends a blank, header-less, body-less email to RT. I'm
> not sure what I'm doing wrong here. I thought you may be able to suggest a
You would be better off invoking rt-mailgate from within the procmailrc.
I do my mail delivery to RT via:
aliases file:
# Run rt2 as the rt2 user, not as root.
test-rt2: "| /usr/bin/procmail -m /etc/procmailrcs/rt2-test"
/etc/procmailrcs/rt2-test:
# This file MUST be owned by the rt2 user. See '-m' description
# in the procmail man page.
HOME=/home/rt2
INCLUDERC=$HOME/.procmailrc-test
# are we still here after including? Dump it to someone
:0
! joe_bloggs at example.com
( The above two snippets gets procmail running, as the rt2 user, a
procmail file for the specific queue. I really really dislike relying
on setuid stuff. )
/home/rt2/.procmailrc-test
# This file does any filtering/mail manipulations/etc before
# calling rt-mailgate.
HOME=/home/rt2
LOGFILE=log/procmail.log
VERBOSE=no
# Go away you naughty annoying spammer
:0
* ^From:.*badguy at example.com
/dev/null
# Place mailfiltering here
:0 f
| /home/rt2/bin/my_custom_filter_program
# Accept the mail into mailgate. We { } enclose it incase we want
# a last-ditch filter.
:0
{
# Use a lockfile to ensure only one rt-mailgate process.
:0 :.procmail.lock
| /home/rt2/bin/rt-mailgate --queue TEST --action correspond
# Something went wrong. Dump it to someone
:0e
! joe.bloggs at example.com
}
Regards,
--
Bruce Campbell RIPE
Systems/Network Engineer NCC
www.ripe.net - PGP562C8B1B Operations
More information about the rt-users
mailing list