用邮件地址映射用户

我正在使用Postfix和Cyrus Imap。

login是通过使用GSS-API(SSO)进行身份validation完成的。

所有用户的邮件帐户格式为[email protected]

对于less数用户希望您的邮件帐户遵循另一种格式。

例如,pepe的邮件帐号为[email protected]

所有从pepe收到邮件的人都是发件人[email protected]

所有发送到[email protected]的邮件都会收到pepe。

我有以下几点:

在/etc/postfix/main.cf中添加

virtual_alias_maps = hash:/etc/postfix/virtual canonical_maps = hash:/etc/postfix/canonical sender_canonical_maps = hash:/etc/postfix/canonical recipient_canonical_maps = hash:/etc/postfix/canonical 

/等/后缀/虚拟

 [email protected] [email protected] [email protected] [email protected] 

/等/后缀/规范

 [email protected] [email protected] pepe pepe1 

还运行以下行:

 postmap /etc/postfix/virtual postmap /etc/postfix/canonical 

如果发送邮件到[email protected]得到我想要的,[email protected]可以阅读邮件。

但是,如果我从[email protected]发送一封电子邮件,您会收到[email protected]发送的邮件,并按照我希望显示的那样收到pepe1。

任何帮助?,感谢您的帮助。

回答这里,而不是一个评论,使之更清晰。

1)

在nano / etc / postfix / virtual中

 [email protected] [email protected] 

2)

在/ etc / postfix / header_checks中:

 /^From:.*username@ejemplo\.org/ REPLACE From:[email protected] 

3)运行:

 postmap /etc/postfix/virtual postmap /etc/postfix/sender_canonical 

4)在/etc/postfix/main.cf中添加:

 virtual_alias_maps = hash:/etc/postfix/virtual header_checks = regexp:/etc/postfix/header_checks 

5)postfix重启:

  postfix stop postfix start 

[email protected]发送的邮件将用作发件人[email protected]。发送给[email protected]的邮件将发送至[email protected]