Deriving Queue from Mail Address

We’re trying to replace our existing system with RT, and there is one thing that we could add to RT: the existing system uses a generic alias in Postfix (eg. @bugs.here.com which maps to, eg, ‘generic-bugs’). The users send mail to ‘@bugs.here.com’, and the system deposits the message in the appropriate list.

We there be any interest in in patches to rt-mailgate to add a ‘–parse-to-address’ option that would use the name part of the ‘To’ address to derive the queue and action?

This technique of aliasing avoids having to add a new mail alias for each new system.

Philip Warner | ___
Albatross Consulting Pty. Ltd. |----/ -
(A.B.N. 75 008 659 498) | /(@)
Tel: (+61) 0500 83 82 81 | _________
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / |
| –
___–
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

The --queue-from-extension flag to rt-mailgate should do this for you.,
without needing custom MTA config.

The only difference is that you’d address things to
bugs+@here.com.

With a simple MTA trick, you can get the exact effect you want.

For rt.cpan.org, I use the following with postfix:

/^bug-(.*)@rt.cpan.org$/ cpan-bug+$1@pallas.eruditorum.orgOn Wed, Nov 13, 2002 at 11:12:37AM +1100, Philip Warner wrote:

We’re trying to replace our existing system with RT, and there is one thing that we could add to RT: the existing system uses a generic alias in Postfix (eg. @bugs.here.com which maps to, eg, ‘generic-bugs’). The users send mail to ‘@bugs.here.com’, and the system deposits the message in the appropriate list.

We there be any interest in in patches to rt-mailgate to add a ‘–parse-to-address’ option that would use the name part of the ‘To’ address to derive the queue and action?

This technique of aliasing avoids having to add a new mail alias for each new system.


Philip Warner | ___
Albatross Consulting Pty. Ltd. |----/ -
(A.B.N. 75 008 659 498) | /(@)
Tel: (+61) 0500 83 82 81 | _________
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / |
| –
___–
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/


rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

»|« Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

At 07:21 PM 12/11/2002 -0500, Jesse Vincent wrote:

/^bug-(.*)@rt.cpan.org$/ cpan-bug+$1@pallas.eruditorum.org

This works fine if I use regexp virtuals, but we also store virtuals in a
Postgres database, and currently that only supports hash-style virtuals.
What I have done is:

Virtual:

 @bugs.here.com                      generic-bugs

Alias:

 generic-bugs:                       "|...etc"

Then just parse the ‘To’ field, which still says ‘whatever@bugs.here.com’.
I am happy to send a patch…

Philip Warner | ___
Albatross Consulting Pty. Ltd. |----/ -
(A.B.N. 75 008 659 498) | /(@)
Tel: (+61) 0500 83 82 81 | _________
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / |
| –
___–
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

Then just parse the ‘To’ field, which still says ‘whatever@bugs.here.com’.
I am happy to send a patch…

How does that work if you Cc or Bcc the queue?
»|« Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

At 11:10 PM 12/11/2002 -0500, Jesse Vincent wrote:

Then just parse the ‘To’ field, which still says ‘whatever@bugs.here.com’.
I am happy to send a patch…

How does that work if you Cc or Bcc the queue?

Good point. The existing system only handles direct email. We could look
for all to/cc/bcc addresses that match the required pattern (ie. the
domain), but it’s starting to get messy, and still does not handle virtuals
that may point to the address. delivered_to also does not work. I guess I’m
back to maintaining the virtual semi-manually.

I guess I’ll just add a catchall virtual to handle the possibility
(probability) that I forget to set up the virtuals for new queues.

Philip Warner | ___
Albatross Consulting Pty. Ltd. |----/ -
(A.B.N. 75 008 659 498) | /(@)
Tel: (+61) 0500 83 82 81 | _________
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / |
| –
___–
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

At 11:10 PM 12/11/2002 -0500, Jesse Vincent wrote:

How does that work if you Cc or Bcc the queue?

Good point. The existing system only handles direct email. We could look
for all to/cc/bcc addresses that match the required pattern (ie. the
domain), but it’s starting to get messy, and still does not handle virtuals
that may point to the address. delivered_to also does not work. I guess I’m
back to maintaining the virtual semi-manually.

Why don’t you just create a new mailgate for your specific purposes, and
call RT’s mailgate from it? That would simplify your tasks, and keep
RT sources clean from custom solutions…

Cheers,
Stan

Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

At 02:10 AM 13/11/2002 -0800, Stanislav Sinyagin wrote:

Why don’t you just create a new mailgate for your specific purposes, and
call RT’s mailgate from it? That would simplify your tasks, and keep
RT sources clean from custom solutions…

I’ll probably just migrate to the RT method. If my suggestion actually
worked in all cases I think it would be worth adding as an alternate way of
specifying queues. But I doubt it can be made to fly - it’s just a bad
idea. Pity 8-(.

Philip Warner | ___
Albatross Consulting Pty. Ltd. |----/ -
(A.B.N. 75 008 659 498) | /(@)
Tel: (+61) 0500 83 82 81 | _________
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / |
| –
___–
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

“JV” == Jesse Vincent jesse@bestpractical.com writes:

JV> On Wed, Nov 13, 2002 at 02:00:33PM +1100, Philip Warner wrote:

Then just parse the ‘To’ field, which still says ‘whatever@bugs.here.com’.
I am happy to send a patch…

JV> How does that work if you Cc or Bcc the queue?

If you guys are using postfix, you can use a transport table entry to
route all mail for a given domain to your application, and pass to it
the SMTP recipient address:

Transport entry

rt.kcilink.com rt:

and in master.cf:

handle email to @rt.kcilink.com – process inbound messages

expects rt_destination_recipient_limit = 1

rt unix - n n - 2 pipe
flags= user=nobody argv=/usr/local/rt/bin/rt-mailgate --some-magic-flag ${sender} ${recipient}

whereby the rt-mailgate application’s some-magic-flag option does the
right thing based on the sender and/or recipient.

Then you can add/delete queues at will, and the mail gateway needs no
changing, and no aliases are required.

I haven’t tried this, since I’m fine with the queues I’ve got and they
don’t change often :wink: