我是新的postfix,我需要configuration它,以便任何传入我的服务器的电子邮件将被传递到本地用户帐户(/ etc / passwd)。 我的服务器将不会有任何虚拟域($ mydestination)在任何地方列出,我只需要catchall未知的邮件本地用户帐户。
我已经看到一些使用luser_relay和local_receipients_maps这个configuration相关的主题。 但是我现在不怎么使用它们,如果你有时间的话,请告诉我如何使用它? 我在centos 5.5服务器上使用postfix
提前致谢。
如果一切安装正常..你可以在main.cf中添加以下内容
luser_relay = username local_recipient_maps =
更多信息
将用户名replace为收件人的用户名或完整地址,例如john或[email protected]
以下是我如何做到的:
virtual_transport = regex:/etc/postfix/virtual root@testmailm01:/etc/postfix# cat virtual /system/ [email protected] ###this allows you to send outbound logs to another server /*/ webtest ###catch everything and drop it in the webtest mailbox
我们的阿尔法testing服务器直接将这个盒子指向他们的邮件服务器,以便开发者可以试验电子邮件地址。 另外,我们的主SMTP服务器有一个传输指令:
[adminuser@smtpserver01 adminuser]$ cat /etc/postfix/transport example.com :[exchange.server.addy] testing.example.com :[testmailm01.example.cfx]
这允许开发人员通过更改@to @ testing.example.com来testingbeta和prod环境中的某些内容,这些内容将带有该后缀的任何内容redirect到上面的“testing”邮件服务器。
希望有所帮助。
编辑:你configuration了transport_maps设置? postfix问题的标准“帮助”信息是“postconf -n”和“cat / etc / postfix / transport”的输出。 此外,如果您可以find与错误的完整对话,这将有很大帮助。
如果你能find其中一行(“grep”web58007.mail.re3.yahoo.com'/ var / log / maillog“或者可能是/var/log/mail.log)
Jul 26 21:30:01 fjdx421.example.cfx postfix/qmgr[13444]: 2FBBF17B433: to=<[email protected]>, relay=none, delay=0, status=deferred (delivery temporarily suspended: connect to oram101.example.cfx[172.18.52.101]: Connection refused)
奇怪的字母数字是该会话的伪唯一标识符,做一个“grep 2FBBF17B433 / your / mail / logfile”,并张贴该输出以及
编辑:首先,我道歉…我以前是参考交通地图,你需要定义的是“virtual_alias_maps”。 在我的第一个回答中是正确的,但是出于某种原因,我的大脑把它自己附加到了transport_maps上。
看着你的postconf输出,你需要定义:
postconf -e virtual_alias_maps = hash:/etc/postfix/virtual postconf -e recipient_canonical = hash:/etc/postfix/recipient_canonical
然后编辑/ etc / postfix / virtual:
/*/ <your.test.account>
和/ etc / postfix / recipient_canonical:
/./ webtest
然后用postfix reload重新加载postfix。一旦完成,你需要确保你正确地连接到这个邮件服务器,因为它可能没有被列为任何地方的MXlogging。 最简单的testing方法是:
telnet <mail.server.addy> 25
与大部分虚假信息进行的示例对话:
Connected to testmailm01.example.cfx. Escape character is '^]'. 220 testmailm01 ESMTP Postfix HELO nowhere.com 250 testmailm01 mail from: [email protected] 250 2.1.0 Ok rcpt to: [email protected] 250 2.1.5 Ok DATA 354 End data with <CR><LF>.<CR><LF> bla bla blah . 250 2.0.0 Ok: queued as 9B4E820E249
来自这个对话的日志条目:
root@testmailm01:/etc/postfix# grep 9B4E820E249 /var/log/mail.log Jul 27 08:37:17 testmailm01 postfix/smtpd[16125]: 9B4E820E249: client=someuser.example.cfx[172.18.47.102] Jul 27 08:37:25 testmailm01 postfix/cleanup[18529]: 9B4E820E249: message-id=<20100727133717.9B4E820E249@testmailm01> Jul 27 08:37:25 testmailm01 postfix/qmgr[1556]: 9B4E820E249: from=<[email protected]>, size=359, nrcpt=1 (queue active) Jul 27 08:37:25 testmailm01 postfix/local[18554]: 9B4E820E249: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=17, delays=17/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox) Jul 27 08:37:25 testmailm01 postfix/qmgr[1556]: 9B4E820E249: removed
我也有virtual_transportconfiguration,虽然我不知道,重新阅读说明后,为什么。 以防万一它是必需的(尝试上面的第一,然后添加,如果它仍然不工作)。 这个盒子是半生产的,所以我不能只用configuration来testing东西:
postconf -e virtual_transport = regex:/etc/postfix/virtual
虚拟文件保持不变,尽pipe您始终需要确保已经使用hash:statement的所有文件进行后贴图:
postmap <file>
编辑:据此:
Jul 28 20:17:18 rabbits postfix/smtpd[1369]: NOQUEUE: reject: RCPT from mail-wy0-f182.google.com[74.125.82.182]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-wy0-f182.google.com>
您正在向amamun.info发送电子邮件,但您的mydestination包含:
mydestination = $myhostname, localhost.$mydomain, localhost mydomain = test.com myhostname = rabbits.test.com
没有一个虚拟的,那里没有任何东西可以让你的服务器收到发往@ amamun.info的电子邮件。 根据您要使用电子邮件的方式,您需要将该域添加到您的mydestination列表,relay_domains或虚拟。
感谢您的回复,我在此再次详细描述我的要求
我需要configuration我的后缀,以便它捕获所有的邮件,这是无关紧要的,如果它是垃圾邮件,所有传入的邮件应该去本地系统用户帐户。 Postfix将不会有任何虚拟域列表。 为此,我在centos 5.4服务器中安装了postfix(postfix-2.3.3-2.1.centos.mysql_pgsql)。 这是我的configuration:
[root@rabbits postfix]# /usr/sbin/postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_interfaces = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost mydomain = test.com myhostname = rabbits.test.com mynetworks = 127.0.0.0/8 myorigin = $myhostname newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES relay_domains = sample_directory = /usr/share/doc/postfix-2.3.3/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550 [root@rabbits postfix]#
假设我拥有一个域名some.info,它的MXlogging是指向这个服务器的,但是它的域名在postfix的configuration文件中没有列出,但是我需要将注册到“[email protected]”的电子邮件发送到本地系统帐户像“catchtest”一样的方式,我想抓住所有其他未知域名的电子邮件到同一个本地帐户,这是无关紧要,如果它是垃圾邮件。 所以对于这个我真的需要在后缀configuration文件中做。
谢谢。
编辑:嗨,谢谢你的详细步骤,我试过,但仍然相同的结果,在发送邮件之前,它拒绝与中继拒绝消息。
Jul 28 20:17:18 rabbits postfix/smtpd[1369]: NOQUEUE: reject: RCPT from mail-wy0-f182.google.com[74.125.82.182]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-wy0-f182.google.com> Jul 28 20:17:19 rabbits postfix/smtpd[1369]: disconnect from mail-wy0-f182.google.com[74.125.82.182]
这是使用你的configuration修改后的main.cf文件
[root@rabbits postfix]# /usr/sbin/postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_interfaces = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost mydomain = test.com myhostname = rabbits.test.com mynetworks = 127.0.0.0/8 myorigin = $myhostname newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES relay_domains = sample_directory = /usr/share/doc/postfix-2.3.3/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual virtual_transport = regex:/etc/postfix/virtual #cat /etc/postfix/virtual /*/ admin@localhost #cat recipient_canonical /./ admin