0

我有 4 个不同的用户需要他们自己的 IP 地址才能将邮件发送到特定地址。如何配置这些用户通过他们自己的 IP 地址发送?我可以在我的虚拟主机配置中将其作为传输吗?一个问题是,无论选择什么,它都必须是可扩展的,以添加第五个而无需启动/停止后缀,可能是重新加载。但是从我们的 vhost 数据库中提取路由是理想的解决方案。

broken_sasl_auth_clients = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = .maildir/
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/ssl/postfix/telecomm.com.crt
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/postfix/telecomm.com.crt
smtpd_tls_key_file = /etc/ssl/postfix/telecomm.com.key
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = pgsql:/etc/postfix/pgsql/virtual_mailbox_domains.cf
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql/virtual_mailbox_maps.cf
virtual_uid_maps = static:5000

***** Database tables******

 public | admin                 | table    | postfixadmin
 public | alias                 | table    | postfixadmin
 public | alias_domain          | table    | postfixadmin
 public | config                | table    | postfixadmin
 public | config_id_seq         | sequence | postfixadmin
 public | domain                | table    | postfixadmin
 public | domain_admins         | table    | postfixadmin
 public | fetchmail             | table    | postfixadmin
 public | fetchmail_id_seq      | sequence | postfixadmin
 public | log                   | table    | postfixadmin
 public | mailbox               | table    | postfixadmin
 public | quota                 | table    | postfixadmin
 public | quota2                | table    | postfixadmin
 public | vacation              | table    | postfixadmin
 public | vacation_notification | table    | postfixadmin
4

2 回答 2

4

您将需要为您将在您的系统中使用的每个 IP 进行传输master.cf

user1  unix -       -       n       -       -       smtp
      -o syslog_name=postfix-user1
      -o smtp_bind_address=1.2.3.4
      #-o smtp_bind_address6=XXX:ZZZ:EEE:999::2

user2  unix -       -       n       -       -       smtp
      -o syslog_name=postfix-user2
      -o smtp_bind_address=1.2.3.5
      #-o smtp_bind_address6=XXX:ZZZ:EEE:999::2

在你的 main.cf

sender_dependent_default_transport_maps = hash:/etc/postfix/transport.cf

#/etc/postfix/transport.cf
user1@domain.tld user1:
user2@domain.tld user2:

有了这个想法,您可以将查找类型更改mysql/pgsql为查询数据库,但您需要在您的master.cf

于 2013-08-16T14:03:59.153 回答
0

另一种选择可能是使用单独的 Postfix 实例——每个实例都绑定到一个 IP 地址——为此。这也允许单独的横幅等。

于 2016-12-05T08:11:36.960 回答