Johannes Schauer: simple email setup
I was unable to find a good place that describes how to create a simple
self-hosted email setup. The most surprising discovery was, how much already
works after:
apt-get install postfix dovecot-imapd
Right after having finished the installation I was able to receive email (but
only in in /var/mail in mbox format) and send email (bot not from any other
host). So while I expected a pretty complex setup, it turned out to boil down
to just adjusting some configuration parameters.
Postfix
The two interesting files to configure postfix are /etc/postfix/main.cf and
/etc/postfix/master.cf. A commented version of the former exists in
/usr/share/postfix/main.cf.dist. Alternatively, there is the ~600k word
strong man page postconf(5). The latter file is documented in master(5).
/etc/postfix/main.cf
I changed the following in my main.cf
@@ -37,3 +37,9 @@
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
+
+home_mailbox = Mail/
+smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_sasl_authenticated
+smtpd_sasl_type = dovecot
+smtpd_sasl_path = private/auth
+smtp_helo_name = my.reverse.dns.name.com
At this point, also make sure that the parameters smtpd_tls_cert_file and
smtpd_tls_key_file point to the right certificate and private key file. So
either change these values or replace the content of
/etc/ssl/certs/ssl-cert-snakeoil.pem and
/etc/ssl/private/ssl-cert-snakeoil.key.
The home_mailbox parameter sets the default path for incoming mail. Since
there is no leading slash, this puts mail into $HOME/Mail for each user. The
trailing slash is important as it specifies qmail-style delivery'' which
means maildir.
The default of the smtpd_recipient_restrictions parameter is
permit_mynetworks reject_unauth_destination so this just adds the
permit_sasl_authenticated option. This is necessary to allow users to send
email when they successfully verified their login through dovecot. The dovecot
login verification is activated through the smtpd_sasl_type and
smtpd_sasl_path parameters.
I found it necessary to set the smtp_helo_name parameter to the reverse DNS
of my server. This was necessary because many other email servers would only
accept email from a server with a valid reverse DNS entry. My hosting provider
charges USD 7.50 per month to change the default reverse DNS name, so the easy
solution is, to instead just adjust the name announced in the SMTP helo.
/etc/postfix/master.cf
The file master.cf is used to enable the submission service. The following
diff just removes the comment character from the appropriate section.
@@ -13,12 +13,12 @@
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
-#submission inet n - - - - smtpd
-# -o syslog_name=postfix/submission
-# -o smtpd_tls_security_level=encrypt
-# -o smtpd_sasl_auth_enable=yes
-# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
-# -o milter_macro_daemon_name=ORIGINATING
+submission inet n - - - - smtpd
+ -o syslog_name=postfix/submission
+ -o smtpd_tls_security_level=encrypt
+ -o smtpd_sasl_auth_enable=yes
+ -o smtpd_client_restrictions=permit_sasl_authenticated,reject
+ -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o syslog_name=postfix/smtps
# -o smtpd_tls_wrappermode=yes
Dovecot
Since above configuration changes made postfix store email in a different
location and format than the default, dovecot has to be informed about these
changes as well. This is done in /etc/dovecot/conf.d/10-mail.conf. The second
configuration change enables postfix to authenticate users through dovecot in
/etc/dovecot/conf.d/10-master.conf. For SSL one should look into
/etc/dovecot/conf.d/10-ssl.conf and either adapt the parameters ssl_cert
and ssl_key or store the correct certificate and private key in
/etc/dovecot/dovecot.pem and /etc/dovecot/private/dovecot.pem,
respectively.
The dovecot-core package (which dovecot-imapd depends on) ships tons of
documentation. The file
/usr/share/doc/dovecot-core/dovecot/documentation.txt.gz gives an overview of
what resources are available. The path
/usr/share/doc/dovecot-core/dovecot/wiki contains a snapshot of the dovecot
wiki at http://wiki2.dovecot.org/. The example configurations seem to be the
same files as in /etc/ which are already well commented.
/etc/dovecot/conf.d/10-mail.conf
The following diff changes the default email location in /var/mail to a
maildir in ~/Mail as configured for postfix above.
@@ -27,7 +27,7 @@
#
# <doc/wiki/MailLocation.txt>
#
-mail_location = mbox:~/mail:INBOX=/var/mail/%u
+mail_location = maildir:~/Mail
# If you need to set multiple mailbox locations or want to change default
# namespace settings, you can do it by defining namespace sections.
/etc/dovecot/conf.d/10-master.conf
And this enables the authentication socket for postfix:
@@ -93,9 +93,11 @@
# Postfix smtp-auth
- #unix_listener /var/spool/postfix/private/auth
- # mode = 0666
- #
+ unix_listener /var/spool/postfix/private/auth
+ mode = 0660
+ user = postfix
+ group = postfix
+
# Auth process is run as this user.
#user = $default_internal_user
Aliases
Now Email will automatically put into the '~/Mail' directory of the receiver.
So a user has to be created for whom one wants to receive mail...
$ adduser josch
...and any aliases for it to be configured in /etc/aliases.
@@ -1,2 +1,4 @@
-# See man 5 aliases for format
-postmaster: root
+root: josch
+postmaster: josch
+hostmaster: josch
+webmaster: josch
After editing /etc/aliases, the command
$ newaliases
has to be run. More can be read in the aliases(5) man page.
Finishing up
Everything is done and now postfix and dovecot have to be informed about the
changes. There are many ways to do that. Either restart the services, reboot or
just do:
$ postfix reload
$ doveadm reload
Have fun!
main.cf
@@ -37,3 +37,9 @@
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
+
+home_mailbox = Mail/
+smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_sasl_authenticated
+smtpd_sasl_type = dovecot
+smtpd_sasl_path = private/auth
+smtp_helo_name = my.reverse.dns.name.com
smtpd_tls_cert_file and
smtpd_tls_key_file point to the right certificate and private key file. So
either change these values or replace the content of
/etc/ssl/certs/ssl-cert-snakeoil.pem and
/etc/ssl/private/ssl-cert-snakeoil.key.
The home_mailbox parameter sets the default path for incoming mail. Since
there is no leading slash, this puts mail into $HOME/Mail for each user. The
trailing slash is important as it specifies qmail-style delivery'' which
means maildir.
The default of the smtpd_recipient_restrictions parameter is
permit_mynetworks reject_unauth_destination so this just adds the
permit_sasl_authenticated option. This is necessary to allow users to send
email when they successfully verified their login through dovecot. The dovecot
login verification is activated through the smtpd_sasl_type and
smtpd_sasl_path parameters.
I found it necessary to set the smtp_helo_name parameter to the reverse DNS
of my server. This was necessary because many other email servers would only
accept email from a server with a valid reverse DNS entry. My hosting provider
charges USD 7.50 per month to change the default reverse DNS name, so the easy
solution is, to instead just adjust the name announced in the SMTP helo.
/etc/postfix/master.cf
The file master.cf is used to enable the submission service. The following
diff just removes the comment character from the appropriate section.
@@ -13,12 +13,12 @@
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
-#submission inet n - - - - smtpd
-# -o syslog_name=postfix/submission
-# -o smtpd_tls_security_level=encrypt
-# -o smtpd_sasl_auth_enable=yes
-# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
-# -o milter_macro_daemon_name=ORIGINATING
+submission inet n - - - - smtpd
+ -o syslog_name=postfix/submission
+ -o smtpd_tls_security_level=encrypt
+ -o smtpd_sasl_auth_enable=yes
+ -o smtpd_client_restrictions=permit_sasl_authenticated,reject
+ -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o syslog_name=postfix/smtps
# -o smtpd_tls_wrappermode=yes
Dovecot
Since above configuration changes made postfix store email in a different
location and format than the default, dovecot has to be informed about these
changes as well. This is done in /etc/dovecot/conf.d/10-mail.conf. The second
configuration change enables postfix to authenticate users through dovecot in
/etc/dovecot/conf.d/10-master.conf. For SSL one should look into
/etc/dovecot/conf.d/10-ssl.conf and either adapt the parameters ssl_cert
and ssl_key or store the correct certificate and private key in
/etc/dovecot/dovecot.pem and /etc/dovecot/private/dovecot.pem,
respectively.
The dovecot-core package (which dovecot-imapd depends on) ships tons of
documentation. The file
/usr/share/doc/dovecot-core/dovecot/documentation.txt.gz gives an overview of
what resources are available. The path
/usr/share/doc/dovecot-core/dovecot/wiki contains a snapshot of the dovecot
wiki at http://wiki2.dovecot.org/. The example configurations seem to be the
same files as in /etc/ which are already well commented.
/etc/dovecot/conf.d/10-mail.conf
The following diff changes the default email location in /var/mail to a
maildir in ~/Mail as configured for postfix above.
@@ -27,7 +27,7 @@
#
# <doc/wiki/MailLocation.txt>
#
-mail_location = mbox:~/mail:INBOX=/var/mail/%u
+mail_location = maildir:~/Mail
# If you need to set multiple mailbox locations or want to change default
# namespace settings, you can do it by defining namespace sections.
/etc/dovecot/conf.d/10-master.conf
And this enables the authentication socket for postfix:
@@ -93,9 +93,11 @@
# Postfix smtp-auth
- #unix_listener /var/spool/postfix/private/auth
- # mode = 0666
- #
+ unix_listener /var/spool/postfix/private/auth
+ mode = 0660
+ user = postfix
+ group = postfix
+
# Auth process is run as this user.
#user = $default_internal_user
Aliases
Now Email will automatically put into the '~/Mail' directory of the receiver.
So a user has to be created for whom one wants to receive mail...
$ adduser josch
...and any aliases for it to be configured in /etc/aliases.
@@ -1,2 +1,4 @@
-# See man 5 aliases for format
-postmaster: root
+root: josch
+postmaster: josch
+hostmaster: josch
+webmaster: josch
After editing /etc/aliases, the command
$ newaliases
has to be run. More can be read in the aliases(5) man page.
Finishing up
Everything is done and now postfix and dovecot have to be informed about the
changes. There are many ways to do that. Either restart the services, reboot or
just do:
$ postfix reload
$ doveadm reload
Have fun!
@@ -13,12 +13,12 @@
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
-#submission inet n - - - - smtpd
-# -o syslog_name=postfix/submission
-# -o smtpd_tls_security_level=encrypt
-# -o smtpd_sasl_auth_enable=yes
-# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
-# -o milter_macro_daemon_name=ORIGINATING
+submission inet n - - - - smtpd
+ -o syslog_name=postfix/submission
+ -o smtpd_tls_security_level=encrypt
+ -o smtpd_sasl_auth_enable=yes
+ -o smtpd_client_restrictions=permit_sasl_authenticated,reject
+ -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o syslog_name=postfix/smtps
# -o smtpd_tls_wrappermode=yes
/etc/dovecot/conf.d/10-mail.conf. The second
configuration change enables postfix to authenticate users through dovecot in
/etc/dovecot/conf.d/10-master.conf. For SSL one should look into
/etc/dovecot/conf.d/10-ssl.conf and either adapt the parameters ssl_cert
and ssl_key or store the correct certificate and private key in
/etc/dovecot/dovecot.pem and /etc/dovecot/private/dovecot.pem,
respectively.
The dovecot-core package (which dovecot-imapd depends on) ships tons of
documentation. The file
/usr/share/doc/dovecot-core/dovecot/documentation.txt.gz gives an overview of
what resources are available. The path
/usr/share/doc/dovecot-core/dovecot/wiki contains a snapshot of the dovecot
wiki at http://wiki2.dovecot.org/. The example configurations seem to be the
same files as in /etc/ which are already well commented.
/etc/dovecot/conf.d/10-mail.conf
The following diff changes the default email location in /var/mail to a
maildir in ~/Mail as configured for postfix above.
@@ -27,7 +27,7 @@
#
# <doc/wiki/MailLocation.txt>
#
-mail_location = mbox:~/mail:INBOX=/var/mail/%u
+mail_location = maildir:~/Mail
# If you need to set multiple mailbox locations or want to change default
# namespace settings, you can do it by defining namespace sections.
/etc/dovecot/conf.d/10-master.conf
And this enables the authentication socket for postfix:
@@ -93,9 +93,11 @@
# Postfix smtp-auth
- #unix_listener /var/spool/postfix/private/auth
- # mode = 0666
- #
+ unix_listener /var/spool/postfix/private/auth
+ mode = 0660
+ user = postfix
+ group = postfix
+
# Auth process is run as this user.
#user = $default_internal_user
Aliases
Now Email will automatically put into the '~/Mail' directory of the receiver.
So a user has to be created for whom one wants to receive mail...
$ adduser josch
...and any aliases for it to be configured in /etc/aliases.
@@ -1,2 +1,4 @@
-# See man 5 aliases for format
-postmaster: root
+root: josch
+postmaster: josch
+hostmaster: josch
+webmaster: josch
After editing /etc/aliases, the command
$ newaliases
has to be run. More can be read in the aliases(5) man page.
Finishing up
Everything is done and now postfix and dovecot have to be informed about the
changes. There are many ways to do that. Either restart the services, reboot or
just do:
$ postfix reload
$ doveadm reload
Have fun!
@@ -27,7 +27,7 @@
#
# <doc/wiki/MailLocation.txt>
#
-mail_location = mbox:~/mail:INBOX=/var/mail/%u
+mail_location = maildir:~/Mail
# If you need to set multiple mailbox locations or want to change default
# namespace settings, you can do it by defining namespace sections.
@@ -93,9 +93,11 @@
# Postfix smtp-auth
- #unix_listener /var/spool/postfix/private/auth
- # mode = 0666
- #
+ unix_listener /var/spool/postfix/private/auth
+ mode = 0660
+ user = postfix
+ group = postfix
+
# Auth process is run as this user.
#user = $default_internal_user
Aliases
Now Email will automatically put into the '~/Mail' directory of the receiver.
So a user has to be created for whom one wants to receive mail...
$ adduser josch
...and any aliases for it to be configured in /etc/aliases.
@@ -1,2 +1,4 @@
-# See man 5 aliases for format
-postmaster: root
+root: josch
+postmaster: josch
+hostmaster: josch
+webmaster: josch
After editing /etc/aliases, the command
$ newaliases
has to be run. More can be read in the aliases(5) man page.
Finishing up
Everything is done and now postfix and dovecot have to be informed about the
changes. There are many ways to do that. Either restart the services, reboot or
just do:
$ postfix reload
$ doveadm reload
Have fun!
$ adduser josch
@@ -1,2 +1,4 @@
-# See man 5 aliases for format
-postmaster: root
+root: josch
+postmaster: josch
+hostmaster: josch
+webmaster: josch
$ newaliases
$ postfix reload
$ doveadm reload
Have fun!
A week ago, 
Altus Metrum's 2014 Black Friday Event
BLACK FOREST, Colorado USA
Altus Metrum announces two special offers for "Black Friday" 2014.
On November 14, as a great way to say goodbye to a semester, a good friend came to my class again to present a topic to the group; a good way to sum up the contents of this talk is "everything you ever wondered about persistent storage".
As people who follow my blog know, I like inviting my friends to present selected topics in my Operating Systems class. Many subjects will stick better if presented by more than a single viewpoint, and different experiences will surely enrich the group's learning.
So, here is Rolando Cedillo A full gigabyte of him, spawning two hours (including two hiccups where my camera hit a per-file limit...).
Rolando is currently a RedHat Engineer, and in his long career, he has worked from so many trenches, it would be a crime not to have him! Of course, one day we should do a low-level hardware session with him, as his passion (and deep knowledge) for 8-bit arcades is beyond any other person I have met.
So,
A
Ever done the following?
This morning,
The
And the analysis is made from every possible angle: What do mazes mean in culture? What have they meant in cultures through history? What about regularity in art (mainly 20th century art)? How would this code look (or how it would be adapted) on contemporary non-C64 computers? And in other languages more popular today? What does randomness mean? And what does random() mean? What is BASIC, and how it came to the C64? What is the C64, and where did it come from? And several other beautiful chapters.
The book was collaboratively written by ten different authors, in a Wiki-like fashion. And... Well, what else is there to say? I enjoyed so much reading through long chapters of my childhood, of what attracted me to computers, of my cultural traits and values... I really hope that, in due time, I can be a part of such a beautiful project!
If the bug title of
This is, essentially, a call for help, as I don't really know which program
is at a fault here.
Given that Emacs's upstream