Mac*_*Mac 6 email postfix wildcard email-bounces
我正在创建一个退回电子邮件系统,收件人可以在其中回复我网站上的消息。
但是,当电子邮件发送给包含上一条消息的用户时,该Reply-To字段包含这样的地址notification-message-988742@mysite.com(末尾包含 ID)。
如果用户回复,回复消息将被发送回notification-message-988742@mysite.com,当然,没有自己的邮箱,除了notification@mysite.com.
如何将来自特定通配符的所有传入消息重定向notification-message-*@mysite.com到notification@mysite.com?我做了一些研究,但没有任何可靠的部分起作用,包括luser_relay = notification@mysite.com并放入notification-message-*后缀别名表中,notification@有一个 Maildir,所以邮件会进入它。
概念图:

我正在使用 Ubuntu 11.04。
小智 11
正如mschuett所说,您可以使用regexp
首先检查postfix是否支持regexp:
root @ mail / # postconf-m | grep regexp
regexp
root @ mail / #
Run Code Online (Sandbox Code Playgroud)
创建文件 /etc/postfix/aliases-regexp 并将您的正则表达式添加到其中
root @ mail / # cat /etc/postfix/aliases-regexp
/notification-message-[0-9]+@example\.net/ notification@example.net
root @ mail / #
Run Code Online (Sandbox Code Playgroud)
运行 postmap 并检查它是否有效:
root @ mail / # postmap /etc/postfix/aliases-regexp
root @ mail / # postmap -q notification-message-123123@example.net regexp:/etc/postfix/aliases-regexp
notification@example.net
root @ mail / #
Run Code Online (Sandbox Code Playgroud)
如果一切正常,请将此文件添加到您的别名数据库中
例子:
root @ mail / # cat /etc/postfix/main.cf | grep ^alias_maps
alias_maps = hash:/etc/aliases regexp:/etc/postfix/aliases-regexp
root @ mail / #
Run Code Online (Sandbox Code Playgroud)
如果您使用的是虚拟域,请将此文件添加到您的 virtual_alias_maps
例子:
root @ mail / # cat /etc/postfix/main.cf | grep ^virtual_alias_maps
virtual_alias_maps = mysql:/etc/postfix/mysql/alias.conf regexp:/etc/postfix/aliases-regexp
root @ mail / #
Run Code Online (Sandbox Code Playgroud)
不要忘记重新启动postfix。
祝你好运!
我倾向于使用 来解决这个问题recipient_delimiter。
如果您不介意使用稍微不同的Reply-To地址,您可以设置:
recipient_delimiter = +
Run Code Online (Sandbox Code Playgroud)
在您的配置中,然后邮件到例如notification+message-988742@mysite.com(注意+)将被传递给notification用户(假设没有更具体的规则/用户匹配notification+message-988742)。
您可以尝试设置recipient_delimiter = -(以便您可以使用Reply-To问题中的标题),但我不确定这如何与左侧分隔符的多个实例一起使用,而且我没有后缀到手去检查。
| 归档时间: |
|
| 查看次数: |
9094 次 |
| 最近记录: |