I’m trying to add a new mail domain in Hestia and configure it to relay outgoing email through my own SMTP server, which is running Postal.
Postal uses a specific username format for SMTP authentication: organizationname/mailservername (e.g., acme/mainserver ). However, when I enter this as the SMTP username in Hestia, it gets rejected as an invalid username.
It seems Hestia doesn’t allow the slash (/ ) character in the SMTP username field. Is there a workaround or a way to bypass this validation so I can use my Postal SMTP server as a relay?
I tried modifying the is_username_format_valid function as described, but unfortunately it didn’t work. Is there a service I need to restart, or do I need to restart Hestia entirely, for the changes to take effect?
Also, when a Hestia update overrides the file, would the SMTP relay configuration still work if it was already saved before the update? Or would it break again once the validation logic is restored?
If you are adding a global smtp relay, check that the right data is in the file /etc/exim4/smtp_relay.conf. If you are adding it for a domain, check the same in this file /etc/exim4/domains/YourDomain/smtp_relay.conf (replace YourDomain with the actual data).
If the data is the right one, check the log /var/log/exim4/mainlog
By “didn’t work”, I meant that Hestia still flagged the username with the slash (/ ) as invalid in the UI – even after modifying the is_username_format_valid function. It doesn’t let me save the relay config through the panel using that format.
I did manage to get it working by manually editing /etc/exim4/domains/YourDomain/smtp_relay.conf and inserting the correct username there. After that, everything works fine and mail is relayed as expected, so the data in the file is good and Exim is handling it correctly.
The problem is just with the validation in the Hestia interface. Since I separate domains across different Postal servers, I can’t use a global SMTP relay, so I have to repeat this manual step every time I add a domain, which isn’t ideal.
Let me know if there’s a cleaner or more permanent way around this.
Yes, I still get the same error when using the command line:
Error: invalid Username format :: organizationname/mailservername
So even with the modified main.sh, the v-add-mail-domain-smtp-relay command doesn’t accept the Postal-style username with a slash (/).
As mentioned earlier, I can work around it by manually editing the smtp_relay.conf file after adding the relay, and that works fine with Exim. But it would be really helpful if Hestia could officially support usernames with slashes for those of us running our own SMTP servers using Postal, where this format is required.
Ah, I overlooked that too, didn’t double-check the regex. With the corrected function, it’s now working from both the panel and the command line. Thanks!
That said, you didn’t get back to my earlier question: If a future Hestia update overrides the main.sh file and restores the original validation logic, will the existing SMTP relay configurations (with the Postal-style usernames) continue to work, or will they break due to validation issues?
I assume they should keep working, since the validation only happens at the input stage, but I’d like to be sure.
Okay, got it. So I guess the safest way for now is to add the relay using a placeholder username (without the slash), then manually edit the smtp_relay.conf file to insert the correct Postal-style username, as I had been doing. But now I’m not even sure if that manual edit will survive a rebuild or future update either.
If that gets overridden too, then I’m stuck!
I’ve been testing all weekend trying to find a clean solution that works with my Postal setup for managing personal inboxes across separate servers, but haven’t landed on anything that’s both reliable and manageable long-term. Would really love to see native support for these username formats at some point.
Thanks again for the clarification and your help throughout!