# Send mails from wildcard \*@example.com

**URL:** https://forum.yunohost.org/t/send-mails-from-wildcard-example-com/22251
**Category:** Advanced use case
**Tags:** mail, english
**Created:** [November 23, 2022, 8:03am UTC](https://forum.yunohost.org/t/send-mails-from-wildcard-example-com/22251 "2022-11-23T08:03:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![samuel-ynh](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@samuel-ynh](https://forum.yunohost.org/u/samuel-ynh)
#### Post date: [November 23, 2022, 8:03am UTC](https://forum.yunohost.org/t/send-mails-from-wildcard-example-com/22251/1 "2022-11-23T08:03:25Z")

</div>

Hi,

I managed to receive mail on my own domain with wildcards/regular expressions. For example `user@example.com` receives all the mails in the form of `*user@example.com`.

But unfortunately I’m not able to send mails from this account with the corresponding sender.

I would love to be able to send mails as `*@example.com`.

I’m not familiar enough to know the right postfix options.

Thank you for your help!  
Samuel

For reference, my setup right now:

> [@Yunohost on Subdomain, Mail on main domain](https://forum.yunohost.org/t/mail-on-main-domain-yunohost-on-subdomain/21935/4):
>
> Okay, it worked, like you said. For reference i try to describe my setup in some detail (2024-11-07 now with yunohost 12 update). Domain Yunohost runs under yunohost.example.com, the DNS is set up according to the generated DNS config by Yunohost The domain example.com was added as well, but only the DNS entries corresponding to mail were added. Additionally the mx entry for example.com points to 10 yunohost.example.com Reverse DNS-entry for the emails should be the yunohost subdomain (yun…

---

<div class="post-metadata">

### Author: ![crustyourmind](https://forum.yunohost.org/user_avatar/forum.yunohost.org/crustyourmind/32/2197_2.png) [@crustyourmind](https://forum.yunohost.org/u/crustyourmind)
#### Post date: [November 23, 2022, 3:40pm UTC](https://forum.yunohost.org/t/send-mails-from-wildcard-example-com/22251/2 "2022-11-23T15:40:40Z")

</div>

Hi

Not sure to all understand, but if you want to send a email to all users of your yunohost server, you can see this thread

> [@Envoyer un mail à tous les utilisateurs du système](https://forum.yunohost.org/t/envoyer-un-mail-a-tous-les-utilisateurs-du-systeme/20410/4):
>
> Bon voici un script (minimal) qui fonctionne Créer un fichier mail-all-users.sh #!/bin/bash # Test validité des arguments if [[$# -ne 2]]; then echo "Nombre argument incorrect" echo "2 arguments nécessaires : le sujet et le nom du fichier du corps du mail" exit else echo "Nombre d'arguments correct" # Test que le second argument soit un fichier if [[-f $2]]; then echo "Second argument valide" else echo "Le fichier indiqué n'est…

Cheers

---

<div class="post-metadata">

### Author: ![samuel-ynh](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@samuel-ynh](https://forum.yunohost.org/u/samuel-ynh)
#### Post date: [November 25, 2022, 10:39am UTC](https://forum.yunohost.org/t/send-mails-from-wildcard-example-com/22251/3 "2022-11-25T10:39:01Z")

</div>

Sorry, then I was unclear in my first post.

Every user has its own mail-space where she receives mails to the addresses in the space `*username@example.com`.

But unfortunately they can only send mails from `username@example.com` and not from all mail-addresses in the form of `*username@example.com`.

Right now I _fixed_ it with the commenting out `reject_sender_login_mismatch` in the postfix `main.cf`.  
But that is not the perfect way to handle it, I guess.
