When submitting svn, you will be notified by email about the problem solving experience and svn email notification.

Source: Internet
Author: User

When submitting svn, you will be notified by email about the problem solving experience and svn email notification.
Svn can use the hook function to Send comment/log and content change comments to a specified email address when submitting a commit request, so that you can monitor the content conveniently.
The specific description is,
1. when an account submits code or documents, the hook function is used to call the post-commit file under the hooks directory of the repository. In fact, a shell file is executed, so the file must have the execution permission.
2. in the shell file, run mailer in explicit encoding mode. py, according to mailer. the email server configured in the conf file, such as from address, to address, and reply to, sends emails with various information when svn is submitted to the specified mailbox.
3. If you use this method to configure the mail Notification function, according to the above description, your operating system requires a python runtime environment. Generally, the version should be no less than 2.4.x
4. For the specific configuration above, refer to the official wiki. The link is as follows:
Https://ctf.open.collab.net/sf/wiki/do/viewPage/projects.svnedge/wiki/CommitMailerOnLinux

After I configure it on a linux testing machine according to the method provided on the official website, I will soon receive an email. Everything runs normally. However, after I configure it on the svn server of the company's Intranet, no error message is prompted during running, but the email cannot be received. In a linux system, there is no error message when executing shell commands, which indicates that the command is run correctly. But the email cannot be received. What is the problem?
So I started to compare the versions of the two operating systems, python versions, and so on, and found that they were not exactly the same. The testing machine uses centos 6.4 and python 2.6.6, while the svn server uses Redhat kiTangka 5.8 and python 2.4.3. Are these reasons?
At this point, I was unable to do anything, and even thought that if there was no way, I could only do data migration.

At this moment, I consulted the company's O & M colleagues and started to turn things back and forth. The O & M personnel first ping the smtp mail server address on the svn server and find that the ping fails, while the test server can.
You need to configure dns resolution on the svn server. After the configuration, You can ping the email server immediately, but you still cannot receive the email.
At this moment, the O & M colleagues started to check whether the sendmail service of the svn server is correct. Sure enough, the mail service of this machine was not started and cannot send/receive any emails, so they started the mail service, then... Emails that haven't been sent before have started to be sent in a delayed manner like snow.
Now all configurations are successful!

The ultimate solution to this problem brings you the biggest lesson: in linux, this is actually true in any system. If you want to use the network environment and a certain service, for example, to send emails and provide web http Services, a very important prerequisite is that the basic network, dns, ip configuration, email service, and even iptables firewall in the system are ready, go to the upper-layer development or configuration. Do not blindly doubt that your program or upper-layer execution has problems. When the server can be correctly executed and cannot be executed, we should fully consider the differences between the two runtime environments. Otherwise, the problem will not be well solved.
Finally, you must have a deep understanding of common operating systems. For example, if you do not know at first, you must start the mail service to send emails in linux.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.