Postfix + LDAP + 收件人分隔符

Postfix + LDAP + 收件人分隔符

我正在尝试让我的 Postfix 和 LDAP 后端接受收件人分隔符(又名地址扩展)。

邮件系统的其余部分工作正常,但当收到带有扩展名的电子邮件时(例如[电子邮件保护]),它尝试在 LDAP 服务中查找“coops+test”,但失败了。显然这是错误的,它应该删除“+test”部分。

在我的 postfix 配置中,传递给 LDAP 服务的字符串是“%s”,如下面的示例行所示:

accounts_query_filter = (&(objectClass=MailAccount)(mail=%s)(accountActive=TRUE)(delete=FALSE))

是否有一个后缀变量代表电子邮件帐户减去扩展名?我找到了一个类似的帖子这里,但没有实际的解决方案。

答案1

根据手册页 ldap_table(5),可能性有:

%%     This is replaced by a literal ’%’ character. (Postfix 2.2 and later).

%s     This is replaced by the input key.  RFC 2254 quoting is used to make sure  that  the  input  key
       does not add unexpected metacharacters.

%u     When  the  input  key  is  an  address of the form user@domain, %u is replaced by the (RFC 2254)
       quoted local part of the address.  Otherwise, %u is replaced by the entire  search  string.   If
       the localpart is empty, the search is suppressed and returns no results.

%d     When  the  input  key  is  an  address of the form user@domain, %d is replaced by the (RFC 2254)
       quoted domain part of the address.  Otherwise, the search is suppressed and returns no  results.

%[SUD] The  upper-case equivalents of the above expansions behave in the query_filter parameter identi‐
       cally to their lower-case counter-parts. With the  result_format  parameter  (previously  called
       result_filter  see the COMPATIBILITY section and below), they expand to the corresponding compo‐
       nents of input key rather than the result value.

       The above %S, %U and %D expansions are available with Postfix 2.2 and later.

%[1-9] The patterns %1, %2, ... %9 are replaced by the corresponding most significant component of  the
       input key’s domain. If the input key is [email protected], then %1 is com, %2 is example and
       %3 is mail. If the input key is unqualified or does not have enough domain components to satisfy
       all the specified patterns, the search is suppressed and returns no results.

       The above %1, ..., %9 expansions are available with Postfix 2.2 and later.

答案2

我认为你需要这个:

recipient_delimiter = +

在你的 main.cf 中

相关内容