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

I am working on a email confirmation for a website and I am really new to this. So if anyone please kindly show me how to set up postfix to send out mail. I only need to send out mail (Plain text is fine, although encrypted mail would be a plus). I am using Java to send out mail. Please help please

share|improve this question
Read Postfix basic configuration. When you run into difficulties, post information about your setup, the changes you've made to your config files, together with evidence of trouble from Postfix's log file (typically /var/log/mail). Then, and only then, can we help you. –  Charles Stewart Dec 27 '10 at 10:20
Thank you, I decide to you google mail server. It required no setting up, plus it support SSL as well. Thank you though. And sorry for a very general question. Will try to make it more detail next time –  Harry Pham Dec 28 '10 at 3:37

1 Answer 1

To interact with SMTP authentication on other hosts, you'll need dovecot. Use a sample configuration similar to the one specified below and modify mydomain and myhostname accordingly to your needs. This should allow for basic mail-sending functionality. Use gnupg for encrypting email, I think there should be some Java bindings somewhere.

mydomain = yourdomain.com
myhostname = yourdomain.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks =,
home_mailbox = Maildir/
header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
smtpd_banner = $myhostname ESMTP

# limit an email size 10M
message_size_limit = 10485760
# limit mailbox 1G
mailbox_size_limit = 1073741824

# for SMTP-Auth settings
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt
smtpd_tls_key_file = /etc/pki/tls/certs/server.key
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache

If you need more information this is a useful link: http://www.server-world.info/en/note?os=Fedora_14&p=mail

share|improve this answer
Thank you, I decide to you google mail server. It required no setting up, plus it support SSL as well. Thank you though –  Harry Pham Dec 28 '10 at 3:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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