Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-08-2008, 10:57 PM   #1
Registered: Jul 2008
Posts: 35

Rep: Reputation: 15
Configuring Postfix in Ubuntu

Hi. I am trying to install Postfix in my Ubuntu 8.04. I want to install TikiWiki (TW) locally, hence my interest in Postfix. TW emails a new user right after registration.

This is my set-up:
o I do not have a registered domain name. I just made one up, for local use --
o I have a unix user id, i.e myunixid.
o I also have an email account with my ISP:

I believe TW will be sending an email to the registering user as www-data@localhost. I say I believe because I haven't been able to send an email yet from TW. I wanted to to do something similar with sendmail before. Didn't get very far; so I gave up on sendmail.

This is hard -- rather like being thrown into the deep-end of a pool. So I'd appreciate very much any help you guys can give me.

What I want to happen is for TW to send an email to the newly registered user as:

Here's what's in my /etc/postfix/aliases:
root: myunixid
clamav: root


Should that be something like this:
root: myemacct
www-data: myemacct
clamav: root

Here's what's in my /etc/mailname:

In my /etc/postfix/
myorigin =
relayhost =
# masquerade_domains = !
# masquerade_exceptions = root

I feel I should uncomment masquerade_domains, but I am not exactly sure about the syntax and the parameters to use.

In the virtual_mailbox_maps, virtual_uid_maps, virtual_gid_maps, virtual_alias_maps, virtual_mailbox_domains I have a user=mail entry.

How does one test this? I have installed mutt. Can I test this setup with that? Where are the messages and the errors logged?

I am using this howto:


Last edited by maskiepop; 08-08-2008 at 11:12 PM.
Old 08-08-2008, 11:13 PM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
The trick with setting something like postfix up is to get an absolute basic installation working before adding fancy bits.

So, first thing is to send yourself and email, something like

echo "hello" | mail -s test myunixid

to see what happens (you should get a message to your local user.

I'd expect this to appear to come from (given your myorigin setting).
Old 08-09-2008, 04:24 AM   #3
Registered: Jul 2008
Posts: 35

Original Poster
Rep: Reputation: 15
Hi. Thanks for your reply to my post.

I ran the test you suggested: echo "hello" | mail -s test myunixid

o I did not get any email for myunixid. The mail.log did state that the message was accepted by the relayhost, But I can't understand how can possibly forward this mail to myunixid, such that I will be able to read the email locally.

o I ran a second test: echo "hello" | mail -s test --to This one was able to send the email successfully. It has a from id of

So at the moment, I can send out emails but not received any. Presumably, I will be able to receive emails, if I register my domain name; and bypass the relayhost as well?

Last edited by maskiepop; 08-09-2008 at 04:27 AM.
Old 08-09-2008, 04:27 AM   #4
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you post "postconf -n", but your problem is probably that you don't have

mydestination =

Old 08-09-2008, 12:53 PM   #5
Registered: Jul 2008
Posts: 35

Original Poster
Rep: Reputation: 15
You're right about mydestination not having for it's value. The value of mydestination was null as reported via postconf -n. I tried subsequently to set the value of mydestination to in /etc/postfix/ It seems to me the value wasn't accepted; the postconf -n output still shows the value of mydestination as null. Even after restarting my computer. Any idea as to why I can't set the value of the mydestination variable to via the /etc/postfix/

Here is the output of postconf -n:

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
delay_warning_time = 4h
disable_vrfy_command = yes
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
local_recipient_maps =
mailbox_size_limit = 0
maximal_backoff_time = 8000s
maximal_queue_lifetime = 7d
minimal_backoff_time = 1000s
mydestination =
mynetworks = [::ffff:]/104 [::1]/128
mynetworks_style = host
myorigin =
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost =
smtp_helo_timeout = 60s
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = reject_rbl_client, reject_rbl_client, reject_rbl_client
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
smtpd_recipient_limit = 16
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, permit smtpd_data_restrictions = reject_unauth_pipelining
smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 450
virtual_alias_maps = mysql:/etc/postfix/
virtual_gid_maps = mysql:/etc/postfix/
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = mysql:/etc/postfix/
virtual_mailbox_maps = mysql:/etc/postfix/
virtual_uid_maps = mysql:/etc/postfix/
Old 08-09-2008, 05:58 PM   #6
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What is your entry in for mydestination?

A simple postfix reload should be all you need (sometimes restart)

COmment out all the virtual stuff until the basics are working - it could cause conflicts
Old 08-09-2008, 08:38 PM   #7
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Don't use, or any real top level domain; you don't own it, and should not usurp an existing domain. Use a non-existent TLD such as .local (eg. myfakedom.local).

See post 41 at this link:

for how to setup a fake (fantasy) name.

Once you have that working, you will setup a generics table to map from the fake name to a real email address:


install, mailserver, postfix

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help on configuring postfix+dovecot+gmail kustomjs Linux - Server 5 07-02-2008 04:38 PM
Configuring postfix to work on a LAN zulu8300 Linux - Software 4 06-22-2004 03:42 PM
configuring postfix 2 markus1982 Linux - Networking 0 05-25-2003 06:05 AM
help configuring postfix importboy03 Linux - Software 1 05-01-2003 01:45 AM
Configuring Postfix on Mdk 8.1 JimKyle Linux - General 0 01-16-2002 10:06 AM

All times are GMT -5. The time now is 04:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration