[SOLVED] Replace subject with recipient localpart for one domain

KatyComputer

Active Member
Sep 26, 2019
193
16
38
61
St Louis
katycomputer.com
Can anyone think of a way to do this in a PMG environment, it's not possible using native Postfix:
My Postfix server handles message for a dozen domains, for one of these domains, I want the subject replaced with the recipient's local part, so something like this, but put in a format that Postfix understands:

# domain3.com is the one recipient domain we want affected by this rule
# $recipient_name the recipient localpart, so "joe" if the recipient is joe@domain3.com

IF $recipient_domain = 'domain3.com'

REPLACE $subject WITH $recipient_name

ENDIF

I think I need to setup a smtp_header_checks file, but the more I look at it the harder my head hurts.

Thanks for you help.
 
Last edited:
one thing you could do is create a rule with the domain as TO object and a modify field as action - where your replace the subject by
__TARGETS__: __SUBJECT__

caveat: this does not workas intended if a mail gets sent to 2 addresses in the domain (the subjet would be prefixed by all of the addresses)
caveat2: it does not prepend only the local part but the complete e-mail address

I hope this helps!
 
Check the logs - does the rule get triggered, or is the mail maybe accepted by a rule with a higher priority before?

I just tried replicating this here - and for me it works.

One potential cause could be the to - object - the mail needs to have the Envelop receiver to have a @katyfax.com address (and not one of a subdomain).

I hope this helps!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!