Plesk migration (17.0.17) to Virtualmin (latest): email bounces due to wrong entries in virtualmap after import

Hi there,

First off: completely new to Virtualmin and like it so far!
My latest impression: great seeing SNI support in postfix making it into virtualmin, thanks!

Problem:
Migrating from plesk 17 (using single domain exports from plesk) doesn’t allow for correct email reception, while sending works.

Reason:
/etc/postfix/virtual contains BOUNCE entries for every imported mail account.

Fix:
Change “Primary email address enabled?” from “No” to “Yes” for each imported mail account.

Info:
I’m using “user@domain” style logins and have “Create extra Unix user on Postfix systems when using user@domain format?” set to “Yes” in Virtualmin Configuration -> Advanced Options.

Question:

Is this related to my plesk export or a bug in the virtualmin migration process? Since I’m only getting acquainted with Virtualminm there may also be a setting that I’ve overlooked, allowing to toggle primary email address activation upon migration? I’d like to get to the bottom of this before migrating 30+ servers and 160+ mailboxes.

I tried looking into this and found the following code in migration-plesk9.pl:


577 if (@{$uinfo->{‘to’}}) {
578 # Only enable mail if there is at least one destination, which
579 # would be his own mailbox or offsite
580 $uinfo->{‘email’} = lc($name)."@".$dom;
581 }
582 else {
583 delete($uinfo->{‘email’});
584 }

I guess this should take care of enabling the primary address? The earlier


529 if ($mailuser->{‘mailbox’}->{‘enabled’} eq ‘true’) {
530 # Add delivery to user’s mailbox
531 local $escuser = $uinfo->{‘user’};

should trigger since the XML has mailbox->enabled->true.
E.g.:

  <mailuser user-guid="60bd7dce-63c8-1e78-3876-16b9b2885d07" name="ib" mailbox-quota="-1" cp-access-default="true" id="63" guid="f4136b76-7523-4a35-814f-cc83dd940193_mn_63" owner-guid="f4136b76-7523-4a35-814f-cc83dd940193" forwarding-enabled="false">
    <properties>
      <password type="plain">****</password>
    </properties>
    <preferences>
      <mailbox type="mdir" enabled="true">
        <content>
          <cid unpacksize="0" referrer="true" path="" type="mailbox" offset="ib/Maildir">
            <content-file size="15114240">backup_domainmail_2006271151.tar</content-file>
          </cid>
        </content>
      </mailbox>
      <alias>butler</alias>
      <alias>edu</alias>
      <alias>ibres</alias>
      <alias>sales</alias>
      <alias>support</alias>
      <autoresponders>
        <content>
          <cid unpacksize="0" referrer="true" path="" type="attaches" offset="ib/@attachments">
            <content-file size="15114240">backup_domainmail_2006271151.tar</content-file>
          </cid>
        </content>
      </autoresponders>
      <addressbook/>
      <spamassassin hits="7" status="on" action="mark" subj-text="***SPAM***">
        <content>
          <cid unpacksize="0" referrer="true" path="" type="spam-assasin" offset="ib/.spamassassin">
            <content-file size="15114240">backup_domainmail_2006271151.tar</content-file>
          </cid>
        </content>
      </spamassassin>
      <virusfilter state="in"/>
      <descriptions>
        <description/>
      </descriptions>
    </preferences>
  </mailuser>

mail.log entries before enabling the primary email address:

Jul 25 15:14:02 k4 postfix/smtpd[14701]: connect from mail-wm1-f45.google.com[209.85.128.45]
Jul 25 15:14:02 k4 postfix/smtpd[14701]: BB85D24407CF: client=mail-wm1-f45.google.com[209.85.128.45]
Jul 25 15:14:02 k4 postfix/cleanup[14513]: BB85D24407CF: message-id=<55406569-2A0A-403D-ABBD-85E5014E5C5C@gmail.com>
Jul 25 15:14:02 k4 postfix/qmgr[25180]: BB85D24407CF: from=<someuser@gmail.com>, size=3000, nrcpt=1 (queue active)
Jul 25 15:14:02 k4 postfix/smtpd[14701]: disconnect from mail-wm1-f45.google.com[209.85.128.45] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7
Jul 25 15:14:02 k4 postfix/local[14706]: BB85D24407CF: to=<BOUNCE@k4.someserver.de>, orig_to=<ib@migrateddomain.ch>, relay=local, delay=0.12, delays=0.03/0.01/0/0.08, dsn=5.1.1, status=bounced (unknown user: "bounce")
Jul 25 15:14:02 k4 postfix/cleanup[14513]: D8D342441905: message-id=<20200725131402.D8D342441905@k4.someserver.de>
Jul 25 15:14:02 k4 postfix/bounce[14708]: BB85D24407CF: sender non-delivery notification: D8D342441905
Jul 25 15:14:02 k4 postfix/qmgr[25180]: D8D342441905: from=<>, size=4895, nrcpt=1 (queue active)
Jul 25 15:14:02 k4 postfix/bounce[14708]: BB85D24407CF: postmaster non-delivery notification: E1FB12441906
Jul 25 15:14:02 k4 postfix/qmgr[25180]: BB85D24407CF: removed
Jul 25 15:14:03 k4 postfix/smtp[14514]: D8D342441905: to=<someuser@gmail.com>, relay=gmail-smtp-in.l.google.com[64.233.167.27]:25, delay=0.58, delays=0.04/0/0.2/0.34, dsn=2.0.0, status=sent (250 2.0.0 OK  1595682843 j14si808414wru.381 - gsmtp)
Jul 25 15:14:03 k4 postfix/qmgr[25180]: D8D342441905: removed

In the meantime, is there a way to quickly enable all primary email addresses for a specific domain from the cli?

I’d love some input on this!

Thanks
-c

It’s probably a bug in the import. The backup format is not documented (at least it wasn’t last I looked), so we take a guess-and-pray approach to imports, and we fix problems when we become aware of them.

What’s in the postfix virtual map and what should be there? (that’s in /etc/postfix/virtual in Virtualmin, not sure how Plesk does things wrt to mail. I don’t even know if they use Postfix, off-hand.)

Hi @Joe, thanks for the quick answer.

Postfix uses postfix (in my case? might have set it up that way) and stores its maps in /var/spool/postfix/plesk/ on the export system. For the test domain I exported for migration in plesk, I get

root@someserver:/var/spool/postfix/plesk# postmap -s hash:virtual | grep exportdomain.tld
anonymous@exportdomain.tld   anonymous@localhost.localdomain
postmaster@exportdomain.tld  info@exportdomain.tld
root@exportdomain.tld        info@exportdomain.tld
sales@exportdomain.tld       ib@exportdomain.tld
whois@exportdomain.tld       info@exportdomain.tld
ib@exportdomain.tld  ib@exportdomain.tld
ibres@exportdomain.tld       ib@exportdomain.tld
mailer-daemon@exportdomain.tld       mailer-daemon@localhost.localdomain
support@exportdomain.tld     ib@exportdomain.tld
abuse@exportdomain.tld       info@exportdomain.tld
butler@exportdomain.tld      ib@exportdomain.tld
web@exportdomain.tld info@exportdomain.tld
drweb@exportdomain.tld       drweb@localhost.localdomain
edu@exportdomain.tld ib@exportdomain.tld
info@exportdomain.tld        info@exportdomain.tld
kluser@exportdomain.tld      kluser@localhost.localdomain

Plesk does not create local unix users for email only accounts, just the admin account is a unix user with /bin/false shell.

The above exportdomain.tld does not have a catchall in place. If it did, there would be the standard

@exportdomain.tld someemail@exportdomain.tld

in addition. Plesk also uses a hashmap for user to email home mapping called vmailbox that includes e.g.

info@exportdomain.tld exportdomain.tld/info/Maildir

After migration, virtualmin postfix map looks like this:

root@vminserver:/etc/postfix# cat virtual | grep exportdomain.tld
exportadmin@exportdomain.tld exportadmin
exportdomain.tld     exportdomain.tld
@exportdomain.tld    BOUNCE
wp_d1a4y@exportdomain.tld    BOUNCE
ib@exportdomain.tld  BOUNCE
butler@exportdomain.tld      ib-exportdomain.tld
edu@exportdomain.tld ib-exportdomain.tld
ibres@exportdomain.tld       ib-exportdomain.tld
sales@exportdomain.tld       ib-exportdomain.tld
support@exportdomain.tld     ib-exportdomain.tld
info@exportdomain.tld        BOUNCE
abuse@exportdomain.tld       info-exportdomain.tld
postmaster@exportdomain.tld  info-exportdomain.tld
root@exportdomain.tld        info-exportdomain.tld
web@exportdomain.tld info-exportdomain.tld
whois@exportdomain.tld       info-exportdomain.tld

After the virtualmin config change (Enable Primary Email address), like thus:

root@vminserver:/etc/postfix# cat virtual | grep exportdomain.tld
exportadmin@exportdomain.tld exportadmin
exportdomain.tld     exportdomain.tld
@exportdomain.tld    BOUNCE
wp_d1a4y@exportdomain.tld    BOUNCE
ib@exportdomain.tld  ib-exportdomain.tld
butler@exportdomain.tld      ib-exportdomain.tld
edu@exportdomain.tld ib-exportdomain.tld
ibres@exportdomain.tld       ib-exportdomain.tld
sales@exportdomain.tld       ib-exportdomain.tld
support@exportdomain.tld     ib-exportdomain.tld
info@exportdomain.tld        info-exportdomain.tld
abuse@exportdomain.tld       info-exportdomain.tld
postmaster@exportdomain.tld  info-exportdomain.tld
root@exportdomain.tld        info-exportdomain.tld
web@exportdomain.tld info-exportdomain.tld
whois@exportdomain.tld       info-exportdomain.tld

I’ll debug further if needed. Since I’m a bit under time pressure, I haven’t had a chance to look at the XML and perl migration yet.

Thank you for looking into this. Let me know if I can help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.