Search code examples
localhostinstallationpostfix-mtaubuntu-14.04dovecot

Set up postmaster using Postfix on Ubuntu 14.04


I am in need of serious help. I have been on Google, Stackoverflow, Postfix's website and numerous forums. I am officially stuck, I even tried to replicate another machine's config files.

The Problem:

I am trying to set up Thunderbird to catch postmaster emails. I want to do this using Postfix.

There is a site hosted through Apache on localhost, dev1.testdomain.com and dev2.testdomain.com.

Typically localhost and dev2.testdomain.com points to the same hosted application (Mono... Not Important).

There is a web.config file for each hosted application, in there we can set an attribute that points to the postmaster email address. Typically that email address will be the same as the one set up in Thunderbird which receives all the postmaster emails.

Further information:

Postmaster email needs to be: postmaster@mycomputer.com

Computer name: developmentmachine

Administrator User Account: developer

I tried doing a "Maildir" type setup and can not get that working.

Can anyone please give me a step by step instruction on how to implement something like this?

I want the mail sent to postmaster@mycomputer.com to be delivered to Maildir* of the developer UNIX account.

Please do not post links to other websites, as I have tried about all of them on Google and could not get it working.

Or can someone please tell me what I am doing wrong?

What i have currently:

/etc/aliases

postmaster:    developer

/etc/mailname

mycomputer.com

Postfix standard internet site installation.

/etc/postfix/main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

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

myhostname = developmentmachine
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mycomputer.com, developmentmachine, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
mailbox_command =
luser_relay = postmaster@mycomputer.com
notify_classes = bounce, 2bounce

UPDATE: Got it to copy files into Maildir/

Had to do a dovecot installation to get the emails into my Thunderbird.

http://www.server-world.info/en/note?os=Ubuntu_14.04&p=mail&f=2

I will now go and document this for future references.

Thank you for the interest and help.


Solution

  • I tested with the following configuration and it worked.

    #/etc/postfix/main.cf
    #....
    #....
    alias_maps = hash:/etc/aliases 
    alias_database = hash:/etc/aliases
    mydestination = $myhostname, localhost.$mydomain, localhost, mycomputer.com
    home_mailbox = Maildir/
    #....
    #....
    #/etc/aliases
    postmaster:    developer
    

    Ran the following commands in order

    postalias /etc/aliases # to rebuild aliases map
    service postfix reload 
    echo "Hi Everyone"|mail -s "Test email" postmaster@mycomputer.com
    

    and i could see the mail delivered to /home/developer/Maildir