zeyple icon indicating copy to clipboard operation
zeyple copied to clipboard

Look up final recipient via aliases

Open dominic-p opened this issue 7 years ago • 2 comments

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?

dominic-p avatar Oct 02 '18 17:10 dominic-p

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 avatar Oct 04 '18 12:10 infertux

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.

dominic-p avatar Oct 04 '18 17:10 dominic-p