{"code":200,"data":{"id":"vswy7le3vw","slug":"custom-message-ids-with-mutt-and-coolname","appearance":"norm","language":"en","rtl":false,"created":"2024-02-27T23:30:25Z","updated":"2024-02-27T23:31:42Z","title":"Custom message-ids with mutt and coolname","body":"Message-ID's are used to identify and retrieve messages from the public-inbox archive on lore.kernel.org, so it's only natural to want to use memorable ones. Or maybe it's just me.\n\nRegardless, here's what I do with neomutt and [coolname](https://pypi.org/project/coolname/):\n\n1. If coolname isn't yet packaged for your distro, you can install it with pip:\n\n    ```\n    pip install --user coolname\n    ```\n\n2. Create this file as `~/bin/my-msgid.py`:\n\n    ```python\n    #!/usr/bin/python3\n    import sys\n    import random\n    import string\n    import datetime\n    import platform\n\n    from coolname import generate_slug\n\n    parts = []\n    parts.append(datetime.datetime.now().strftime('%Y%m%d'))\n    parts.append(generate_slug(3))\n    parts.append(''.join(random.choices(string.hexdigits, k=6)).lower())\n\n    sys.stdout.write('-'.join(parts) + '@' + platform.node().split('.')[0])\n    ```\n\n3. Create this file as `~/.mutt-fix-msgid`:\n\n    ```\n    my_hdr Message-ID: \u003c`/path/to/my/bin/my-msgid.py`\u003e\n    ```\n\n4. Add this to your `.muttrc` (works with mutt and neomutt):\n\n    ```\n    send-hook . \"source ~/.mutt-fix-msgid\"\n    ```\n\n5. Enjoy funky message-id's like `20240227-flawless-capybara-of-drama-e09653@lemur`. :)","tags":[],"paid":false,"views":3408,"likes":0}}