Easy postfix install using yum on fedora

Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail. It is intended as a fast, easier-to-administer, and secure alternative to the widely-used Sendmail MTA.

#service stop sendmail
#yum install postfix 
and edit main.conf file
#vim /etc/postfix/main.cf

the configurations can be check using command postconf
[root@localhost ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.5.5/README_FILES
sample_directory = /usr/share/doc/postfix-2.5.5/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

NOTE:for virtual domains maps to sql
____________________________________
myhostname  = hostname.something.net
mydomain  = something.net
relay_domains = mysql:/etc/postfix/mysql_relay_domains_maps.cf
virtual_alias_maps      = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base    = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit   = 51200000
virtual_mailbox_maps    = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit_maps     = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf

add    vim /etc/postfix /mysql_virtual_alias_maps.cf  

user                    = postfix
password                = postfix
dbname                  = postfix
hosts                  = 127.0.0.1:3306
table                   = alias
select_field            = goto
where_field             = address

 vim /etc/postfix /mysql_virtual_domains_maps.cf

user                    = postfix
password                = postfix
dbname                  = postfix
hosts                  = 127.0.0.1:3306
table                   = domain
select_field            = transport
where_field             = domain
additional_conditions   = AND backupmx=’0′ AND active=’1′

  vim /etc/postfix /mysql_virtual_mailbox_maps.cf

user                    = postfix
password                = postfix
dbname                  = postfix
hosts                  = 127.0.0.1:3306
table                   = mailbox
select_field            = maildir
where_field             = username
additional_conditions   = AND active=’1′

This is only configuring for a relay host
________________________________________
mydomain = example.com
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_auth_enable = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
smtpd_sasl_local_domain = $myhostname
smtp_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated, reject_unauth_destination
broken_sasl_auth_clients = yes
#smtp_sasl_tls_security_options = noanonymous
smtpd_sasl_application_name = smtpd
relayhost = mx0.example.com
mailbox_size_limit = 0

few commands
postalias     postdrop      postkick      postmap
postcat       postfix       postlock      postqueue
postconf      post-grohtml  postlog       postsuper

mail            mailq.postfix   mailstat        mailx
mailq           mailq.sendmail  mailstats

usages
________
    * The postfix command controls the operation of the mail system. It is the interface for starting and stopping the mail system(start/stop/flush/check/reload/status), and for some other administrative operations. This command is reserved to the super-user.

    * The postalias command maintains Postfix alias databases. This is the program behind the newaliases command.

    * The postcat command displays the contents of Postfix queue files. This is a limited, preliminary utility. This program is likely to be superseded by something more powerful that can also edit Postfix queue files.

    * The postconf command displays Postfix main.cf parameters: actual values, default values, or parameters that have non-default settings. This is a limited, preliminary utility. This program is likely to be superseded by something more powerful that can not only list but also edit the main.cf file.

    * The postdrop command is the mail posting utility that is run by the sendmail command in order to deposit mail into the maildrop queue directory.

    * The postkick command makes some internal communication channels available for use in, for example, shell scripts.

    * The postlock command provides Postfix-compatible mailbox locking for use in, for example, shell scripts.

    * The postlog command provides Postfix-compatible logging for shell scripts.

    * The postmap command maintains Postfix lookup tables such as canonical, virtual and others. It is a cousin of the UNIX makemap command.

    * The postqueue command is the utility that is run by the sendmail command in order to flush or list the mail queue.

    * The postsuper command maintains the Postfix queue. It removes old temporary files, and moves queue files into the right directory after a change in the hashing depth of queue directories. This command is run at mail system startup time.

Read more for Postfix Architecture : http://www.postfix.org/OVERVIEW.html

Advertisements

Posted on February 25, 2012, in LInux Based, Uncategorized. Bookmark the permalink. 1 Comment.

  1. Heya! I’m at work browsing your blog from my new iphone 4! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the great work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: