When SVN submits, the email notification problem solved the experience talk

Source: Internet
Author: User

SVN can be implemented in the commit, using the hook hook function, to the designated mailbox to submit comments Comment/log and content changes in the mail, so as to facilitate monitoring.
The specific description is that
1. When an account is submitted code/document, using the hook function, call the warehouse hooks directory of the Post-commit file, is actually executing a shell file, so require this file has Execute permission
2. In the shell file, the mailer.py is run by an explicit encoding, according to the mail server configured in the mailer.conf file, from the Address,to address,reply to, etc. Sends a message to the specified mailbox with various information about the SVN submission.
3. If you configure the mail notification function in this way, according to the above description, your operating system needs to have a Python runtime environment, generally speaking, the version should be no less than 2.4.x
4. The above specific configuration can refer to the official wiki, the link is as follows:
Https://ctf.open.collab.net/sf/wiki/do/viewPage/projects.svnedge/wiki/CommitMailerOnLinux

I follow the method given in the official website after the configuration on a Linux test machine, will soon receive the mail, everything is working properly, however, configured on the intranet of the SVN server, run without any error prompts, but is not receiving mail. As a matter of principle, under the Linux system, the Execute shell command does not have any error prompts, stating that this command is running correctly. But can't receive the mail, what's the matter?
Then began to compare two operating system versions and other information, Python version and so on, found to be not exactly the same. The test machine uses CentOS 6.4, Python 2.6.6, and the SVN server is Redhat kitangka 5.8,python 2.4.3. Is that why?
At this point some helpless, even once thought if really no way, can only do data migration.

At this time, consulted the company's operations colleagues, things began to twists and turns. OPS first pings the SMTP mail server address on the SVN server and finds that the ping is not available, while the test machine can.
Then you need to configure DNS resolution on the SVN server, you can ping the mail server immediately after the configuration, but you still cannot receive the message.
Operations colleagues at this time and leisurely start to see the SVN server SendMail service is correct, sure enough, the mail service of this machine is not started, can not send/receive any mail, so start the mail service, and then ... Messages that have not been sent before have been delayed and are being sent as a snowflake.
This is all configured successfully!

The ultimate solution to the problem, the biggest lesson is that in Linux systems, in fact, in any system is the case, if you want to use the network environment and a service, such as sending mail, provide Web HTTP service, etc., a very important premise is that in the system of the basic network, DNS, IP configuration, mail service and even iptables firewalls are ready to go on top-level development or configuration, so don't be suspicious of your own programs or upper-layer execution problems. When tangled in that server can be executed correctly, why this is not possible, to fully consider the difference between the operating environment, otherwise the problem is not a good solution.
Finally, you have to have a deep understanding of the common operating system, such as initially I do not know that the Linux system sent to send mail, need to start the mail service.

When SVN submits, the email notification problem solved the experience talk

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.