Incoming emails are not in the right place

Discussion in 'Installation/Configuration' started by Shyciii, Apr 22, 2022.

  1. Shyciii

    Shyciii Member

    I ran into a problem installing a Debian server (11.3) with the latest ISPConfig (autoinstaller) on it, which will run a mail server (postfix + dovecot + amavis). I had already done such a test and it worked without any problems when a direct MX record pointed to the external Ip.
    However, the new lineup is that no MX record points to the server I create, but another server filters the mail and forwards the emails to us for certain email addresses. In this case, however, the e-mails are not created under /var/vmail in the Maildir format, but under /var/mail as 1 file with the user's name, and append the e-mails for this, even though. This problem only occurs if the mail is forwarded to our server from another email server (on which exim4 is running anyway).

    What could be the problem?
     
  2. Shyciii

    Shyciii Member

    The lineup is as follows:

    The main email server that forwards the emails of certain users to us is mail.valami.hu and is in a completely different network, locally elsewhere.
    The name of our server is isp.valami.hu, but we receive the mail at mx2.valami.hu.

    Our server hosts file:

    127.0.0.1 localhost
    172.16.1.16 valami.prx.local something (this is an internal proxmox network)
    external ip isp.valami.hu isp mx2.valami.hu mx2

    The "essential" content of main.cf is:

    myhostname = isp.valami.hu
    myorigin = isp.valami.hu
    mydestination = mx2.valami.hu, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8 [:: 1] / 128
    inet_interfaces = all
    inet_protocols = all
    virtual_mailbox_base = /var/vmail

    In the log I noticed that it differs in 2 lines:

    When an mx record points to the server, so we receive the mail directly, the following appears:

    Apr 21 14:26:05 isp postfix / lmtp [158380]: 6527D101CA0: to = <[email protected]>, relay = 127.0.0.1 [127.0.0.1]: 10024, delay = 0.55, delays = 0.26 / 0.01 / 0.01 / 0.27, dsn = 2.0.0, status = sent (250 2.0.0 from MTA (smtp: [127.0.0.1]: 10025): 250 2.0.0 Ok: queued as 948EF101CA1)
    Apr 21 14:26:05 isp postfix / qmgr [3726755]: 6527D101CA0: removed
    Apr 21 14:26:05 isp dovecot: lmtp ([email protected]) <158386> <[email protected]>, relay = isp.valami.hu [private / dovecot-lmtp], delay = 0.28, delays = 0.08 / 0.01 / 0.01 / 0.18, dsn = 2.0.0, status = sent (250 2.0.0 <[email protected]> jbHqKV1NYWKyagIAbwWYLQ Saved)

    When they are forwarded to us, this will include:

    Apr 22 09:11:47 isp postfix / lmtp [211790]: 21BE2C40DCB: to = <[email protected]>, relay = 127.0.0.1 [127.0.0.1]: 10026, delay = 4.1, delays = 0.2 / 0.01 / 0 / 3.8, dsn = 2.0.0, status = sent (250 2.0.0 from MTA (smtp: [127.0.0.1]: 10027): 250 2.0.0 Reason: queued as 1B1F1C40DD2)
    Apr 22 09:11:47 isp postfix / qmgr [211782]: 21BE2C40DCB: removed
    Apr 22 09:11:47 isp postfix / local [211794]: 1B1F1C40DD2: to = <[email protected]>, relay = local, delay = 0.11, delays = 0.05 / 0.01 / 0 / 0.05, dsn = 2.0 .0, status = sent (delivered to mailbox)

    It can be seen that if it is forwarded to us, it does not come as [email protected], but as [email protected], and then it does not process dovecat, but postfix, and so at realy local is listed and not the server name.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    You probably have a Linux user with the name shyciii on that system and as your other server does not forward emails to the correct address, he uses shyciii@ mx2.valami.hu instead of shyciii@ valami.hu (he sends to the server hostname and not a virtual email domain on this server), the emails must end up in the mailbox of the Linux user shyciii.
     
  4. Shyciii

    Shyciii Member

    SOLVED: add mx2.valami.hu on Domain ear, and make domain alias to telemedia.hu. Then create new mailbox, and working like a charm.
     

Share This Page