https://wiki.archlinux.org/api.php?action=feedcontributions&user=Dcgasca&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:43:16ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Talk:Virtual_user_mail_system_with_Postfix,_Dovecot_and_Roundcube&diff=263809Talk:Virtual user mail system with Postfix, Dovecot and Roundcube2013-06-22T05:17:32Z<p>Dcgasca: /* This is your friendly original author speaking. */</p>
<hr />
<div>== This is your friendly original author speaking. ==<br />
<br />
Hey there, hopefully there are no problems while working down the guide. If there are, feel free to write them down here and I will come to them! However, please *do* try to correct any issues you find in the guide yourself if you can.<br />
--[[User:Svenstaro|Svenstaro]] 12:39, 19 September 2010 (EDT)<br />
<br />
<br />
Expanded the Database section with the code needed to create a rudimentary db and dba for pfadmin to work on and removed the "Needs expansion" banner.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 12:02, 19 June 2012 (UTC)<br />
<br />
KingX did exactly the updates I had in mind to do tonight, great job. Now the SQL queries will actually work out of the box for $domain/$user@$domain maildirs/mailschemes (which is what almost everyone wants to use afaik). Lets hope this doesn't lock down the how to too much.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 22:28, 22 June 2012 (UTC)<br />
<br />
Hey awesome!! I am glad I am not the only one looking at this page. :) I am planning on expanding the postfixadmin and roundcubemail section. Just want to touch base on one thing, so postfixadmin and postfix share the same db right? in this case postfix_db? and Roundcube has its own db. The original author mentioned that "we will use postfixadmin to fill the tables later", but never really clarified or mentioned how... or I missed it. I think that can be one thing that should be clarified also.--[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 22 June 2012 (UTC)<br />
<br />
postfixadmin and roundcube have different databases. Both are populated via the http GUI and hold the meta configuration. For example roundcube will hold user identities (name, sig), searches, contacts, contactgroups (aka mail lists), a dictioary etc. Most of these are only populated when you use the Http interface, since roundcube doesn't actually come into contact with the mailboxes that postfix(and dovecot) uses. The postfix db, in my installations usually just called postfix - no need for extra designation since you already know it is a DB - holds more interesting data since there you will find routing paths (what mailbox each alias maps to), usage information (like quotas), vacation data, hashed login credentials etc.. I don't think it makes sense to drill deeper into that topic inside the tutorial since even the admin wont be much in touch with those dbs and debugging roundcube and dovecot (&pfadmin) issues would really call for a separate document. What are You interested in adding?<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 16:33, 29 June 2012 (UTC)<br />
<br />
Ok yeh I have a perfectly working mailserver now. :) I was just going to expand the roundcube and postfixadmin section a little, as now roundcube is available in official repo so need to grab the source manually. And just add some hints for people trying to configure postfixadmin. --[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 29 June 2012 (UTC)<br />
<br />
... I have undone the modification of user [[User:Gesh|Gesh]]. The relay_domains variable in this specific postfix setup should only be relevant as an additional filter since the MT authentication/authorization is done via the database. Correct me if I'm wrong but I think this is necessary in case of dynamic multi domain hosting. The resulting server does not operate as an open relay unless you add a tld wildcard for every tld you want to OR for in the db ;-)<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 15:49, 9 August 2012 (UTC)<br />
<br />
[http://wiki2.dovecot.org/SSL/DovecotConfiguration Dovecot configuration] suggests setting the certs 0444 for the .crt and 0400 for the .key, but the wiki suggests 0644 and 0600, respectively. Personally, I do not see why anyone should have write permissions on the certs, esp. since they're not meant to be modified. Suggestions? --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 23:30, 9 August 2012 (UTC)<br />
<br />
Hmm... I think you are right Gesh. I can't fathom how making the certs read only could damage the setup.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 00:10, 10 August 2012 (UTC)<br />
<br />
Also, shouldn't the chown nobody:nobody also be executed on the .crt file? I cannot understand the rationale of having it owned by root. At least with system-configuration files, you'd want both that root will be able to edit them and that *only* root be able to edit them. --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 01:35, 10 August 2012 (UTC)<br />
<br />
Yeah there probably isn't anything wrong with making them read-only. --[[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 00:23, 12 August 2012 (UTC)<br />
<br />
Hey there! Excellent tutorial, it almost worked like a charm! I had some problems with dovecot and roundcube. I'm not sure if they are sufficiently general to be added on the main tutorial, but I wanted to discuss them here:<br />
# Dovecot Greeting. I had to place a Dovecot greeting in /etc/dovecot/dovecot.conf. I included "login_greeting = Dovecot ready for action."<br />
# Instead of using TLS for IMAP in Roundcube I had to configure SSL. In particular, I had to change this "$rcmail_config['default_host'] = 'ssl://localhost/';" on Roundcube main.inc.php.<br />
# I missed a comment on the 'username_domain' option in the configuration. As it was not mentioned in the tutorial I wrongly assumed that Dovecot allows login with only the username. But then I couldn't login from Roundcube using my username. Adding the "$rcmail_config['username_domain'] = 'mydomain.net';" option in Roundcube main.inc.php.<br />
Thanks for the tutorial, I think it is pretty straightforward for a complex task a setting up the mail server. Best regards! --[[User:Es0x279e|Es0x279e]] ([[User talk:Es0x279e|talk]]) 10:12, 6 October 2012 (UTC)<br />
<br />
Hi! I cannot for the life of me get roundcube to work. It fails when I try to do the login to the IMAP server during installation. I get: <br />
"Connecting to tls://localhost/...<br />
IMAP connect: NOT OK(Login failed for [edited] from [edited]. Empty startup greeting (localhost:993))"<br />
I've tried changing it to ssl:// and without ssl:// or tls:// but for some reason it just does not work and I do not know where to go from here. Help would be greatly greatly appreciated. --[[User:Pei|Pei]] ([[User talk:Pei|talk]]) 04:20, 2 November 2012 (UTC)<br />
<br />
Undid the last contribution of ([[User talk:Mehtab|Mehtab]]) because listening interfaces should beimplementation speciffic for this Postfix installation. If anybody disagrees let me know. [[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 06:41, 4 December 2012 (UTC)<br />
<br />
Expanded the Roundcube section and added some info for SpamAssassin and added the tip to remove "Received header". Had to do a bit of digging today to set it up, figured I add it here so it will be helpful. [[User:KingX|KingX]] ([[User talk:KingX|talk]]) 02:55, 21 April 2013 (UTC)<br />
<br />
Thank you!, the best tutorial I found, just want to point out some problems I had during the installation.<br />
<br />
A) If vmail id/gid != 5000, you may have dovecot-sql.conf correct, but postfix still complains for db access. Better listen to Svenstaro from the begining.<br />
<br />
B) Roundcube installer: DO NOT TRUST IT!. <br />
<br />
main.inc.php ,<br />
$rcmail_config['default_host'] = 'ssl://localhost'; <br />
If you use tls for IMAP, it will not work and you will get nightmares with the "STARTTLS command first" error. (roundcube tries to use ssl anyway)<br />
<br />
You can use tls for the SMTP server thoug, but also keep the next lines like this:<br />
$rcmail_config['smtp_server'] = 'tls://localhost';<br />
$rcmail_config['smtp_port'] = 587;<br />
$rcmail_config['smtp_user'] = '%u';<br />
$rcmail_config['smtp_pass'] = '%p'; <br />
If you use ssl, you also have to allow ssl connections. Change 'encrypt' for 'may' in your master.cf file, or you will have those nightmares again:<br />
-o smtpd_tls_security_level=encrypt<br />
C) mysql.so and imap.so must be enabled (/etc/php/php.ini)<br />
<br />
D) php.conf: You can create aliases for roundcube and postfixAdmin folders, so you don't bulk your /srv/http/ directory <br />
<br />
E) Your hostname have to include your domain name:<br />
lupus@ulula:~$ hostname <br />
myHostName.mysite.org <br />
F) Bloking port 25 is a common practice for ISP's. This port is where all incoming mail is delivered, so you will not be able get your mail from the outside world. Don't panic (I did), you need a MX DNS server with port fordwarding (or convice your isp that blocking the smtp port is for loosers). This site offers the service for free, good enough to play around: [http://rollernet.us] <br />
<br />
Edit your master.cf file to something like this<br />
smtp inet n - n - - smtpd<br />
26 inet n - n - - smtpd <br />
submission inet n - n - - smtpd<br />
Last word of advice: DO NOT mix virtual server mail with non virtual server mail configuration!<br />
--[[User:Dcgasca|dcgasca]] ([[User talk:Dcgasca|talk]]) 04:43, 22 June 2013 (UTC)</div>Dcgascahttps://wiki.archlinux.org/index.php?title=Talk:Virtual_user_mail_system_with_Postfix,_Dovecot_and_Roundcube&diff=263808Talk:Virtual user mail system with Postfix, Dovecot and Roundcube2013-06-22T05:14:59Z<p>Dcgasca: /* This is your friendly original author speaking. */</p>
<hr />
<div>== This is your friendly original author speaking. ==<br />
<br />
Hey there, hopefully there are no problems while working down the guide. If there are, feel free to write them down here and I will come to them! However, please *do* try to correct any issues you find in the guide yourself if you can.<br />
--[[User:Svenstaro|Svenstaro]] 12:39, 19 September 2010 (EDT)<br />
<br />
<br />
Expanded the Database section with the code needed to create a rudimentary db and dba for pfadmin to work on and removed the "Needs expansion" banner.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 12:02, 19 June 2012 (UTC)<br />
<br />
KingX did exactly the updates I had in mind to do tonight, great job. Now the SQL queries will actually work out of the box for $domain/$user@$domain maildirs/mailschemes (which is what almost everyone wants to use afaik). Lets hope this doesn't lock down the how to too much.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 22:28, 22 June 2012 (UTC)<br />
<br />
Hey awesome!! I am glad I am not the only one looking at this page. :) I am planning on expanding the postfixadmin and roundcubemail section. Just want to touch base on one thing, so postfixadmin and postfix share the same db right? in this case postfix_db? and Roundcube has its own db. The original author mentioned that "we will use postfixadmin to fill the tables later", but never really clarified or mentioned how... or I missed it. I think that can be one thing that should be clarified also.--[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 22 June 2012 (UTC)<br />
<br />
postfixadmin and roundcube have different databases. Both are populated via the http GUI and hold the meta configuration. For example roundcube will hold user identities (name, sig), searches, contacts, contactgroups (aka mail lists), a dictioary etc. Most of these are only populated when you use the Http interface, since roundcube doesn't actually come into contact with the mailboxes that postfix(and dovecot) uses. The postfix db, in my installations usually just called postfix - no need for extra designation since you already know it is a DB - holds more interesting data since there you will find routing paths (what mailbox each alias maps to), usage information (like quotas), vacation data, hashed login credentials etc.. I don't think it makes sense to drill deeper into that topic inside the tutorial since even the admin wont be much in touch with those dbs and debugging roundcube and dovecot (&pfadmin) issues would really call for a separate document. What are You interested in adding?<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 16:33, 29 June 2012 (UTC)<br />
<br />
Ok yeh I have a perfectly working mailserver now. :) I was just going to expand the roundcube and postfixadmin section a little, as now roundcube is available in official repo so need to grab the source manually. And just add some hints for people trying to configure postfixadmin. --[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 29 June 2012 (UTC)<br />
<br />
... I have undone the modification of user [[User:Gesh|Gesh]]. The relay_domains variable in this specific postfix setup should only be relevant as an additional filter since the MT authentication/authorization is done via the database. Correct me if I'm wrong but I think this is necessary in case of dynamic multi domain hosting. The resulting server does not operate as an open relay unless you add a tld wildcard for every tld you want to OR for in the db ;-)<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 15:49, 9 August 2012 (UTC)<br />
<br />
[http://wiki2.dovecot.org/SSL/DovecotConfiguration Dovecot configuration] suggests setting the certs 0444 for the .crt and 0400 for the .key, but the wiki suggests 0644 and 0600, respectively. Personally, I do not see why anyone should have write permissions on the certs, esp. since they're not meant to be modified. Suggestions? --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 23:30, 9 August 2012 (UTC)<br />
<br />
Hmm... I think you are right Gesh. I can't fathom how making the certs read only could damage the setup.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 00:10, 10 August 2012 (UTC)<br />
<br />
Also, shouldn't the chown nobody:nobody also be executed on the .crt file? I cannot understand the rationale of having it owned by root. At least with system-configuration files, you'd want both that root will be able to edit them and that *only* root be able to edit them. --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 01:35, 10 August 2012 (UTC)<br />
<br />
Yeah there probably isn't anything wrong with making them read-only. --[[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 00:23, 12 August 2012 (UTC)<br />
<br />
Hey there! Excellent tutorial, it almost worked like a charm! I had some problems with dovecot and roundcube. I'm not sure if they are sufficiently general to be added on the main tutorial, but I wanted to discuss them here:<br />
# Dovecot Greeting. I had to place a Dovecot greeting in /etc/dovecot/dovecot.conf. I included "login_greeting = Dovecot ready for action."<br />
# Instead of using TLS for IMAP in Roundcube I had to configure SSL. In particular, I had to change this "$rcmail_config['default_host'] = 'ssl://localhost/';" on Roundcube main.inc.php.<br />
# I missed a comment on the 'username_domain' option in the configuration. As it was not mentioned in the tutorial I wrongly assumed that Dovecot allows login with only the username. But then I couldn't login from Roundcube using my username. Adding the "$rcmail_config['username_domain'] = 'mydomain.net';" option in Roundcube main.inc.php.<br />
Thanks for the tutorial, I think it is pretty straightforward for a complex task a setting up the mail server. Best regards! --[[User:Es0x279e|Es0x279e]] ([[User talk:Es0x279e|talk]]) 10:12, 6 October 2012 (UTC)<br />
<br />
Hi! I cannot for the life of me get roundcube to work. It fails when I try to do the login to the IMAP server during installation. I get: <br />
"Connecting to tls://localhost/...<br />
IMAP connect: NOT OK(Login failed for [edited] from [edited]. Empty startup greeting (localhost:993))"<br />
I've tried changing it to ssl:// and without ssl:// or tls:// but for some reason it just does not work and I do not know where to go from here. Help would be greatly greatly appreciated. --[[User:Pei|Pei]] ([[User talk:Pei|talk]]) 04:20, 2 November 2012 (UTC)<br />
<br />
Undid the last contribution of ([[User talk:Mehtab|Mehtab]]) because listening interfaces should beimplementation speciffic for this Postfix installation. If anybody disagrees let me know. [[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 06:41, 4 December 2012 (UTC)<br />
<br />
Expanded the Roundcube section and added some info for SpamAssassin and added the tip to remove "Received header". Had to do a bit of digging today to set it up, figured I add it here so it will be helpful. [[User:KingX|KingX]] ([[User talk:KingX|talk]]) 02:55, 21 April 2013 (UTC)<br />
<br />
Thank you!, the best tutorial I found, just want to point out some problems I had during the installation.<br />
<br />
A) If vmail id/gid != 5000, you may have dovecot-sql.conf correct, but postfix still complains for db access. Better listen to Svenstaro from the begining.<br />
<br />
B) Roundcube installer: DO NOT TRUST IT!. <br />
<br />
main.inc.php<br />
$rcmail_config['default_host'] = 'ssl://localhost'; <br />
If you use tls it will not work and you will get nightmares with the "STARTTLS command first" error. (roundcube tries to use ssl anyway)<br />
<br />
You can use tls for the IMAP server thoug, but also keep the next lines like this:<br />
$rcmail_config['smtp_server'] = 'tls://localhost';<br />
$rcmail_config['smtp_port'] = 587;<br />
$rcmail_config['smtp_user'] = '%u';<br />
$rcmail_config['smtp_pass'] = '%p'; <br />
If you use ssl, you also have to allow ssl connections. Change 'encrypt' for 'may' in your master.cf file, or you will have those nightmares again:<br />
-o smtpd_tls_security_level=encrypt<br />
C) mysql.so and imap.so must be enabled (/etc/php/php.ini)<br />
<br />
D) php.conf: You can create aliases for roundcube and postfixAdmin folders, so you don't bulk your /srv/http/ directory <br />
<br />
E) Your hostname have to include your domain name:<br />
lupus@ulula:~$ hostname <br />
myHostName.mysite.org <br />
F) Bloking port 25 is a common practice for ISP's. This port is where all incoming mail is delivered, so you will not be able get your mail from the outside world. Don't panic (I did), you need a MX DNS server with port fordwarding (or convice your isp that blocking the smtp port is for loosers). This site offers the service for free, good enough to play around: [http://rollernet.us] <br />
<br />
Edit your master.cf file to something like this<br />
smtp inet n - n - - smtpd<br />
26 inet n - n - - smtpd <br />
submission inet n - n - - smtpd<br />
Last word of advice: DO NOT mix virtual server mail with non virtual server mail configuration!<br />
--[[User:Dcgasca|dcgasca]] ([[User talk:Dcgasca|talk]]) 04:43, 22 June 2013 (UTC)</div>Dcgascahttps://wiki.archlinux.org/index.php?title=Talk:Virtual_user_mail_system_with_Postfix,_Dovecot_and_Roundcube&diff=263807Talk:Virtual user mail system with Postfix, Dovecot and Roundcube2013-06-22T05:04:19Z<p>Dcgasca: /* This is your friendly original author speaking. */</p>
<hr />
<div>== This is your friendly original author speaking. ==<br />
<br />
Hey there, hopefully there are no problems while working down the guide. If there are, feel free to write them down here and I will come to them! However, please *do* try to correct any issues you find in the guide yourself if you can.<br />
--[[User:Svenstaro|Svenstaro]] 12:39, 19 September 2010 (EDT)<br />
<br />
<br />
Expanded the Database section with the code needed to create a rudimentary db and dba for pfadmin to work on and removed the "Needs expansion" banner.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 12:02, 19 June 2012 (UTC)<br />
<br />
KingX did exactly the updates I had in mind to do tonight, great job. Now the SQL queries will actually work out of the box for $domain/$user@$domain maildirs/mailschemes (which is what almost everyone wants to use afaik). Lets hope this doesn't lock down the how to too much.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 22:28, 22 June 2012 (UTC)<br />
<br />
Hey awesome!! I am glad I am not the only one looking at this page. :) I am planning on expanding the postfixadmin and roundcubemail section. Just want to touch base on one thing, so postfixadmin and postfix share the same db right? in this case postfix_db? and Roundcube has its own db. The original author mentioned that "we will use postfixadmin to fill the tables later", but never really clarified or mentioned how... or I missed it. I think that can be one thing that should be clarified also.--[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 22 June 2012 (UTC)<br />
<br />
postfixadmin and roundcube have different databases. Both are populated via the http GUI and hold the meta configuration. For example roundcube will hold user identities (name, sig), searches, contacts, contactgroups (aka mail lists), a dictioary etc. Most of these are only populated when you use the Http interface, since roundcube doesn't actually come into contact with the mailboxes that postfix(and dovecot) uses. The postfix db, in my installations usually just called postfix - no need for extra designation since you already know it is a DB - holds more interesting data since there you will find routing paths (what mailbox each alias maps to), usage information (like quotas), vacation data, hashed login credentials etc.. I don't think it makes sense to drill deeper into that topic inside the tutorial since even the admin wont be much in touch with those dbs and debugging roundcube and dovecot (&pfadmin) issues would really call for a separate document. What are You interested in adding?<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 16:33, 29 June 2012 (UTC)<br />
<br />
Ok yeh I have a perfectly working mailserver now. :) I was just going to expand the roundcube and postfixadmin section a little, as now roundcube is available in official repo so need to grab the source manually. And just add some hints for people trying to configure postfixadmin. --[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 29 June 2012 (UTC)<br />
<br />
... I have undone the modification of user [[User:Gesh|Gesh]]. The relay_domains variable in this specific postfix setup should only be relevant as an additional filter since the MT authentication/authorization is done via the database. Correct me if I'm wrong but I think this is necessary in case of dynamic multi domain hosting. The resulting server does not operate as an open relay unless you add a tld wildcard for every tld you want to OR for in the db ;-)<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 15:49, 9 August 2012 (UTC)<br />
<br />
[http://wiki2.dovecot.org/SSL/DovecotConfiguration Dovecot configuration] suggests setting the certs 0444 for the .crt and 0400 for the .key, but the wiki suggests 0644 and 0600, respectively. Personally, I do not see why anyone should have write permissions on the certs, esp. since they're not meant to be modified. Suggestions? --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 23:30, 9 August 2012 (UTC)<br />
<br />
Hmm... I think you are right Gesh. I can't fathom how making the certs read only could damage the setup.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 00:10, 10 August 2012 (UTC)<br />
<br />
Also, shouldn't the chown nobody:nobody also be executed on the .crt file? I cannot understand the rationale of having it owned by root. At least with system-configuration files, you'd want both that root will be able to edit them and that *only* root be able to edit them. --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 01:35, 10 August 2012 (UTC)<br />
<br />
Yeah there probably isn't anything wrong with making them read-only. --[[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 00:23, 12 August 2012 (UTC)<br />
<br />
Hey there! Excellent tutorial, it almost worked like a charm! I had some problems with dovecot and roundcube. I'm not sure if they are sufficiently general to be added on the main tutorial, but I wanted to discuss them here:<br />
# Dovecot Greeting. I had to place a Dovecot greeting in /etc/dovecot/dovecot.conf. I included "login_greeting = Dovecot ready for action."<br />
# Instead of using TLS for IMAP in Roundcube I had to configure SSL. In particular, I had to change this "$rcmail_config['default_host'] = 'ssl://localhost/';" on Roundcube main.inc.php.<br />
# I missed a comment on the 'username_domain' option in the configuration. As it was not mentioned in the tutorial I wrongly assumed that Dovecot allows login with only the username. But then I couldn't login from Roundcube using my username. Adding the "$rcmail_config['username_domain'] = 'mydomain.net';" option in Roundcube main.inc.php.<br />
Thanks for the tutorial, I think it is pretty straightforward for a complex task a setting up the mail server. Best regards! --[[User:Es0x279e|Es0x279e]] ([[User talk:Es0x279e|talk]]) 10:12, 6 October 2012 (UTC)<br />
<br />
Hi! I cannot for the life of me get roundcube to work. It fails when I try to do the login to the IMAP server during installation. I get: <br />
"Connecting to tls://localhost/...<br />
IMAP connect: NOT OK(Login failed for [edited] from [edited]. Empty startup greeting (localhost:993))"<br />
I've tried changing it to ssl:// and without ssl:// or tls:// but for some reason it just does not work and I do not know where to go from here. Help would be greatly greatly appreciated. --[[User:Pei|Pei]] ([[User talk:Pei|talk]]) 04:20, 2 November 2012 (UTC)<br />
<br />
Undid the last contribution of ([[User talk:Mehtab|Mehtab]]) because listening interfaces should beimplementation speciffic for this Postfix installation. If anybody disagrees let me know. [[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 06:41, 4 December 2012 (UTC)<br />
<br />
Expanded the Roundcube section and added some info for SpamAssassin and added the tip to remove "Received header". Had to do a bit of digging today to set it up, figured I add it here so it will be helpful. [[User:KingX|KingX]] ([[User talk:KingX|talk]]) 02:55, 21 April 2013 (UTC)<br />
<br />
Thank you!, the best tutorial I found, just want to point out some problems I had during the installation.<br />
<br />
A) If vmail id/gid != 5000, (asuming dovecot-sql.conf is corretct) postfix cannot access the db. Better listen to Svenstaro from the begining.<br />
<br />
B) Roundcube installer: DO NOT TRUST IT!. main.inc.php<br />
$rcmail_config['default_host'] = 'ssl://localhost'; <br />
If you use tls it will not work. you will get nightmares with the "STARTTLS command first" error. (roundcube tries to use ssl anyway) <br />
You can use tls for the IMAP server, but also keep the next lines like this:<br />
$rcmail_config['smtp_server'] = 'tls://localhost';<br />
$rcmail_config['smtp_port'] = 587;<br />
$rcmail_config['smtp_user'] = '%u';<br />
$rcmail_config['smtp_pass'] = '%p'; <br />
If you use ssl, you also have to allow ssl connections. change 'encrypt' for 'may' in your master.cf file, or you will have those nightmares again:<br />
-o smtpd_tls_security_level=encrypt<br />
C) php extensions: mysql.so and imap.so must be enabled (/etc/php/php.ini)<br />
<br />
D) php.conf: You can create aliases for roundcube and postfixAdmin folders, so you don't bulk your /srv/http/ directory <br />
<br />
E) Your hostname have to include your domain name:<br />
$hostname <br />
myHostName.mysite.org <br />
F) Bloking port 25 is a common practice for ISP's. This port is where all incoming mail is delivered, so you will not be able get your mail from the outside world. Don't panic (I did), you need a MX DNS server with port fordwarding. (or convice your isp that blocking the smtp port is for loosers). This site offers the service for free, good enough to play around: rollernet.us. <br />
Edit your master.cf file to something like this<br />
smtp inet n - n - - smtpd<br />
26 inet n - n - - smtpd <br />
submission inet n - n - - smtpd<br />
Last word of advice: DO NOT mix virtual server mail with non virtual server mail. <br />
--[[User:Dcgasca|dcgasca]] ([[User talk:Dcgasca|talk]]) 04:43, 22 June 2013 (UTC)</div>Dcgascahttps://wiki.archlinux.org/index.php?title=Talk:Virtual_user_mail_system_with_Postfix,_Dovecot_and_Roundcube&diff=263806Talk:Virtual user mail system with Postfix, Dovecot and Roundcube2013-06-22T05:02:49Z<p>Dcgasca: /* This is your friendly original author speaking. */</p>
<hr />
<div>== This is your friendly original author speaking. ==<br />
<br />
Hey there, hopefully there are no problems while working down the guide. If there are, feel free to write them down here and I will come to them! However, please *do* try to correct any issues you find in the guide yourself if you can.<br />
--[[User:Svenstaro|Svenstaro]] 12:39, 19 September 2010 (EDT)<br />
<br />
<br />
Expanded the Database section with the code needed to create a rudimentary db and dba for pfadmin to work on and removed the "Needs expansion" banner.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 12:02, 19 June 2012 (UTC)<br />
<br />
KingX did exactly the updates I had in mind to do tonight, great job. Now the SQL queries will actually work out of the box for $domain/$user@$domain maildirs/mailschemes (which is what almost everyone wants to use afaik). Lets hope this doesn't lock down the how to too much.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 22:28, 22 June 2012 (UTC)<br />
<br />
Hey awesome!! I am glad I am not the only one looking at this page. :) I am planning on expanding the postfixadmin and roundcubemail section. Just want to touch base on one thing, so postfixadmin and postfix share the same db right? in this case postfix_db? and Roundcube has its own db. The original author mentioned that "we will use postfixadmin to fill the tables later", but never really clarified or mentioned how... or I missed it. I think that can be one thing that should be clarified also.--[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 22 June 2012 (UTC)<br />
<br />
postfixadmin and roundcube have different databases. Both are populated via the http GUI and hold the meta configuration. For example roundcube will hold user identities (name, sig), searches, contacts, contactgroups (aka mail lists), a dictioary etc. Most of these are only populated when you use the Http interface, since roundcube doesn't actually come into contact with the mailboxes that postfix(and dovecot) uses. The postfix db, in my installations usually just called postfix - no need for extra designation since you already know it is a DB - holds more interesting data since there you will find routing paths (what mailbox each alias maps to), usage information (like quotas), vacation data, hashed login credentials etc.. I don't think it makes sense to drill deeper into that topic inside the tutorial since even the admin wont be much in touch with those dbs and debugging roundcube and dovecot (&pfadmin) issues would really call for a separate document. What are You interested in adding?<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 16:33, 29 June 2012 (UTC)<br />
<br />
Ok yeh I have a perfectly working mailserver now. :) I was just going to expand the roundcube and postfixadmin section a little, as now roundcube is available in official repo so need to grab the source manually. And just add some hints for people trying to configure postfixadmin. --[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 29 June 2012 (UTC)<br />
<br />
... I have undone the modification of user [[User:Gesh|Gesh]]. The relay_domains variable in this specific postfix setup should only be relevant as an additional filter since the MT authentication/authorization is done via the database. Correct me if I'm wrong but I think this is necessary in case of dynamic multi domain hosting. The resulting server does not operate as an open relay unless you add a tld wildcard for every tld you want to OR for in the db ;-)<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 15:49, 9 August 2012 (UTC)<br />
<br />
[http://wiki2.dovecot.org/SSL/DovecotConfiguration Dovecot configuration] suggests setting the certs 0444 for the .crt and 0400 for the .key, but the wiki suggests 0644 and 0600, respectively. Personally, I do not see why anyone should have write permissions on the certs, esp. since they're not meant to be modified. Suggestions? --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 23:30, 9 August 2012 (UTC)<br />
<br />
Hmm... I think you are right Gesh. I can't fathom how making the certs read only could damage the setup.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 00:10, 10 August 2012 (UTC)<br />
<br />
Also, shouldn't the chown nobody:nobody also be executed on the .crt file? I cannot understand the rationale of having it owned by root. At least with system-configuration files, you'd want both that root will be able to edit them and that *only* root be able to edit them. --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 01:35, 10 August 2012 (UTC)<br />
<br />
Yeah there probably isn't anything wrong with making them read-only. --[[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 00:23, 12 August 2012 (UTC)<br />
<br />
Hey there! Excellent tutorial, it almost worked like a charm! I had some problems with dovecot and roundcube. I'm not sure if they are sufficiently general to be added on the main tutorial, but I wanted to discuss them here:<br />
# Dovecot Greeting. I had to place a Dovecot greeting in /etc/dovecot/dovecot.conf. I included "login_greeting = Dovecot ready for action."<br />
# Instead of using TLS for IMAP in Roundcube I had to configure SSL. In particular, I had to change this "$rcmail_config['default_host'] = 'ssl://localhost/';" on Roundcube main.inc.php.<br />
# I missed a comment on the 'username_domain' option in the configuration. As it was not mentioned in the tutorial I wrongly assumed that Dovecot allows login with only the username. But then I couldn't login from Roundcube using my username. Adding the "$rcmail_config['username_domain'] = 'mydomain.net';" option in Roundcube main.inc.php.<br />
Thanks for the tutorial, I think it is pretty straightforward for a complex task a setting up the mail server. Best regards! --[[User:Es0x279e|Es0x279e]] ([[User talk:Es0x279e|talk]]) 10:12, 6 October 2012 (UTC)<br />
<br />
Hi! I cannot for the life of me get roundcube to work. It fails when I try to do the login to the IMAP server during installation. I get: <br />
"Connecting to tls://localhost/...<br />
IMAP connect: NOT OK(Login failed for [edited] from [edited]. Empty startup greeting (localhost:993))"<br />
I've tried changing it to ssl:// and without ssl:// or tls:// but for some reason it just does not work and I do not know where to go from here. Help would be greatly greatly appreciated. --[[User:Pei|Pei]] ([[User talk:Pei|talk]]) 04:20, 2 November 2012 (UTC)<br />
<br />
Undid the last contribution of ([[User talk:Mehtab|Mehtab]]) because listening interfaces should beimplementation speciffic for this Postfix installation. If anybody disagrees let me know. [[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 06:41, 4 December 2012 (UTC)<br />
<br />
Expanded the Roundcube section and added some info for SpamAssassin and added the tip to remove "Received header". Had to do a bit of digging today to set it up, figured I add it here so it will be helpful. [[User:KingX|KingX]] ([[User talk:KingX|talk]]) 02:55, 21 April 2013 (UTC)<br />
<br />
Thank you!, the best tutorial I found, just want to point out some problems I had during the installation.<br />
<br />
A) If vmail id/gid != 5000, (asuming dovecot-sql.conf is corretct) postfix cannot access the db. Better listen to Svenstaro from the begining.<br />
<br />
B) Roundcube installer: DO NOT TRUST IT!. main.inc.php<br />
$rcmail_config['default_host'] = 'ssl://localhost'; <br />
If you use tls will not work. you will get nightmares with the "STARTTLS command first" error. (roundcube will try to use ssl anyway) <br />
You can use tls for the IMAP server, but also keep the next lines like this:<br />
$rcmail_config['smtp_server'] = 'tls://localhost';<br />
$rcmail_config['smtp_port'] = 587;<br />
$rcmail_config['smtp_user'] = '%u';<br />
$rcmail_config['smtp_pass'] = '%p'; <br />
If you use ssl, you also have to allow ssl connections. change 'encrypt' for 'may' in your master.cf file, or you will have those nightmares again:<br />
-o smtpd_tls_security_level=encrypt<br />
C) php extensions: mysql.so and imap.so must be enabled (/etc/php/php.ini)<br />
<br />
D) php.conf: You can create aliases for roundcube and postfixAdmin folders, so you don't bulk your /srv/http/ directory <br />
<br />
E) Your hostname have to include your domain name:<br />
$hostname <br />
myHostName.mysite.org <br />
F) Bloking port 25 is a common practice for ISP's. This port is where all incoming mail is delivered, so you will not be able get your mail from the outside world. Don't panic (I did), you need a MX DNS server with port fordwarding. (or convice your isp that blocking the smtp port is for loosers). This site offers the service for free, good enough to play around: rollernet.us. <br />
Edit your master.cf file to something like this<br />
smtp inet n - n - - smtpd<br />
26 inet n - n - - smtpd <br />
submission inet n - n - - smtpd<br />
Last word of advice: DO NOT mix virtual server mail with non virtual server mail. <br />
--[[User:Dcgasca|dcgasca]] ([[User talk:Dcgasca|talk]]) 04:43, 22 June 2013 (UTC)</div>Dcgascahttps://wiki.archlinux.org/index.php?title=Talk:Virtual_user_mail_system_with_Postfix,_Dovecot_and_Roundcube&diff=263804Talk:Virtual user mail system with Postfix, Dovecot and Roundcube2013-06-22T04:43:53Z<p>Dcgasca: /* This is your friendly original author speaking. */</p>
<hr />
<div>== This is your friendly original author speaking. ==<br />
<br />
Hey there, hopefully there are no problems while working down the guide. If there are, feel free to write them down here and I will come to them! However, please *do* try to correct any issues you find in the guide yourself if you can.<br />
--[[User:Svenstaro|Svenstaro]] 12:39, 19 September 2010 (EDT)<br />
<br />
<br />
Expanded the Database section with the code needed to create a rudimentary db and dba for pfadmin to work on and removed the "Needs expansion" banner.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 12:02, 19 June 2012 (UTC)<br />
<br />
KingX did exactly the updates I had in mind to do tonight, great job. Now the SQL queries will actually work out of the box for $domain/$user@$domain maildirs/mailschemes (which is what almost everyone wants to use afaik). Lets hope this doesn't lock down the how to too much.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 22:28, 22 June 2012 (UTC)<br />
<br />
Hey awesome!! I am glad I am not the only one looking at this page. :) I am planning on expanding the postfixadmin and roundcubemail section. Just want to touch base on one thing, so postfixadmin and postfix share the same db right? in this case postfix_db? and Roundcube has its own db. The original author mentioned that "we will use postfixadmin to fill the tables later", but never really clarified or mentioned how... or I missed it. I think that can be one thing that should be clarified also.--[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 22 June 2012 (UTC)<br />
<br />
postfixadmin and roundcube have different databases. Both are populated via the http GUI and hold the meta configuration. For example roundcube will hold user identities (name, sig), searches, contacts, contactgroups (aka mail lists), a dictioary etc. Most of these are only populated when you use the Http interface, since roundcube doesn't actually come into contact with the mailboxes that postfix(and dovecot) uses. The postfix db, in my installations usually just called postfix - no need for extra designation since you already know it is a DB - holds more interesting data since there you will find routing paths (what mailbox each alias maps to), usage information (like quotas), vacation data, hashed login credentials etc.. I don't think it makes sense to drill deeper into that topic inside the tutorial since even the admin wont be much in touch with those dbs and debugging roundcube and dovecot (&pfadmin) issues would really call for a separate document. What are You interested in adding?<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 16:33, 29 June 2012 (UTC)<br />
<br />
Ok yeh I have a perfectly working mailserver now. :) I was just going to expand the roundcube and postfixadmin section a little, as now roundcube is available in official repo so need to grab the source manually. And just add some hints for people trying to configure postfixadmin. --[[User:KingX|KingX]] ([[User talk:KingX|talk]]) 22:51, 29 June 2012 (UTC)<br />
<br />
... I have undone the modification of user [[User:Gesh|Gesh]]. The relay_domains variable in this specific postfix setup should only be relevant as an additional filter since the MT authentication/authorization is done via the database. Correct me if I'm wrong but I think this is necessary in case of dynamic multi domain hosting. The resulting server does not operate as an open relay unless you add a tld wildcard for every tld you want to OR for in the db ;-)<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 15:49, 9 August 2012 (UTC)<br />
<br />
[http://wiki2.dovecot.org/SSL/DovecotConfiguration Dovecot configuration] suggests setting the certs 0444 for the .crt and 0400 for the .key, but the wiki suggests 0644 and 0600, respectively. Personally, I do not see why anyone should have write permissions on the certs, esp. since they're not meant to be modified. Suggestions? --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 23:30, 9 August 2012 (UTC)<br />
<br />
Hmm... I think you are right Gesh. I can't fathom how making the certs read only could damage the setup.<br />
--[[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 00:10, 10 August 2012 (UTC)<br />
<br />
Also, shouldn't the chown nobody:nobody also be executed on the .crt file? I cannot understand the rationale of having it owned by root. At least with system-configuration files, you'd want both that root will be able to edit them and that *only* root be able to edit them. --[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 01:35, 10 August 2012 (UTC)<br />
<br />
Yeah there probably isn't anything wrong with making them read-only. --[[User:Svenstaro|Svenstaro]] ([[User talk:Svenstaro|talk]]) 00:23, 12 August 2012 (UTC)<br />
<br />
Hey there! Excellent tutorial, it almost worked like a charm! I had some problems with dovecot and roundcube. I'm not sure if they are sufficiently general to be added on the main tutorial, but I wanted to discuss them here:<br />
# Dovecot Greeting. I had to place a Dovecot greeting in /etc/dovecot/dovecot.conf. I included "login_greeting = Dovecot ready for action."<br />
# Instead of using TLS for IMAP in Roundcube I had to configure SSL. In particular, I had to change this "$rcmail_config['default_host'] = 'ssl://localhost/';" on Roundcube main.inc.php.<br />
# I missed a comment on the 'username_domain' option in the configuration. As it was not mentioned in the tutorial I wrongly assumed that Dovecot allows login with only the username. But then I couldn't login from Roundcube using my username. Adding the "$rcmail_config['username_domain'] = 'mydomain.net';" option in Roundcube main.inc.php.<br />
Thanks for the tutorial, I think it is pretty straightforward for a complex task a setting up the mail server. Best regards! --[[User:Es0x279e|Es0x279e]] ([[User talk:Es0x279e|talk]]) 10:12, 6 October 2012 (UTC)<br />
<br />
Hi! I cannot for the life of me get roundcube to work. It fails when I try to do the login to the IMAP server during installation. I get: <br />
"Connecting to tls://localhost/...<br />
IMAP connect: NOT OK(Login failed for [edited] from [edited]. Empty startup greeting (localhost:993))"<br />
I've tried changing it to ssl:// and without ssl:// or tls:// but for some reason it just does not work and I do not know where to go from here. Help would be greatly greatly appreciated. --[[User:Pei|Pei]] ([[User talk:Pei|talk]]) 04:20, 2 November 2012 (UTC)<br />
<br />
Undid the last contribution of ([[User talk:Mehtab|Mehtab]]) because listening interfaces should beimplementation speciffic for this Postfix installation. If anybody disagrees let me know. [[User:Justforgetme|Justforgetme]] ([[User talk:Justforgetme|talk]]) 06:41, 4 December 2012 (UTC)<br />
<br />
Expanded the Roundcube section and added some info for SpamAssassin and added the tip to remove "Received header". Had to do a bit of digging today to set it up, figured I add it here so it will be helpful. [[User:KingX|KingX]] ([[User talk:KingX|talk]]) 02:55, 21 April 2013 (UTC)<br />
<br />
Thank you!, the best tutorial I found, just want to point out some problems I had during the installation.<br />
# If vmail id/gid != 5000, (asuming dovecot-sql.conf is corretct) postfix cannot access the db.Better listen to Svenstaro from the begining.<br />
# roundcube installer: DO NOT TRUST IT!.<br />
--> $rcmail_config['default_host'] = 'ssl://localhost'; if you use tls will not work. you will get nightmares with the "STARTTLS command first" error. (roundcube will try to use ssl anyway) <br />
--> You can use tls for the IMAP server $rcmail_config['smtp_server'] = 'tls://localhost'. BUT the following lines must be :<br />
$rcmail_config['smtp_port'] = 587;<br />
$rcmail_config['smtp_user'] = '%u';<br />
$rcmail_config['smtp_pass'] = '%p';<br />
--> If you use ssl, you also have to allow ssl connections. change 'encrypt' for 'may' in your master.cf file :" -o smtpd_tls_security_level=encrypt " or you will have those nightmares again.<br />
#/etc/php/php.ini. mysql.so and imap.so must be enabled.<br />
#php.conf. you can create aliases for roundcube and postfixAdmin folders, so you don't bulk your /srv/http/ directory <br />
# your hostname have to include your domain name. <br />
Type "$hostname" <br />
if you get something like "myHostName.mysite.org", you are good to go. <br />
# Bloking port 25 is a common practice for ISP's. This port is where all incoming mail is delivered, so you will not be able get your mail from the outside world. Don't panic (I did), you need a MX DNS server with port fordwarding. (or convice your isp that blocking the smtp port is for loosers). This site offers the service for free, good enough to play around: rollernet.us. <br />
Edit your master.cf file to something like this<br />
smtp inet n - n - - smtpd<br />
26 inet n - n - - smtpd <br />
submission inet n - n - - smtpd<br />
Last word of advice: DO NOT mix virtual server mail with non virtual server mail. <br />
--[[User:Dcgasca|dcgasca]] ([[User talk:Dcgasca|talk]]) 04:43, 22 June 2013 (UTC)</div>Dcgasca