email - Send email upon commitΒΆ

Version Not specified
Branch lp:bzr-email
Home page
Owner lifeless
GNU/Linux Yes
Windows Maybe (please test)
Mac OS X Yes

Sending emails for commits and branch changes.

To have bzr send an email you need to configure an address to send mail to for that branch. To do this set the configuration option post_commit_to and the address to send the mail from is read from the configuration option post_commit_sender (if not supplied defaults to the email address reported by bzr whoami).

By default, the diff for the commit will be included in the email if the length is less than 1000 lines. This limit can be changed by setting the configuration option ‘post_commit_difflimit’ to the number of lines you wish it to be limited to. Set it to 0 to unconditionally disable sending of diffs.

By default bzr-email only emails when a commit occurs, not when a push or pull operation occurs. To email on push or pull set post_commit_push_pull=True in the configuration.

If you are using a bzr release from before 0.15, you need to manually tell bzr about the commit action, by setting in bazaar.conf or locations.conf.

The URL of the branch is determined from the following checks (in order):
  • If the configuration value ‘post_commit_url’ is set, it is used.
  • If the configuration value ‘public_branch’ is set, it is used.
  • The URL of the branch itself.

Setting public_branch is highly recommended if you commit via a protocol which has a private address (e.g. bzr+ssh but anonymous access might be bzr:// or http://).

How emails are sent is determined by the value of the configuration option ‘post_commit_mailer’:
  • Unset: use /usr/bin/mail.

  • smtplib: Use python’s smtplib to send the mail. If you use ‘smtplib’ you can also configure the settings “smtp_server=host[:port]”, “smtp_username=userid”, “smtp_password”. If “smtp_username” is set but “smtp_password” is not, you will be prompted for a password.

    Also, if using ‘smtplib’, the messages will be sent as a UTF-8 text message, with a 8-bit text diff attached (rather than all-as-one). Work has also been done to make sure usernames do not have to be ascii.

  • Any other value: Run the value expecting it to behave like /usr/bin/mail - in particular supporting the -s and -a options.

When using smtplib, you can specify additional headers to be included in the mail by setting the ‘revision_mail_headers’ configuration option - something like:

revision_mail_headers=X-Cheese: to the rescue!

Previous topic

cia - Submit commits to CIA (open source VCS informant)

Next topic

checkeol - Pre-commit hook to check files for correct line-endings

This Page