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

Look up final recipient via aliases #54

Open
dominic-p opened this issue Oct 2, 2018 · 2 comments
Open

Look up final recipient via aliases #54

dominic-p opened this issue Oct 2, 2018 · 2 comments
Assignees
Milestone

Comments

@dominic-p
Copy link

I have zyple installed and it's working perfectly except I have hit a bit of a snag. All of my scripts are setup to send email to the root user. I then control the final destination for the email by using /etc/aliases. So, I have a line in /etc/aliases that looks like this:

# Person who should get root's mail
root:           [email protected]

Then, when I send email there is a line in my /var/log/mail.log like this:

Oct  2 10:28:00 host1 postfix/smtp[11878]: 7221DK241B: to=<[email protected]>, orig_to=<root@host1>, status=sent (250 Great success)

When I setup zeyple I imported the public key for [email protected]. But, in /var/log/zeyple.log I see the following when I send an email to root:

2018-10-02 10:27:59,430 11859 INFO Processing outgoing message <20181002172759.7221DK241B@host1>
2018-10-02 10:27:59,430 11859 INFO Recipient: root@host1
2018-10-02 10:27:59,431 11859 INFO Trying to encrypt for root@host1
2018-10-02 10:27:59,463 11859 INFO Key ID: None
2018-10-02 10:27:59,463 11859 WARNING No keys found, message will be sent unencrypted

Sorry if this is a basic question, my postfix skills are pretty basic. Is there some setting I need to tweak so zeyple sees the final recipient and not the orig_to, or would this be a feature request for zeyple to use /etc/aliases to determine which key to lookup?

@infertux
Copy link
Owner

infertux commented Oct 4, 2018

I use a similar setup and ran into this exact issue. Zeyple used to have an alias feature just for that then I realized that Postfix already has it built-in as recipient_canonical_maps: http://www.postfix.org/postconf.5.html#recipient_canonical_maps

This is how to use it:

  1. echo "recipient_canonical_maps = hash:/etc/postfix/recipient_canonical" >> /etc/postfix/main.cf
  2. echo "root [email protected]" > /etc/postfix/recipient_canonical
  3. postfix reload

I'll keep this issue open as a reminder to describe it in the README ;)

@infertux infertux self-assigned this Oct 4, 2018
@dominic-p
Copy link
Author

Awesome! Thank you so much for tip. I just pointed recipient_canonical_maps at my /etc/aliases file so I didn't have any duplicate configs to remember.

If you do update docs, you may also want to mention this as an optional step in INSTALL.md as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants