Add a redirection mail/alias without attaching it to a YunoHost account

I recently needed to create an alias who redirect to an email not manage by my yunohost instance.

To do it, I wrote into the LDAP which is read by Postfix (the mail system).
Firstly i created a file with this command

nano aliasmail 

containing the declaration of the “alias” organisational unit, and an entry with it like that

dn: ou=alias,dc=yunohost,dc=org
objectClass: organizationalUnit
objectClass: top
ou: alias

dn: uid=mail1,ou=alias,dc=yunohost,dc=org
uid: mail1
uid: jean
objectClass: inetOrgPerson
objectClass: mailAccount
cn: Jean DUPONT
sn: Jean
maildrop: redirection@anotherdomain.tld
mail: alias@domain.nohost.me

Then I run this command to add these element to the ldap

sudo ldapadd -x -D cn=admin,dc=yunohost,dc=org -W -f aliasmail

And the redirection was done, if I sent a mail to alias@domain.nohost.me it was resent to redirection@anotherdomain.tld.

Note: if you need a second alias/redirection, you don’t need to put the first part of the file because it is already in the ldap.
Note2: you can redirect an alias to several mail by adding several “maildrop” line.

1 Like

Nice, that could be an idea for an application. I’ve packaged an app like this but it is not compatible with the ldap alias system of yunohost. With this one, you can keep the yunohost alias system.

Nice tip !

On my side what I would appreciate is having one alias that forwards to a number of already registered yunohost users, without creating an additionnal yunohost user specifically for that.
Seems like your solution could fit the purpose.

Definilty, we need to have this feature available within the moulinette !!

I know this topic is very old, but I have the very same need (e-mail forwarding without Yunohost account).
Does anyone know if this is the only/preferred method to address that need?

On the other hand, would it be possible to have a yunohost account, with e-mail forwarding and no local IMAP account?

Thanks !

Which email address do you need forwarded where exactly? And for what purpose?
Because if you just want to use a YunoHost account and read/send emails using another address, you can just use the Rainloop app and add all your addresses.

I’m planning to manage the family domain which corresponds to our last name: every member has a first_name@domain forwarding e-mail address. So ideally:

  • some users would have a yunohost account, but I don’t wan’t to host their e-mails --> only forwarding to their own personal e-mail account (gmail.com or whatever)
  • some users wouldn’t have a yunohost account, but still they would need to get the e-mails forwarded to their own personal e-mail account

I rested it today, 2 years after, and it works

1 Like

Hello,
digging up this subject once again !

Is there any way to do the alias in the yunohost web interface ?
(I’d like it to be understandable for the next person in my organisation who have to manage the aliases)