如何使用带有用户和密码的 postfix 配置 SMTP

如何使用带有用户和密码的 postfix 配置 SMTP

我正在寻找一种启用 postfix (或任何其他邮件传送系统)的方法,在其中我可以轻松地拥有别名(用户和域别名),并且我可以让外部用户使用用户名通过 smtp 服务器发送邮件& 密码。作为域/别名一部分的用户应被自动接受并重定向到本地系统或其重定向地址。

很多东西 :-)

这个怎么做?

我现在有这个 main.cf 文件:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = example.com
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = Debian-60-squeeze-64-minimal, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
message_size_limit = 0
virtual_mailbox_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

home_mailbox = Maildir/

virtual_mailbox_domains = /etc/postfix/vhosts
virtual_mailbox_base = /var/lib/mail
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_minimum_uid = 1000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_alias_maps = hash:/etc/postfix/valiases, hash:/var/lib/mailman/data/virtual-mailman
virtual_alias_domains = /etc/postfix/vdomains

#owner_request_special = no
mailman_destination_recipient_limit = 1
transport_maps = hash:/etc/postfix/transport

这很适合我的需要。但我想通过 Google 发送邮件作为我定义的值之一,但为此我需要一个带有用户名和密码的(工作)SMTP 服务器。

我希望有人能为我提供一个简单的配置设置。

答案1

您可以使用 postfix 配置虚拟域/用户来满足您的要求。也后缀管理员Web 界面可用于轻松管理用户/域。

请按照以下内容使用虚拟用户/域配置 postfix。

http://www.campworld.net/thewiki/pmwiki.php/LinuxServersCentOS/Cent6VirtMailServer http://www.itmanx.com/kb/centos6/install-postfix-mysql

相关内容