Please help - mail server setup

14 posts / 0 new
Last post
#1 Mon, 09/20/2010 - 18:39
pcspyoffice

Please help - mail server setup

In primul rand vreau sa va felicit pentru progresele facute la virtualmin.

I manage to install and setup an virtualmin gpl server, but I can't login with any kind of mail clients to the mail server.

Details about my config:

Cent OS 5.5 x86_64 with latest updates, with 5 hdd (2 in RAID1 and 3 in RAID5), connected to router NAT My fqdn is server.company.com My virtual domains are: company.com with some email address user1@company.com (mx is mx.company.com) company1.com.ru (mx is mx.company1.com.ru) comapany2.com.uk (mx is mx.company2.com.uk) I have 1 external fixed ip. I can access all the domain from inside and from outside, even ftp server. I portfwarded: 25, pop3s, imaps, 80, 443, 10000 I use an external dns server, for domains My isp is not bloking port 25 postfix is running with -r flag and mydestination = server.company.com

For domains the mx records are corect, or should be server.company.com?

I couldn't install roundcube because of some missing packages, diferent php version, etc

I can' connect to mail server using any kind of mail clients

Mon, 09/20/2010 - 18:48
andreychek

What is the error you get when attempting to connect with your mail clients?

Do you see any errors in the email log, /var/log/maillog, whenever you try to connect?

-Eric

Tue, 09/21/2010 - 15:47
pcspyoffice

This message appear in that log file:

Sep 21 02:12:56 web2 dovecot: pop3-login: Disconnected: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS handshake Sep 21 21:54:46 web2 postfix/pickup[10693]: 1B9C511CB940: uid=0 from= Sep 21 21:54:46 web2 postfix/cleanup[10698]: 1B9C511CB940: message-id=20100921185446.1B9C511CB940@web2.company.com Sep 21 21:54:46 web2 postfix/qmgr[2532]: 1B9C511CB940: from=root@web2.company.com, size=811, nrcpt=1 (queue active) Sep 21 21:54:46 web2 postfix/local[10700]: 1B9C511CB940: to=root@web2.company.com, orig_to=, relay=local, delay=0.4, delays=0.25/0.01/0/0.15, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) Sep 21 21:54:46 web2 postfix/qmgr[2532]: 1B9C511CB940: removed Sep 21 23:04:45 web2 dovecot: pop3-login: Disconnected: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS handshake Sep 21 23:04:45 web2 dovecot: imap-login: Aborted login: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS Sep 21 23:04:45 web2 dovecot: pop3-login: Aborted login: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS Sep 21 23:05:25 web2 dovecot: pop3-login: Disconnected: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS handshake Sep 21 23:05:25 web2 dovecot: pop3-login: Aborted login: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS Sep 21 23:10:08 web2 dovecot: pop3-login: Aborted login: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS Sep 21 23:14:53 web2 dovecot: pop3-login: Aborted login: rip=::ffff:79.114.210.178, lip=::ffff:192.168.1.1, TLS Sep 21 23:16:29 web2 dovecot: pop3-login: Login: user=office@company.com, method=PLAIN, rip=::ffff:79.114.210.178, lip=::ffff:10.241.85.1, TLS Sep 21 23:16:29 web2 dovecot: POP3(office@company.com): mkdir(/var/lib/dovecot/index/office@company.com/.INBOX) failed: Permission denied

When I try to connect , email client receive an certificate. I am a bit confused whow mail server works in a multidomain situation. mx record must be the real fqdn of virtualmin server, or an A entry on the external DNS server.

Tue, 09/21/2010 - 18:49
andreychek

Ah, it looks like there may be a Dovecot configuration issue... if you look at /etc/dovecot/dovecot.conf, what is the mail_location parameter set to?

-Eric

Fri, 09/24/2010 - 01:36
pcspyoffice

From /etc/dovecot.conf

mail_location = maildir:~/Maildir:INDEX=/var/lib/dovecot/index/%u:CONTROL=/var/lib/dovecot/control/%u

My location for my mail is:

/home/uservirtualdomain/homes/user.name(user mail user.name@company.com)/Maildir

I read wiki for dovecot, but ... If listen parammeter was commented out, #listen = , dovecot server it is working ok?! I modify in to listen = *, I've try in to listen = *,[::] but no succes, system give imap error

Wed, 09/22/2010 - 09:04
andreychek

Howdy,

Okay, try changing "mail_location" to be:

mail_location = maildir:~/Maildir

After you make that change, restart Dovecot:

/etc/init.d/dovecot restart

Then, try accessing your email again and see if that helps.

-Eric

Fri, 09/24/2010 - 01:38
pcspyoffice

I modify the file, and maillog shows:

Sep 24 08:51:37 web2 dovecot: Dovecot v1.0.7 starting up Sep 24 08:52:22 web2 dovecot: Killed with signal 15 Sep 24 08:52:22 web2 dovecot: Dovecot v1.0.7 starting up Sep 24 09:00:54 web2 postfix/smtpd[4835]: connect from unknown[92.81.200.146] Sep 24 09:00:54 web2 postfix/smtpd[4835]: C3DE811CB942: client=unknown[92.81.200.146], sasl_method=PLAIN, sasl_username=office@company.com Sep 24 09:00:55 web2 postfix/cleanup[4839]: C3DE811CB942: message-id=<embdadd627-dd01-41d4-b0dc-d56f51e67815@admin-pc> Sep 24 09:00:55 web2 postfix/qmgr[2506]: C3DE811CB942: from=office@company.com, size=1480, nrcpt=1 (queue active) Sep 24 09:00:55 web2 postfix/error[4840]: C3DE811CB942: to=BOUNCE@company.com, orig_to=user1@company.com, relay=none, delay=0.33, delays=0.3/0/0/0.02, dsn=5.0.0, status=bounced (User unknown in virtual alias table) Sep 24 09:00:55 web2 postfix/cleanup[4839]: 1315711CB947: message-id=20100924060055.1315711CB947@web2.company.com Sep 24 09:00:55 web2 postfix/qmgr[2506]: 1315711CB947: from=<>, size=3322, nrcpt=1 (queue active) Sep 24 09:00:55 web2 postfix/bounce[4841]: C3DE811CB942: sender non-delivery notification: 1315711CB947 Sep 24 09:00:55 web2 postfix/qmgr[2506]: C3DE811CB942: removed Sep 24 09:00:55 web2 postfix/error[4840]: 1315711CB947: to=BOUNCE@company.com, orig_to=office@company.com, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.0.0, status=bounced (User unknown in virtual alias table) Sep 24 09:00:55 web2 postfix/qmgr[2506]: 1315711CB947: removed Sep 24 09:00:55 web2 postfix/smtpd[4835]: disconnect from unknown[92.81.200.146] Sep 24 09:04:15 web2 postfix/anvil[4837]: statistics: max connection rate 1/60s for (smtp:92.81.200.146) at Sep 24 09:00:54 Sep 24 09:04:15 web2 postfix/anvil[4837]: statistics: max connection count 1 for (smtp:92.81.200.146) at Sep 24 09:00:54 Sep 24 09:04:15 web2 postfix/anvil[4837]: statistics: max cache size 1 at Sep 24 09:00:54 Sep 24 09:18:26 web2 dovecot: pop3-login: Login: user=office@company.com, method=PLAIN, rip=86.127.164.210, lip=10.241.85.1, TLS Sep 24 09:18:26 web2 dovecot: pop3-login: Login: user=user@company.com, method=PLAIN, rip=86.127.164.210, lip=10.241.85.1, TLS Sep 24 09:18:26 web2 dovecot: POP3(office@company.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0 Sep 24 09:18:26 web2 dovecot: POP3(user@company.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0 Sep 24 09:22:55 web2 dovecot: pop3-login: Login: user=user@company.com, method=PLAIN, rip=86.127.164.210, lip=10.241.85.1, TLS Sep 24 09:22:55 web2 dovecot: pop3-login: Login: user=office@company.com, method=PLAIN, rip=86.127.164.210, lip=10.241.85.1, TLS Sep 24 09:22:56 web2 dovecot: POP3(user@company.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0 Sep 24 09:22:56 web2 dovecot: POP3(office@company.com): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

Fri, 09/24/2010 - 03:19
pcspyoffice

I proceed more test.

I used thunderbird as email client.

I succesfully sent emails, from the local network, when try to connect from internet failed. My port fowarding it is working because I can access web interface of virtualmin, connect trough ssh, and receive certificates of server mail.

email sent from local to another account to the same domain, did't receive. email sent from local to office@company1.com, virtual domain on the same server as company.com, did'treceive.

I followed an thread started on virtualmin forum, to try to setup with "corect" setting my mail server.

My DNS server it is external, there I setup mx to: company.com 10 mx server.company.com (where server.company.com it is FQDN of my virtualmin)

Fri, 09/24/2010 - 04:55
pcspyoffice

My ISP it's bloking 25 port, because when I try to send email from another isp, my yahoo account receiving email messages from user@company.com( yahoo inbox), user@company1.com ( spam folder,something it is wrong at spf)

But I couldn't sent email from yahoo account to user@company.com and user@company1.com - Diagnostic-Code: X-Postfix; User unknown in virtual alias table

IoI

Mon, 09/27/2010 - 13:19
andreychek

Howdy,

So you're saying that whenever emails reach your Virtualmin server, they're bouncing with a message that states "User unknown in virtual alias table".

Does that sound about right?

If that's the case, the typical problem there is that the hostname for your server got out of sync with the various config files on there.

If you log into your server and run "hostname", what output do you get? Whatever that is, there should be an entry for it in /etc/hosts, as well as on the "mydestination" line of /etc/postfix/main.cf.

-Eric

Fri, 10/01/2010 - 00:08
pcspyoffice

when i run hostname: server1.company.com

my /etc/hosts file:

Do not remove the following line, or various programs that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 xxx.xxx.xxx.xxx server1.company.com server1

xxx.xxx.xxx.xxx - is external ip from my ISP

mydestination = $myhostname, localhost.$mydomain, localhost, server1.company.com

My virtualmin server is behind a NAT network, and his internal ip is 192.168.0.1 My FQDN is server1.company.com I my first virtual domain is company.com, folowed bby another 3 virtual domains: company1.com, company2.com.

Fri, 10/01/2010 - 10:13
andreychek

Howdy,

In your hosts file, if you're on NAT, you'd want to list your server's IP address here:

xxx.xxx.xxx.xxx server1.company.com server1

You wouldn't want to list your external IP there.

The rest of that looks good.

-Eric

Fri, 10/01/2010 - 17:44
pcspyoffice

I modify xxx.xxx.xxx.xxx in to internal ip address, restart the server, but I couldn't send mail from user@yahoo.com

Maybe I do something wrong with mx record value. I use external DNS solution, there at may domain: company.com mx record is server1.company.com

Thank you for your support Eric

Wed, 10/06/2010 - 08:53
pcspyoffice

I manage to rezolve my mail server problems:

Virtualmin FQDN: server1.company.com My server it is behind firewall, so I have two IP's: internal (192.168.1.1) external - fixed ip: 123.123.123.123 I use external DNS server. On my firewall I have fowarded all the port I need : webserver, mail, virtualmin port, etc. On /etc/hosts I change 123.123.123.123 into 192.168.1.1 server1.company.com On /etc/postfix/main.cf proxy_interfaces = 123.123.123.123

comment out line myorigin = $mydomain , become #myorigin = $mydomain

At Webmin - Server - Postfix Mail - Address Rewriting and Masquerading - Address masquerading: $mydomain

By default Address masquerading is disable, and mails are sent to yahoo, hotmail accounts, but when you try to reply you get error from yahoo mail account : User unknown in virtual allias table.

All mail accounts from virtual domain are working ok now: mail sent : user@company.com to user@company1.com, user@company.com - user@yahoo.com cc: user@hotmail.com,user@company1.com

I some situation my email are sent to spam folder, even I have a SPF for each vrtual domain

Thank you very much for support andreychek

Topic locked