Here’s what I have:
# MAIL SETTINGS:
Then in mail aliases:(
/etc/aliases) for each queue:
support: "|/usr/bin/rt-mailgate --queue \"Support\" --action correspond --url https://support.domain.net/rt"
support-comment: "|/usr/bin/rt-mailgate --queue \"Support\" --action comment --url https://support.domain.net/rt"
This pipes the input into RT from exim (in our case).
Then in each queue config in RT (under Admin → Queues) the Reply Address and Comment address are set the same, but underneath each one is a note that what it would be set to by default, which is picked up from the config. A few of our queues have a different address.
Some MTAs by default do not allow unprivileged users to use the
"-f" option to override the envelope from address. Check what the default “sendmail” does on your system.
For exim for example, you might need to set
# allow untrusted users to set an envelope sender
untrusted_set_sender = *
(or just the user that RT is running from, maybe www-user. This seems to be the default though in, say, the debian/ubuntu exim conf scheme.)
You’ll have to look at the various logs for RT and your MTA to determine what’s going on.