1. Home
  2. Configuring
  3. How do I customize postfix?

How do I customize postfix?

Short answer:

For Bright Cluster Manager 7.0 and Above, the relay host can be managed by BCM in the base partition.

Longer answer

The /etc/postfix/main.cf, on the BCM default head node is the same as the default distribution version, with an appended section that Bright maintains. The same is true for /etc/postfix/generic.cf. You may customize these files to taste just like you would on a normal linux system, as long as what you change does not conflict with the BCM-autogenerated settings. The relayhost setting of Postfix is a BCM-autogenerated setting, so it is best to set it by using BCM rather than trying to adjust it directly the standard Postfix way, in the configuration files.

Postfix configuration files have statements that can override earlier ones, so a FrozenFile configuration directive is almost certainly not needed. The FrozenFile directive is covered in the appendix on CMDaemon Configuration File Directives in the Admin Manual.

Example: setting up a relay host.

By default, BCM has no relay host defined. Therefore postfix will try to deliver mail by figuring out the MX records from the recipients’ domain and connecting to any mail servers defined within DNS.

Note:
A relay host for Bright 6.1 and below can normally be configured the standard postfix way, ie, setting:

relayhost = [my.relay.host.com]

within the /etc/postfix/main.cf file, outside the BCM autogenerated section on the head node.

Then reload postfix
[root@bright ~]# service postfix reload

For Bright 7 and Above the relay host can be specified as follows:

  • in cmgui the SMTP relay host value can be set in the Settings tab for the cluster resource
  • in cmsh the relayhost property can be set for the base object within partition mode:

[root@bright ~]# cmsh
[bright]% partition use base
[bright-> partition[base]]% set relayhost mail.example.com
[bright-> partition[base*]]% commit

Postfix on the regular nodes is configured to use the head node as a relay host and is normally left untouched by the administrator.

Example: setting to the domain name from which mail is sent

A typical postfix address rewrite so that local mail is sent out as a “proper” internet-format e-mail. See http://www.postfix.org/ADDRESS_REWRITING_README.html#generic for background postfix documentation.

Eg: add to the end of the /etc/postfix/generic file, outside the autogenerated section:

vi /etc/postfix/generic
/^root@(.*)/ root@example.com

This rewrites any outgoing mail starting with root@<some local domain> to root@example.com so that the recipient sees it as coming from root@example.com

Example: rewriting the local username and domain.

vi /etc/postfix/generic
/(.)@..cm.cluster/ $1@domain.com

Updated on May 3, 2024

Related Articles

Leave a Comment