[GH-ISSUE #1718] Autoconfig xml correction for domainname in <hostname> field #1355

Closed
opened 2026-02-27 11:16:41 +03:00 by kerem · 2 comments
Owner

Originally created by @mertowitch on GitHub (Apr 13, 2019).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1718

Impacted versions

  • Modoboa: 1.13.1
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

Current behavior

<outgoingServer type="smtp">
    <hostname>mail.SERVERDOMAIN.com</hostname>
    <port>587</port>
    <socketType>STARTTLS</socketType>
    <authentication>password-cleartext</authentication>
    <username>info@CUSTOMERDOMAIN.com</username>
    <useGlobalPreferredServer>yes</useGlobalPreferredServer>
</outgoingServer>

Expected behavior

<outgoingServer type="smtp">
    <hostname>mail.CUSTOMERDOMAIN.com</hostname>
    <port>587</port>
    <socketType>STARTTLS</socketType>
    <authentication>password-cleartext</authentication>
    <username>info@CUSTOMERDOMAIN.com</username>
    <useGlobalPreferredServer>yes</useGlobalPreferredServer>
</outgoingServer>

for fix => in /etc/automx.conf

find this =>

query = SELECT first_name || ' ' || last_name AS display_name, email FROM core_user WHERE email='%s' AND is_active
result_attrs = display_name, email

smtp = yes
smtp_server = mail.SERVERDOMAIN.com
smtp_port = 587
smtp_encryption = starttls
smtp_auth = plaintext
smtp_auth_identity = ${email}
smtp_refresh_ttl = 6
smtp_default = yes

imap = yes
imap_server = mail.SERVERDOMAIN.com
imap_port = 143
imap_encryption = starttls
imap_auth = plaintext
imap_auth_identity = ${email}
imap_refresh_ttl = 6

pop = yes
pop_server = mail.SERVERDOMAIN.com
pop_port = 110
pop_encryption = starttls
pop_auth = plaintext
pop_auth_identity = ${email}

replace with =>

query = SELECT first_name || ' ' || last_name AS display_name, email, SPLIT_PART(email,'@',2) AS domain FROM core_user WHERE email='%s' AND is_active
result_attrs = display_name, email, domain

smtp = yes
smtp_server = mail.${domain}
smtp_port = 587
smtp_encryption = starttls
smtp_auth = plaintext
smtp_auth_identity = ${email}
smtp_refresh_ttl = 6
smtp_default = yes

imap = yes
imap_server = mail.${domain}
imap_port = 143
imap_encryption = starttls
imap_auth = plaintext
imap_auth_identity = ${email}
imap_refresh_ttl = 6

pop = yes
pop_server = mail.${domain}
pop_port = 110
pop_encryption = starttls
pop_auth = plaintext
pop_auth_identity = ${email}

Thanks.

Originally created by @mertowitch on GitHub (Apr 13, 2019). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1718 # Impacted versions * Modoboa: 1.13.1 * installer used: Yes * Webserver: Nginx # Steps to reproduce # Current behavior ``` <outgoingServer type="smtp"> <hostname>mail.SERVERDOMAIN.com</hostname> <port>587</port> <socketType>STARTTLS</socketType> <authentication>password-cleartext</authentication> <username>info@CUSTOMERDOMAIN.com</username> <useGlobalPreferredServer>yes</useGlobalPreferredServer> </outgoingServer> ``` # Expected behavior ``` <outgoingServer type="smtp"> <hostname>mail.CUSTOMERDOMAIN.com</hostname> <port>587</port> <socketType>STARTTLS</socketType> <authentication>password-cleartext</authentication> <username>info@CUSTOMERDOMAIN.com</username> <useGlobalPreferredServer>yes</useGlobalPreferredServer> </outgoingServer> ``` for fix => in **/etc/automx.conf** find this => ``` query = SELECT first_name || ' ' || last_name AS display_name, email FROM core_user WHERE email='%s' AND is_active result_attrs = display_name, email smtp = yes smtp_server = mail.SERVERDOMAIN.com smtp_port = 587 smtp_encryption = starttls smtp_auth = plaintext smtp_auth_identity = ${email} smtp_refresh_ttl = 6 smtp_default = yes imap = yes imap_server = mail.SERVERDOMAIN.com imap_port = 143 imap_encryption = starttls imap_auth = plaintext imap_auth_identity = ${email} imap_refresh_ttl = 6 pop = yes pop_server = mail.SERVERDOMAIN.com pop_port = 110 pop_encryption = starttls pop_auth = plaintext pop_auth_identity = ${email} ``` replace with => ``` query = SELECT first_name || ' ' || last_name AS display_name, email, SPLIT_PART(email,'@',2) AS domain FROM core_user WHERE email='%s' AND is_active result_attrs = display_name, email, domain smtp = yes smtp_server = mail.${domain} smtp_port = 587 smtp_encryption = starttls smtp_auth = plaintext smtp_auth_identity = ${email} smtp_refresh_ttl = 6 smtp_default = yes imap = yes imap_server = mail.${domain} imap_port = 143 imap_encryption = starttls imap_auth = plaintext imap_auth_identity = ${email} imap_refresh_ttl = 6 pop = yes pop_server = mail.${domain} pop_port = 110 pop_encryption = starttls pop_auth = plaintext pop_auth_identity = ${email} ``` Thanks.
kerem closed this issue 2026-02-27 11:16:41 +03:00
Author
Owner

@tonioo commented on GitHub (Apr 29, 2019):

@mertowitch Ok I see. Do you know if SPLIT_PART is available for MySQL ?

<!-- gh-comment-id:487525046 --> @tonioo commented on GitHub (Apr 29, 2019): @mertowitch Ok I see. Do you know if SPLIT_PART is available for MySQL ?
Author
Owner

@tonioo commented on GitHub (Apr 29, 2019):

Ok, I found. github.com/modoboa/modoboa-installer@688c7744af.

<!-- gh-comment-id:487526246 --> @tonioo commented on GitHub (Apr 29, 2019): Ok, I found. https://github.com/modoboa/modoboa-installer/commit/688c7744af8db6e4bf06fa062ac38cf98a798baf.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1355
No description provided.