Im kind of staring myself blind in how get ActiveSync to work correctly with my mailserver, so maybe anybody here have an idea?
The deal is mailserver is hosting four domains and I want that all sent mails have DKIM signature.
I have gotten it to work when sending via SMTP, but it fails signing when the client uses ActiveSync to send the email.
Anyway here is a diagram on how it works for SMTP:
Most of the magic in how Postfix descides how to identify mail sent from an authenticated user, which belongs to one of my hosted domains vs a mail from somewhere on the Internet comes from this line in /etc/postfix/main.cf
:
smtpd_sender_restrictions =
check_sender_access regexp:/etc/postfix/tag_as_originating.re,
permit_mynetworks,
permit_sasl_authenticated,
check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf,
check_sender_access regexp:/etc/postfix/tag_as_foreign.re
content_filter = amavis:[127.0.0.1]:10024
The content of /etc/postfix/tag_as_foreign.re
:
/^/ FILTER amavis:[127.0.0.1]:10024
Amavis sent the result back to Postfix using port 10025 which is handled by /etc/postfix/master.cf
with this configuration:
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks, reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks, no_header_body_checks
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
The content of /etc/postfix/tag_as_originating.re
:
/^/ FILTER amavis:[127.0.0.1]:10026
The result is sent back to Postfix using port 10027 and handled by this code in /etc/postfix/master.cf
:
127.0.0.1:10027 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks, reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks, no_header_body_checks
-o smtp_send_xforward_command=yes
-o milter_default_action=accept
-o milter_macro_daemon_name=ORIGINATING
-o disable_dns_lookups=yes
Finally here is the relevant lines in master.cf
on how mails get introduced to Postfix in first place:
smtp inet n - y - - smtpd
pickup unix n - y 60 1 pickup
submission inet n - y - - 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
smtps inet n - y - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated, reject
I am using Z-push
to handle connections via ActiveSync, but my issue is a follows:
I have noticed in the mail.log that even though stated in z-push config files that it should pass incomming mails to postfix via SMTP it still insist on putting incomming mails directly into maildrop directory which in turn is handled by Postfix pickup deamon.
From there the mail is either forwarded directly to destination address without even being DKIM signed by Amavis.
The question is: How can I get Postfix to pass mails from pickup daemon on to Amavis, so it can get a DKIM signature, before being forwarded to destination?
Is it as simple as just insert a line underneath pickup
in master.cf
with the text:
-o content_filter = amavis:[127.0.0.1]:10026
... or does the conflict with already existing setup? :-)