kalamuna / kalastack

Local development environment for drupal
Other
43 stars 21 forks source link

Mail server needed #35

Open sammys opened 11 years ago

sammys commented 11 years ago

This is a known issue. I'm posting this so it's tracked in GitHub at Andrew Mallis's request.

My preferred setup for virtual machines is to setup a postfix mail server on the guest and relay mail to a legitimate mail server through a SSH tunnel. Here are the details:

After "up"-ing the kalabox I do the following steps:

  1. Install postfix as a satellite and configure relayhost to relay to 127.0.0.1:3001
  2. Copy an insecure SSH private and public key into root's .ssh folder
  3. Install openbsd-inetd and then add the following directive to /etc/inetd.conf:
127.0.0.1:3001  stream  tcp     nowait  root    /usr/bin/ssh    -q -T -i /root/.ssh/smtp_tunnel_key nopriv@legit-mailserver.com

Note that the spaces are tab characters

  1. Use ssh to add the host to known_hosts:
ssh -i /root/.ssh/smtp_tunnel_key nopriv@legit-mailserver.com
  1. Restart inetd daemon:
invoke-rc.d openbsd-inetd restart
  1. Test:
telnet localhost 3001

It should show you the HELO line from the legit mail server. Enter QUIT or quit to stop talking to the mail server. Now you can do postfix reload and it should be operational.

It's important to have the private key, public key and tunnel user@host (nopriv@legit-mailserver.com in the example) configured by each developer. If no configuration is supplied the mail server is installed without relaying enabled.

Another consideration is the email addresses in the site database. Changing all of these has implications if the DB is synced back to Pantheon. However, privacy requirements do warrant that the email addresses are changed to protect the client and the client's clients. Besides the addresses I do advocate the use of address rewriting and that can easily be coupled with this configuration.

Details about address rewriting in postfix.

Instructions I used to get this configuration running years ago: SMTP via a SSH tunnel

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

pirog commented 11 years ago

we definitely want mailing to be functional and its in the roadmap. that all said im not sure i want to add the overhead of installing postfix. do you have any lighterweight suggestions for getting mail functionality?

rb2k commented 11 years ago

How about http://mailcatcher.me/ ?

pirog commented 11 years ago

very interesting. we will definitely look into this! i would love to get a good, lightweight and non-annoying-to-actual-people solution wrapped in here.

andrewmallis commented 11 years ago

Looks very decent; hope we can hook it up without a dependency on rvm for the stack.