dev.heartsavior.net/45

Trac 메일 발송이 되지 않을 때 - SMTPAuthenticationError: (535, 'authorization failed (#5.7.0)')



메일 호스팅을 옮기면서 Trac의 알림 메일이 보내지지 않는 상황이 발생했다.

일단 log 파일을 열어 상황을 보니...
SMTPAuthenticationError: (535, 'authorization failed (#5.7.0)')

라는 에러 메시지가 보였다.

파이썬을 전혀 모르기 때문에 구글링을 시작했고,
@ [Trac] How to fix an SMTP authentication issue

라는 페이지에서 해답을 찾아 해결할 수 있었다.

아래는 페이지 내용...
I'm posting this to help anyone who might have the same problem. I wasgetting this in the log whenever Trac tried to send an email: (535, 'authorization failed (#5.7.0)')

After searching around google regarding the python smtplib, I was able to fix the problem. In the smtplib.py python source file, I found the following line in the login method:
preferred_auths = [AUTH_CRAM_MD5, AUTH_PLAIN, AUTH_LOGIN]

I changed the line to use the AUTH_LOGIN method and now I can sendemails ok:
preferred_auths = [AUTH_LOGIN, AUTH_PLAIN]

I guess my smtp server (a very large commercial provider) doesn't like the CRAM_MD5 method. This is the only python app I have running on myserver, so I wasn't concerned with it affecting another app.

- Brian

ps. smtplib.py는 PYTHON_설치경로\Lib 에 있고, py 파일 수정 후 pyc 파일을 삭제하면 필요시에 자동 컴파일되어 pyc 파일이 생성된다.

Posted by [czar]
,

www.zziuni.pe.kr/myproject/entry/Trac-메인페이지-바꾸기?category=4


Trac를 나처럼 개 노가다로 관련 모둘 하나하나씩 개노가다로 깔면, 
Trac library의 Path는 python folder의 하위인 다음이 된다. 
C:\Python25\Lib\site-packages\trac


프로젝트 리스트가 나오는 페이지는 
C:\Python25\Lib\site-packages\trac\template\index.html

이파일을 편집하면, 트렉의 메인을 바꿀수 있다. 

주의할점은. 확장자는 html이지만 Python이 로드해서 랜더링하는 템플릿 파일이므로, 
Python문법이 맞지 않거나, Html Tag의 열고 닫음이 명확하지 않으면, 랜더링시 오류가 난다. 
이점만 주의하면 원하는데로 바꿀 수 있음. 

변경한 두가지 메인페이지이다. 

index.html
사용자 삽입 이미지

Posted by [czar]
,
www.zziuni.pe.kr/myproject/entry/위키의-기본문서-내용-바꾸기

Trac에서 new Project를 생성하면, UserGuide성 Wiki document가 쭉 생성된다. 
이 문서들은. 템플릿 문서와 같이 Trac Library folder에 있다. 

C:\Python25\Lib\site-packages\trac\wiki\default-pages\

사용자 삽입 이미지


new Project생성때마다 Wiki의 첫페이지인 WikiStart에 넣고 싶은 내용이 있다면, 위 Path에서 해당 파일을 찾아서 변경하고 Project를 생성하면 된다. 
단 아직 encode문제로 한글은 해결하지 못했다. 

Posted by [czar]
,
eahn.tistory.com/14

rac을 알게된후참 많은 것을 하게되는 군요...
apache에 trac을 설치한후 사용자를 추가하려면, apache\bin\htpasswd....
뭐 이런 짓(?)을 해야 사용자를 추가 할 수 있는데 이것을 편리하게 해주는 plug in을 설치해보자
http://trac-hacks.org/wiki/AccountManagerPlugin
위의 사이트에서 받아서 설치를 하면 되는데, 역시나 서버가 인터넷에 접속을 할 수 없는 관계로 소스를 받아서 설치하도록 한다.
단, 먼저 
easy_install이 설치가 되어 있어야 한다.
인터넷에 접속이 가능하면 이렇게...
easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10

소스를 받아서 설치하려면
trac 버전에 따라 선택한다.
svn co  
http://trac-hacks.org/svn/accountmanagerplugin/0.9
svn co  http://trac-hacks.org/svn/accountmanagerplugin/0.10

이것을 설치가능한 egg로 만들어 보자
python setup.py bdist_egg

dist 디렉토리에  TracAccountManager-0.1.3dev_r2171-py2.4.egg 파일이 생성되는데
이것을 설치하면 된다.
python TracAccountManager-0.1.3dev_r2171-py2.4.egg

이런다고 끝나는 것이 아니다. trac의 webadmin 에서 plugin 항목에서 
간단하게 몽땅 사용하는 것으로 설정한다.
사용자 삽입 이미지

그리고 나서 trac.db\conf\trac.ini 파일에 아래의 내용을 추가해준다.
[account-manager]
; configure the plugin to store passwords in the htpasswd format:
password_format = htpasswd
; with Trac 0.10 use this instead:
password_store = HtPasswdStore
password_file = e:/repos/test/.htaccess


위와 같이 설정하면 완성이 된다.
사용자 삽입 이미지

우측상단에 개인별로 로긴정보를 관리할 수 있는 my account 링크가 추가되어 있는것도 볼 수 있다.

좀더 많은 정보가 필요하면  
http://trac-hacks.org/wiki/AccountManagerPlugin 이곳으로...
Posted by [czar]
,