1
0
Fork
You've already forked omr
0
OVH Mail Redirections
  • Lua 100%
Find a file
Christophe Delord cc91942d7e edit command
2026年05月27日 21:17:15 +02:00
.gitignore implement ls add rm and import 2026年01月30日 20:39:05 +01:00
.gitmodules LuaX 10 port 2026年04月16日 21:45:36 +02:00
build.lua LuaX 10 port 2026年04月16日 21:45:36 +02:00
LICENSE License 2026年02月28日 10:50:01 +01:00
omr.lua edit command 2026年05月27日 21:17:15 +02:00
README.md edit command 2026年05月27日 21:17:15 +02:00

OVH Mail Redirections

Quick LuaX program to manage mail redirections on OVH mailboxes and domain names.

Disclaimer

By using this software, you acknowledge that it is your responsibility to fully understand how it works, how it is configured, and how it is used in your environment.

You assume full responsibility for any actions performed with this software, including but not limited to configuration changes, data handling, deployment decisions, and operational use.

The author, contributors, and distributors of this software shall not be held responsible or liable for any misuse, damage, data loss, security issues, legal consequences, or other consequences arising from the use or misuse of this software.

Use this software at your own risk.

Compilation

You need to install LuaX:

export PREFIX=~/.local # <-- your installation prefix directory here
export CDSOFT=https://codeberg.org/cdsoft
git clone $CDSOFT/luax && ( cd luax && ./build.lua && ninja install )
eval $($PREFIX/bin/luax env) # <-- also add this to .bashrc/.zshrc/...

Then get omr and install it:

git clone $CDSOFT/omr && ( cd omr && bang && ninja install )

Configuration

The configuration is in ~/.config/omr.toml. E.g.:

default = {
 domain = { from = "domain1.tld", to = "domain2.tld" },
 name = "default_name",
}
domains = [
 "domains.tld",
]
external_emails = [
 "name1@external_domain1.tld",
 "name2@external_domain2.tld",
]
api = {
 # See https://api.ovh.com/createToken/
 # Rights: GET, POST, DELETE
 endpoint = "https://eu.api.ovh.com/1.0",
 application_key = "...",
 application_secret = "...",
 consumer_key = "...",
}

Usage

$ omr
OVH Mail Redirections
omr ls [pattern]
omr add new_alias [to existing_email]
omr rm existing_alias [to existing_email]
omr import file
omr edit

Documentation

Let's say you own two domains (domain1.tld and domain2.tld), you have a private email (me@domain1.tld) and you need redirections from both domains to your private email. You also want some redirection to an external email (me@external_domain.tld).

Configuration

The configuration file can look like:

default = {
 domain = { from = "domain1.tld", to = "domain1.tld" },
 name = "default_name",
}
domains = [
 "domain1.tld",
 "domain2.tld",
]
external_emails = [
 "me@external_domain.tld",
]
api = {
 # See https://api.ovh.com/createToken/
 # Rights: GET, POST, DELETE
 endpoint = "https://eu.api.ovh.com/1.0",
 application_key = "<your application key>",
 application_secret = "<your application secret>",
 consumer_key = "<your consumer key>",
}

List existing redirections

  • omr ls: list all redirections
  • omr ls @domain2: list all redirections to domain2.tld
  • omr ls foo: list all redirections containing foo in the user name

Add new redirections

  • from foo@domain1.tld to me@domain1.tld:

    • omr add foo@domain1.tld to me@domain1.tld (explicit domains and names)
    • omr add foo@domain1.tld to me (domain1.tld is the default destination domain)
    • omr add foo@domain1.tld (me@domain1.tld is the default destination address)
    • omr add foo (domain1.tld is also the default source domain)
  • from foo@domain2.tld to me@domain1.tld:

    • omr add foo@domain2.tld to me@domain1.tld (explicit domains and names)
    • omr add foo@domain2.tld to me (domain1.tld is the default destination domain)
    • omr add foo@domain2.tld (me@domain1.tld is the default destination address)
  • from foo@domain2.tld to me@domain2.tld:

    • omr add foo@domain2.tld to me@domain2.tld (explicit domains and names)

Remove redirections

  • from foo@domain1.tld to me@domain1.tld only:

    • omr rm foo@domain1.tld to me@domain1.tld (explicit domains and names)
    • omr rm foo to me@domain1.tld (domain1.tld is the default destination domain)
  • from foo@domain1.tld to all emails:

    • omr rm foo@domain1.tld (explicit domains and names)
    • omr rm foo (domain1.tld is the default destination domain)

Save and import redirections

  • save all existing redirections: omr ls > redirections
  • restore redirections: omr import redirections

License

omr is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
omr is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with omr. If not, see <https://www.gnu.org/licenses/>.
For further information about omr you can visit
https://codeberg.org/cdsoft/omr