Email Not Functional After Server Restore/Migration

Hello,
I went from a 32 bit 10.04 Ubuntu on an old pentium to a new server with Ubuntu 12.04 64 bit and I backed up and restored, but I made a few mistakes before I realized email didn’t work.

The FQDN didn’t take, the server name is different than the old one, and I accidentally made the wrong username for one of my restored domains. I can not send or receive emails at all. I have 2 domains from the old server and a new domain for the FQDN on the new server (not important).

I use DynDNS for all 3 domain names. 2 of them are paid for and the FQDM is a free one (dynamic dnsing, that is).

I had used a gmail account previously to send and receive Pop3 mail but I see no linking at all at this time. I would like to go back to that arrangement (not a 2 factor authenticated email)

postconf -n
2bounce_notice_recipient = admin@email.com
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
biff = no
bounce_notice_recipient = admin@email.com
broken_sasl_auth_clients = yes
command_time_limit = 100s
config_directory = /etc/postfix
delay_notice_recipient = admin@email.com
error_notice_recipient = admin@email.com
home_mailbox = Maildir/
ignore_mx_lookup_error = yes
inet_interfaces = all
inet_protocols = all
luser_relay = admin@email.com
mailbox_command = procmail -a “$EXTENSION”
mailbox_size_limit = 0
maximal_backoff_time = 400s
maximal_queue_lifetime = 2d
minimal_backoff_time = 300s
mydestination = localdomain, localhost.home, localhost, $mydomain, $myhostname, mail.website1.com, mail.website2.com, MyHostname, My.FQDM.com, MyHostname.website2.com, www.website1.com, website1.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
queue_minfree = 8000
queue_run_delay = 30s
readme_directory = no
recipient_delimiter = +
relay_transport = smtp
relayhost =
sender_bcc_maps = hash:/etc/postfix/bcc
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_sasl_tls_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated rejec t_unauth_destination check_relay_domains permit_inet_interfaces permit_mx_backup
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous noplaintext
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = no
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_limit = 0

Here are some log entries for sample mail errors:
Sep 21 21:34:21 MyHostname postfix/local[13274]: fatal: main.cf configuration error: mailbox_size_limit is smaller than message_size_limit
Sep 23 05:20:31 MyHostname dovecot: imap(NewUser): Error: stat(/home/NewUser/Maildir/.spam/tmp) failed: Permission denied (euid=1008(NewUser) egid=1007(NewUser) missing +x perm: /home/NewUser/Maildir/.spam, dir owned by 1009:1007 mode=0700)
(all mail folders follow, similar error)
Sep 23 05:21:03 MyHostname postfix/smtpd[8232]: fatal: no SASL authentication mechanisms
Sep 23 05:54:13 MyHostname postfix/postalias[16054]: fatal: open /etc/postfix/aliases: No such file or directory
Sep 23 07:05:05 MyHostname postfix/postmap[4426]: fatal: usage: postmap [-Nfinoprsvw] [-c config_dir] [-d key] [-q key] [map_type:]file…
Sep 23 07:07:36 MyHostname postfix/postmap[4664]: fatal: open /etc/postfix/sender_relay: No such file or directory

Anyone have ideas where to start? I have been working on this for days and I am missing some critical understanding somewhere. I would appreciate any assistance

(all dbs and websites are functioning fine as far as I can tell. its just email that is the problem)

What output do you get for this?

postconf | grep size_limit

You might want to check the permissions of the Maildir/.spam of your “NewUser”, and compare it against other maildirs, for some reason dovecot cannot create temp files there.

What’s the output for

postconf | grep alias

Did you try restarting the server after making config changes? It looks to me like Postfix is not using the latest values in some places.

Thanks for your response. I do restart regularly (well, more regularly than a server should or that I would if everything was functioning correctly)

grep size_limit
body_checks_size_limit = 51200
bounce_size_limit = 50000
header_size_limit = 102400
mailbox_size_limit = 0
message_size_limit = 10240000

postconf | grep alias
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_mail_to_commands = alias, forward
allow_mail_to_files = alias, forward
expand_owner_alias = no
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
newaliases_path = /usr/bin/newaliases
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps $alias_maps
reset_owner_alias = no
unknown_virtual_alias_reject_code = 550
virtual_alias_domains = $virtual_alias_maps
virtual_alias_expansion_limit = 1000
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_recursion_limit = 1000

Well I’m mostly at a loss about the errors you’re seeing; at this point I can only offer you the output I get for postconf -n, which considerably differs from yours. How did you install Virtualmin on your new server? Did you use the installer script? If so, you should not end up with all those additional directives and values in your main.cf really.

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases allow_percent_hack = no append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix home_mailbox = Maildir/ inet_interfaces = all mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -a "$EXTENSION" -d $LOGNAME mailbox_size_limit = 0 message_size_limit = 50000000 mydestination = HOST.DOMAIN.de, localhost.DOMAIN.de, , localhost myhostname = HOST.DOMAIN.de mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + sender_bcc_maps = hash:/etc/postfix/bcc smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_client_restrictions = permit_sasl_authenticated permit_dnswl_client list.dnswl.org reject_rbl_client zen.spamhaus.org check_client_access hash:/etc/postfix/client-reject smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination permit_dnswl_client list.dnswl.org check_policy_service inet:127.0.0.1:10023 smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_tls_CAfile = /etc/postfix/startcom.pem smtpd_tls_cert_file = /etc/postfix/sslmail_DOMAIN_de.crt smtpd_tls_key_file = /etc/postfix/sslmail_DOMAIN_de.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_maps = hash:/etc/postfix/virtual

Some stuff I have in smtpd_client_restrictions and smtpd_recipient_restrictions I added manually or they come from the Greylisting function, you can ignore these. Especially look out for directives that you have in your config but that aren’t in mine.

Yes, I ran the installer.

I “think” what might have happened is that I restored everything instead of just the domains.

I am running a raid 1 with 3 HDs. I suppose I could make a new backup, pull one of the RAID drives just in case, reinstall the OS on a 2 disc RAID and try to restore again and add the 3rd HD back in later.

I really don’t want to do that, but if I did, what settings would I NOT want to restore?

Would I just restore the virtual servers? Will that bork any additional modules I enabled or programs I installed (for instance, APC which 1 of the servers uses)? Will that bork the plan settings they are on?

If I could just reinstall postfix and dovecot without disturbing their integration with virtualmin, I would be happy. The errors that I got didn’t make sense to me either.

Again, thanks for your help on this. I am kind of lost and confused.

Luckily, these are not mission critical websites. But I would like them functional again and the ability to add a mission critical website to the mix.

I went back to the server install looking for errors in the log, here are a couple more that I found. I don’t know if they shed any more light onto this.

Sep 13 06:10:19 MyHostname postfix/qmgr[32051]: fatal: timeout connecting to transport: local
Sep 13 09:16:38 MyHostname postfix/smtp[6943]: error: open database /etc/postfix/sasl_passwd.db: No such file or directory
Sep 14 19:18:58 MyHostname postfix/postmap[6628]: fatal: open /etc/postfix/relayhost_map: No such file or directory
Sep 14 19:45:04 MyHostname spamc[9527]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
Sep 14 19:45:05 MyHostname spamc[9527]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
Sep 14 19:45:06 MyHostname spamc[9527]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
Sep 14 19:45:07 MyHostname spamc[9527]: connection attempt to spamd aborted after 3 retries
Sep 14 19:49:25MyHostname dovecot: pop3(OldUser): Error: stat(/home/NewUser/Maildir/tmp) failed: Permission denied (euid=1009(OldUser) egid=1007(NewUser) missing +x perm: /home/NewUser/Maildir, dir owned by 1008:1007 mode=0700)
Sep 14 19:49:25 MyHostname dovecot: pop3(OldUser): Error: Couldn’t open INBOX: Internal error occurred. Refer to server log for more information. [2013-09-14 19:49:25]
Sep 14 19:53:41 MyHostname dovecot: pop3(OldUser): Error: stat(/home/NewUser/Maildir/tmp) failed: Permission denied (euid=1009(OldUser) egid=1007(NewUser) missing +x perm: /home/NewUser/Maildir, dir owned by 1008:1007 mode=0700)
Sep 14 19:53:41 MyHostname dovecot: pop3(OldUser): Error: Couldn’t open INBOX: Internal error occurred. Refer to server log for more information. [2013-09-14 19:53:41]
Sep 14 19:59:00 MyHostname dovecot: pop3(OldUser): Error: stat(/home/NewUser/Maildir/tmp) failed: Permission denied (euid=1009(OldUser) egid=1007(NewUser) missing +x perm: /home/NewUser/Maildir, dir owned by 1008:1007 mode=0700)
Sep 14 19:59:00 MyHostname dovecot: pop3(OldUser): Error: Couldn’t open INBOX: Internal error occurred. Refer to server log for more information. [2013-09-14 19:59:00]
Sep 14 20:34:37 MyHostname dovecot: pop3(OldUser): Error: stat(/home/NewUser/Maildir/tmp) failed: Permission denied (euid=1009(OldUser) egid=1007(NewUser) missing +x perm: /home/NewUser/Maildir, dir owned by 1008:1007 mode=0700)
Sep 14 20:34:37 MyHostname dovecot: pop3(OldUser): Error: Couldn’t open INBOX: Internal error occurred. Refer to server log for more information. [2013-09-14 20:34:37]
Sep 14 20:40:52 MyHostname procmail[18756]: Suspicious rcfile “/home/NewUser/.procmailrc”
Sep 14 20:42:27 MyHostname dovecot: pop3(OldUser): Error: stat(/home/NewUser/Maildir/tmp) failed: Permission denied (euid=1009(OldUser) egid=1007(NewUser) missing +x perm: /home/NewUser/Maildir, dir owned by 1008:1007 mode=0700)
Sep 14 20:42:27 MyHostname dovecot: pop3(OldUser): Error: Couldn’t open INBOX: Internal error occurred. Refer to server log for more information. [2013-09-14 20:42:27]

I checked the apache log for both the virtual domain and through webmin and saw no entries that matched the time

just some more info if that helps.

Well, from my perspective, the error messages seem to indicate that there are multiple things wrong with your Postfix installation. I’ve never seen most of these errors, and can only guess what MIGHT be the reason. The easiest way to go here would probably be reinstalling the system. I’m not experienced enough with Postfix to give remote assistance here without seeing the system myself. And even then it might take a long time and a lot of googling to fix all this.

When you restore your backups again, you might want to skip - if you have Virtualmin Config in the backup - the “Email Configuration” part. That might be what messes up your new installation, trying to copy over previous config of Postfix and Procmail and whatnot.

You could try to setup a virtual machine with Ubuntu 12.04 65 bit, then compare the Postfix main.cf files?

unless anyone else has a better plan, i think i will keep 1 of the raid 1 disks in case as a backup, format the other 2, set them up as a new server and try the migration again, but ONLY restore specific server details and config the rest on install. if sucessful the backup raid can be added to the new server, if not, the server can be rebuilt off of the old raid

anyone else with a better plan or should i just do it?