[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"


	# This file MUST be owned by the rt2 user.  See '-m' description
	# in the procmail man page.

	# are we still here after including?  Dump it to someone
	! 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. )


	# This file does any filtering/mail manipulations/etc before
	# calling rt-mailgate.


	# Go away you naughty annoying spammer
	* ^From:.*badguy at example.com

	# 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.
	  # 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
	  ! joe.bloggs at example.com


                             Bruce Campbell                            RIPE
                   Systems/Network Engineer                             NCC
                 www.ripe.net - PGP562C8B1B                      Operations

More information about the rt-users mailing list