Community

Regexp email address/aliases

Hi!
For years I have a system where I use unique email-addresses at different places. So if web page www.domain.tld ask my email address, I give address www.domain.tld@mydomain.tld.
Postfix supports regexp aliases like:
/www[.+].*@mydomain.tld/ jjussi@mydomain.tld

And when needed, I can black-list with aliases too:
/www.121carhire.com./ dev_null
/www.erentals.co.uk.
/ dev_null

After starting to use this method, I haven’t received spam basically, because I know from where spammers got address originally.

I think that I’m not only one who would like to see this “feature”…

Hello,

So basically you are asking for a feature that would allow you to add “regexp” based aliases for an account - is this correct?

BR,
Ioan

Yes!
It’s easy when you can spread around email addresses what are always unique and you don’t need to “add” those addresses anywhere.
I use
www.*
email.*
review.*

Depending place where I need to “give” my email address. F.ex. review.site.name@mydomain.tld tell me that I have left review to that site.name -site.

If that site is hacked, hackers got ONLY that one email-address and even they managed to get password too… It’s just that user name and password… You cannot use it to login some other site and then comes that, that I can easily to “black-list” only that one email-address.
One time when I started to get spam emails and contacted “that” company, they answered that “thank you, we just found out that one of our worker had steeled our customer database and given it to “his” friend for marketing purposed. This person don’t work us anymore…”

Hello,

I completely understand your use case and please allow me to present the following workaround which I have tested on one of our test platforms.

:information_source: This may be a longer post so please bear with me

0/ login in WebAdmin and go to Security & Filtering > Acceptance & Routing > Advance settings

1/ add a new rule for defining your aliases - let’s name this rule aliases-definition

for ANY of following conditions:

  • Recipient > Email > Regexp: www\..*@your\.domain\.tld
  • Recipient > Email > Regexp: www\..*@your\.domain\.tld

actions:

  • Headers > Add header > Custom > X-ORIG-FOR > Value: %currentRcpt%
  • Recipients > Change recipient > Name: destination.account@your.domain.tld

2/add a new rule for aliases you like to blacklist - let’s name this rule aliases-blacklist
for ANY of following conditions:

  • Recipient > Email > Is: www.blacklisted-1.com@your.domain.tld
  • Recipient > Email > Is: info.blacklisted-2.com@your.domain.tld

actions:

  • SMTP > action: Reject | Explanation: Blacklisted address

3/ please check that both rules are listed under On Recipient and bring rule #2 in front of rule #1 (so the blacklist rule will be executed before the rule dedicated for aliases definition

After that all should be fine and you could start your tests :grinning:

Notes:

  • please pay attention that inside the regex string you should escape the dot (.) present into the “recipient” email addresses
  • at any time you could check the X-ORIG-FOR header to identify the original recipient so you could understand how the message reached your inbox (or the final destination you have chosen).

Please let us know if the presented workaround is useful for you or you still need some tweaks.

BR,
Ioan

1 Like

Hi!
Thank you, very much!!!
It worked perfectly, both black-list and white-list REGEXP-aliases. :smiling_face_with_three_hearts:

Actually that X-ORIG-FOR is not really needed (but I have it), because (at least) webmail interface show that original recipient address under subject.

Now there is just one feature what I would like to see there… When I press “reply”, webmail interface would use that original to:-address as from:-address EVEN there is no alias/user account for that email-address. Maybe it could be done using that X-ORIG-FOR header? So, if there is X-ORIG-FOR header, it is used as from: -address.

That way, I can answer to the sender (company) with email-address what they know and not revealing my “right” email-address. :smiley: