Mail alias with wildcard

,

My YunoHost configuration

Hardware: x64 vps
Internet access: in a datacenter
**YunoHost version: **
yunohost: 3.2.1
yunohost-admin: 3.2.1
moulinette: 3.2.0
ssowat: 3.2.0
Have you personalized your yunohost with some specifics configurations or do you use only the yunohost cli/webadmin tool ? basic

Description of my problem

Hello all,

I would like to add a mail alias with a wildcard to an account, so that it receives all mail in the form “mailboxUNIQUECODE@example.com”. I tried adding a mail alias in the form “mailbox*@example.com” but I get the error “Error: Invalid argument ‘add_mailalias’: Must be a valid email address (e.g. someone@domain.org)”

Is there a way to setup such a system? I would also be able to work with a catch-all mailbox, which receives all the messages sent to the server.

Thanks to everyone!

1 Like

I, too, would like to know whether wildcard or catch-all email addressing is doable. Thank you!

I tried to create an alias *@demo.yunohost.org on the demo site, but it’s rejected

Would be great if there’s official support of wildcard email alias, thanks!

1 Like

Hello,
Yes it will be a good feature for me too. :grinning:
Is there another way to do this ?
Thanks

For the moment, only the + selector support is available.

SO email+XXXXX@domain.tld

BUT you can do it “by hand” and with cli, you need to change /etc/postfix/main.cf with:

virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman,ldap:/etc/postfix/ldap-aliases.cf,regexp:/etc/postfix/aliases-regexp

Create a file /etc/postfix/aliases-regexp like this one:

/mailbox.*@example\.com/ mailbox@example.com

Use postmap on it

postmap /etc/postfix/aliases-regexp

Define in yunohost admin an alias mailbox@example.com on a user.

Restart postfix

systemctl restart postfix
1 Like

Thank @ljf I will try it :smiley:
(I didn’t see before you made an answer !!)

This worked! (Mail on main domain, yunohost on subdomain - #3 by samuel-ynh)

But unfortunately only for receiving mails, if I try to send a mail from a wildcard alias I get:
Sender address rejected: not owned by user

Do you have an idea on how to send mails from wildcard aliases?

Thanks in advance!