Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support userdb for mail alias lookup #163

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions files/postfix/ldap-aliases.cf

This file was deleted.

4 changes: 2 additions & 2 deletions files/postfix/main.cf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_una
myhostname = mail.hashbang.sh
relay_domains = hashbang.sh
mydestination = mail.hashbang.sh, hashbang.sh, localhost.hashbang.sh, localhost
mynetworks = 127.0.0.0/8 104.245.35.240 104.245.37.138 45.58.35.111 45.58.38.222
mynetworks = 127.0.0.0/8 46.4.114.111
relayhost =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
Expand All @@ -42,6 +42,6 @@ mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf
virtual_alias_maps = pgsql:/etc/postfix/userdb-aliases.cf

message_size_limit = 52428800
6 changes: 6 additions & 0 deletions files/postfix/userdb-aliases.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
domain = hashbang.sh
hosts = postgresql://userdb-attempt-too-do-user-989073-0.db.ondigitalocean.com:25060/userdb?sslmode=require
RyanSquared marked this conversation as resolved.
Show resolved Hide resolved
user = mail
password = userdb-mail-lookup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need magic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs:

  • a user that can read name and host from passwd (already created)
  • the postfix-pgsql package installed (which should be handled in docker-postfix#14)

dbname = userdb
query = select name || '@' || host from passwd where name = '%u'
9 changes: 2 additions & 7 deletions hosts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# -*- mode: conf -*-
[shell_servers]
da1.hashbang.sh
ny1.hashbang.sh
sf1.hashbang.sh
to1.hashbang.sh
de1.hashbang.sh

[shell_servers:vars]
# become/sudo does not work properly due to a pam_namespace issue
# See hashbang/shell-etc#74
ansible_user=root


[coreos]
hashbang.sh
im.hashbang.sh
Expand All @@ -27,13 +23,12 @@ ansible_port=8993
[coreos:children]
irc


[irc]
services.irc.hashbang.sh

[irc:children]
irc_servers


[irc_servers]
sfo1.irc.hashbang.sh irc_numeric=1 ansible_port=22