| Linode Forum https://forum.linode.com/ |
|
| Email with Postfix,Dovecot&MySQL on CentOS 5-CentOS 6 is https://forum.linode.com/viewtopic.php?f=11&t=8801 |
Page 1 of 2 |
| Author: | redhat19 [ Sun May 06, 2012 10:51 am ] |
| Post subject: | Email with Postfix,Dovecot&MySQL on CentOS 5-CentOS 6 is |
Hi All, We have CentOS 6.2 running on our server, but since the only instructions for setting up Email with Postfix, Dovecot and MySQL in the Linode library (or on Linode's site) is for the configuration on CentOS 5 [ http://library.linode.com/email/postfix ... l-centos-5 ], I followed it for the installation/configuration of Email with Postfix, Dovecot and MySQL on our CentOS 6.2 Everything seemed to work fine until I got to the editing of the dovecot.conf file.. I replaced the content of the dovecot.conf file with stuff that the instruction asked to use to replace the dovecot.conf, but unsurprisingly, there were warnings. ...... ........ Bye [root@myserver1 /]# service mysqld restart Stopping mysqld: [ OK ] Starting mysqld: [ OK ] [root@myserver1 /]# chmod o= /etc/postfix/mysql-virtual_*.cf [root@myserver1 /]# useradd -g vmail -u 5000 vmail -d /home/vmail -m useradd: group 'vmail' does not exist [root@myserver1 /]# chgrp postfix /etc/postfix/mysql-virtual_*.cf [root@myserver1 /]# groupadd -g 5000 vmail [root@myserver1 /]# useradd -g vmail -u 5000 vmail -d /home/vmail -m [root@myserver1 /]# clear [root@myserver1 /]# postconf -e 'myhostname = myserver1.kuiperhost.com' [root@myserver1 /]# postconf -e 'mydestination = $myhostname, localhost, localhost.localdomain' [root@myserver1 /]# postconf -e 'mynetworks = 127.0.0.0/8' [root@myserver1 /]# postconf -e 'inet_interfaces = all' [root@myserver1 /]# postconf -e 'message_size_limit = 30720000' [root@myserver1 /]# postconf -e 'virtual_alias_domains =' [root@myserver1 /]# postconf -e 'virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf' [root@myserver1 /]# postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf' [root@myserver1 /]# postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf' [root@myserver1 /]# postconf -e 'virtual_mailbox_base = /home/vmail' [root@myserver1 /]# postconf -e 'virtual_uid_maps = static:5000' [root@myserver1 /]# postconf -e 'virtual_gid_maps = static:5000' [root@myserver1 /]# postconf -e 'smtpd_sasl_type = dovecot' [root@myserver1 /]# postconf -e 'smtpd_sasl_path = private/auth' [root@myserver1 /]# postconf -e 'smtpd_sasl_auth_enable = yes' [root@myserver1 /]# postconf -e 'broken_sasl_auth_clients = yes' [root@myserver1 /]# postconf -e 'smtpd_sasl_authenticated_header = yes' [root@myserver1 /]# postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination' [root@myserver1 /]# postconf -e 'smtpd_use_tls = yes' [root@myserver1 /]# postconf -e 'smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem' [root@myserver1 /]# postconf -e 'smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem' [root@myserver1 /]# postconf -e 'virtual_create_maildirsize = yes' [root@myserver1 /]# postconf -e 'virtual_maildir_extended = yes' [root@myserver1 /]# postconf -e '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 $virtual_mailbox_limit_maps' [root@myserver1 /]# postconf -e 'virtual_transport = dovecot' [root@myserver1 /]# postconf -e 'dovecot_destination_recipient_limit = 1' [root@myserver1 /]# service sendmail stop sendmail: unrecognized service [root@myserver1 /]# chkconfig sendmail off error reading information on service sendmail: No such file or directory [root@myserver1 /]# chkconfig postfix on [root@myserver1 /]# service postfix start Starting postfix: [ OK ] [root@myserver1 /]# cd /etc/dovecot You have new mail in /var/spool/mail/root [root@myserver1 dovecot]# chgrp dovecot /etc/dovecot-sql.conf chgrp: cannot access `/etc/dovecot-sql.conf': No such file or directory [root@myserver1 dovecot]# chgrp dovecot /etc/dovecot/dovecot-sql.conf [root@myserver1 dovecot]# chmod o= /etc/dovecot/dovecot-sql.conf [root@myserver1 dovecot]# chkconfig dovecot on [root@myserver1 dovecot]# service dovecot start Starting Dovecot Imap: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -n > dovecot-new.conf doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:3: protocols=imaps is no longer necessary, remove it doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:3: protocols=pop3s is no longer necessary, remove it doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:7: ssl_cert_file has been replaced by ssl_cert = <file doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:8: ssl_key_file has been replaced by ssl_key = <file doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:10: namespace private {} has been replaced by namespace { type=private } doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:26: add auth_ prefix to all settings inside auth {} and remove the auth {} section completely doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:27: auth_user has been replaced by service auth { user } doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29: passdb sql {} has been replaced by passdb { driver=sql } doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:33: userdb static {} has been replaced by userdb { driver=static } [ OK ] [root@myserver1 dovecot]# telnet localhost pop3 -bash: telnet: command not found and the /var/log/maillog file looks like this Code: May 4 23:26:21 myserver1 postfix/postqueue[15764]: warning: Mail system is down -- accessing queue directly Question #1: Can I go on and use the email like this/this way/with the current configuration (notwithstanding the warnings)? Question #2: or is there a more current version of the dovecot.conf file you could point me to? I have asked Linode support and they have said Quote: We unfortunately do not have a guide specifically for Postfix/Dovecot/MySQL on CentOS 6 (I have made a note of this and will let our Library team know, however). Additionally, we do not have a different version of dovecot.conf for CentOS 6. ..........if you're still unable to use email with this configuration, I would recommend reaching out to our user community for further assistance: http://www.linode.com/community/ " I would appreciate any help I can get here. Thanks in anticipation. [/quote] |
|
| Author: | jerzzp [ Sun May 06, 2012 2:39 pm ] |
| Post subject: | |
Hey, Recently ran into the same issue when setting up a new server on Ubuntu 12.04 (among others). The guide on the Linode Library provides instructions for Dovecot 1.x, while the newer versions of Ubuntu (and apparently CentOS) use Dovecot 2.x. The config file format has changed, so the one in the guide is no longer applicable. You can find the Dovecot 2 documentation here: http://wiki2.dovecot.org/ If you need help with the configuration, let me know and I'll do my best. You may also be able to install a Dovecot 1.x package, worth thinking about. It also looks like you need to install a package that provides telnet to test Dovecot. If it is working fine how it is, then I'd assume you should be able to go on as normal, but I suspect you won't be able to. It also looks like you have other problems with Postfix connecting to saslauthd, but there's not enough information to debug that issue. Could be related to your Dovecot configuration though. |
|
| Author: | Dweeber [ Sun May 06, 2012 4:09 pm ] |
| Post subject: | |
jerzzp wrote: It also looks like you need to install a package that provides telnet to test Dovecot.
I would be surprised if there is not a telnet client included with your distro. You should not need to install telnet to use the client to test services on your server. |
|
| Author: | jerzzp [ Sun May 06, 2012 4:12 pm ] |
| Post subject: | |
Dweeber wrote: jerzzp wrote: It also looks like you need to install a package that provides telnet to test Dovecot. I would be surprised if there is not a telnet client included with your distro. You should not need to install telnet to use the client to test services on your server. Mm.. redhat19 wrote: [root@myserver1 dovecot]# telnet localhost pop3
-bash: telnet: command not found |
|
| Author: | Dweeber [ Sun May 06, 2012 4:13 pm ] |
| Post subject: | |
Guess I was wrong. |
|
| Author: | jerzzp [ Sun May 06, 2012 4:15 pm ] |
| Post subject: | |
Dweeber wrote: Guess I was wrong.
Not about it being surprising that it's not there in the first place, I just happened to notice it in his first post |
|
| Author: | ZhangHuangbin [ Mon May 07, 2012 1:54 am ] |
| Post subject: | |
Dear redhat19, I suggest you try iRedMail solution to build a full-featured mail server in one minute instead of build it yourself. iRedMail is a FREE, full-featured mail server solution, it works pretty well on Linode VPS. http://www.iredmail.org/ |
|
| Author: | vonskippy [ Mon May 07, 2012 3:01 am ] |
| Post subject: | |
Sniff . . . . Sniff . . . . Smell that? Smells like spam. ZhangHuangbin, you've made two (and only two) posts, both hawking iredmail. Visiting it's site, it's hardly free. If you want anything but the barest of installs you need to pay $299/year or $599 for a lifetime license, just to get a bunch of open source apps bundled into a single binary installer. Instead of trying to sneak it in, man up, and just put your product in your sig file. |
|
| Author: | redhat19 [ Mon May 07, 2012 5:37 am ] |
| Post subject: | |
Hi all, Thanks for all your response. @Jerzzp: Yes, I had to install telnet. and as per the instrucions on http://library.linode.com/email/postfix ... l-centos-5 The next step is to test Postfix with the telnet command. "You should see output similar to the following: Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 plato.example.com ESMTP Postfix ehlo localhost 250-plato.example.com 250-PIPELINING 250-SIZE 30720000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN 250-AUTH=PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN " but here's what I see on my end: [root@myserver1 /]# telnet localhost pop3 Trying ::1... Connected to localhost. Escape character is '^]'. ehlo localhost ..and nothing else. Does this mean Postfix is not working or something is wrong with the configuration? Response from Linode Support: Hello, If Postfix is running, there may be a problem with your configuration. Unfortunately, we cannot assist with specific configuration issues; for further assistance, I would recommend reaching out to our community: http://www.linode.com/community/ Regards, So, guys I would appreciate any help I can get with building the configuration files for Devcot 2.x as @Jerzzp has pointed out. Thanks @ZhangHuangbin Thanks @vonskippy and thanks to @Dweeber |
|
| Author: | hoopycat [ Mon May 07, 2012 6:32 am ] |
| Post subject: | |
Postfix runs on port 25, and does not listen to POP3. Try 'telnet localhost 25' to test Postfix. POP3 has an entirely different dialogue. |
|
| Author: | jerzzp [ Mon May 07, 2012 10:37 am ] |
| Post subject: | |
Alrighty I'll post the Dovecot config files I use, but I won't be able to until later this evening. I also use a split file configuration, but it works. If you could maybe remove and reinstall Dovecot to get the default config file, because mine is based off of that. |
|
| Author: | redhat19 [ Mon May 07, 2012 4:11 pm ] |
| Post subject: | |
Thanks @hoopycat Here's what I get.. [root@myserver1 /]# telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. ..and nothing else @jerzzp Thanks a lot. I eagerly await your post. |
|
| Author: | redhat19 [ Mon May 07, 2012 4:15 pm ] |
| Post subject: | |
@hoopcat, Something's been added: [root@myserver1 /]# telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host. [root@myserver1 /]# |
|
| Author: | redhat19 [ Mon May 07, 2012 4:54 pm ] |
| Post subject: | |
Just keep you guys up to date.. I created an email and sent a test mail. Here are is the error I got from my Mail Queue.. EE2A03C425 2012/05/07 16:27 root@myserver1.myhost.com me@mydomain.com 476 bytes temporary failure. Command output: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -n > dovecot-new.conf doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:3: protocols=imaps is no longer necessary, remove it doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:3: protocols=pop3s is no longer necessary, remove it doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:7: ssl_cert_file has been replaced by ssl_cert = <file doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:8: ssl_key_file has been replaced by ssl_key = <file doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:10: namespace private {} has been replaced by namespace { type=private } doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:26: add auth_ prefix to all settings inside auth {} and remove the auth {} section completely doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:27: auth_user has been replaced by service auth { user } doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29: passdb sql {} has been replaced by passdb { driver=sql } doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:33: userdb static {} has been replaced by userdb { driver=static } |
|
| Author: | jerzzp [ Mon May 07, 2012 6:39 pm ] |
| Post subject: | |
Like I said you're probably gonna want to completely remove and reinstall Dovecot so your config files aren't all jumbled. The files I have are just the default files (but for Ubuntu 12.04) modified to make this configuration work. YMMV. /etc/dovecot/dovecot.conf (via doveconf -n): Code: # 2.0.19: /etc/dovecot/dovecot.conf Then in /etc/dovecot/conf.d/auth-sql.conf.ext: Code: driver = mysql |
|
| Page 1 of 2 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|