Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Add email account to postfix

How do I add new email addresses to PostFix? I've got it setup, but I have no email accounts and I'm not sure where to begin. Are they based off of Linux users? If they are, how do I create the same email name for 2 domains (ie - admin@domain1.com and admin@domain2.com)?

No registration emails are going out on my site, so this is kinda urgent!

update

Here's my configuration

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.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
myhostname = server.gospire.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = spireprod, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,rejec                                                                     t_unauth_destination
myorigin = /etc/mailname
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

update

I've created a new user called "mailer". Is it safe to assume that I can just send mail now through this user? I'm using the following information...

$config['host'] = 'localhost';
$config['port'] = '25';
$config['secure'] = '';  //ssl or tls
$config['auth'] = 'true';
$config['username'] = 'mailer';
$config['password'] = '******';

The email appears to have failed to send as I did not receive it.

share|improve this question

marked as duplicate by splattne Aug 29 '10 at 16:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please provide /etc/postfix/master.cf –  Andreas Rehm Aug 29 '10 at 8:37
    
Don't get me wrong - but why don't you use a controlpanel if you don't know how to handle postfix. Examples: ispconfig.org, cpanel.net –  Andreas Rehm Aug 29 '10 at 8:46
    
I need to learn to do all of this at some point.... how else would I learn? –  Webnet Aug 29 '10 at 13:33
add comment

2 Answers

up vote 1 down vote accepted

By default, postfix will deliver anything to local mailboxes, to admin@localhost admin@IP.AD.RE.SS and admin@yourdomain.name will all deliver to admin's mailbox, although postfix will typically only accept mail to domains listed either in $mydomain or $myhostname. If you post your main.cf here we'll be able to help you more, take all the comments out so, for example:

grep -vE "^\s*(#|$)" /etc/postfix/main.cf

share|improve this answer
    
I'm trying to use it only as an outgoing mail server. All incoming mail is routed elsewhere. I've posted the config, that's a great command, I need to remember that one –  Webnet Aug 29 '10 at 3:02
add comment

You can use aliased to add alias addresses:

alias_maps = hash:/etc/aliases

They are stored in /etc/aliases - you should run newaliases after adding or changeing this file.

Example:

admin2:  another localuser
admin:   yourlocaluser

In this configuration you need to have a local user. Postfix is an smtp server only - it can send and receive mail.

You use maildir - your system needs local users to be able to store in the users (!!!) maildir.

By the way - you mentioned different domains. You must tell postfix that they depend to you.

Example /etc/postfix/main.cf

virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

You need to setup another mail and user storage and If you'd like to have virtual only mailboxes.

Please find some examples here:

Edit:

Just read your comment. You don't need any of this changes if you just need to be able to send. One single account allows you to authenticate with your server. You can specify any email adress as sender once you are authenticated.

You might want to use relaying if this is a local server in your lan.

http://www.postfix.org/SMTPD_ACCESS_README.html

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.