I'm looking for a way to enable postfix (or any other mail delivery system) in which I can easily have aliases (user and domain aliases), and in which I can have an external user send mails through the smtp server with a username & password. Users which are part of the domains/aliases should be automatically accepted and redirected to either local system or their redirect addresses.

Lots of stuff :-)

How to do this?

I have this main.cf file at the moment:

# 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_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 = [::ffff:]/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

This works fine for my needs. But I would like to send mails through Google as one of the valiases I defined, but for that I would need a (working) SMTP server with username and password.

I hope someone can provide me with an easy configuration setting for this.

  • 2
    The official documentation page for this is Configuring SASL authentication in the Postfix SMTP server, and it covers the subject pretty well. It existed in almost that state 8 years ago, the only thing I can add to that page is to recommend not to enable authentication for the default instance on the port 25, but only for the submission instance on the port 587. Honestly, this question showed absolutely no research effort. Feb 16, 2023 at 5:58

1 Answer 1


You can configure virtual domain/users with postfix to achieve your requirements. As well as postfixadmin web interface is available to manage users/domains easily.

Please go through below stuff to configure postfix with virtual users/domain.

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

  • Actually if you look at the cf I posted, this is the part that is working already. I just wanted to add SMTP with authentication to it, but without compromising the current setup. Is that possible? Nov 19, 2014 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .