- 论坛徽章:
- 0
|
我本来是为了找sqwebmail的上传文件中文名显示为...问题的解决办法,结果无意中看到这个,贴上来送给大家咯。。。。自己看吧,很容易看明白。
另:不情之请:我的底层是用的postfix来实现的,而在sqwebmail的sendit.sh需要指定发信的命令。。。有熟悉postfix的朋友能告诉我一下么??
SQWEBMAIL PATCH
Please Note: This patch is not actively maintained. It has been tested only on pre-.28 versions of sqwebmail and may not apply to your version of sqwebmail.
Q: How do I modify sqwebmail to accomodate relative path to templates which allows different virtual domains on the same host to use different HTML templates?
A: The HTML Templates in sqwebmail work great. But, you may want to have the same executable serve multiple domains with different templates for each domain.
Here's how to modify sqwebmail.c to take a relative path as of version 0.24. Changes are very similar for .26 and .27:
1. Add a global working dir variable to sqwebmail.c at about line 59
char workingdir[512];
2. Added pushdir code to the start of sqwebmail.c/open_langform(...) at about line 298
char szPushedDir[512];
getcwd( szPushedDir, 512 );
2a. Pick up the working directory anywhere in sqwebmail.c/main2() at about line 1003
getcwd(workingdir, 512);
3. Surround the fopen call in sqwebmail.c/open_langform(...) with chdir's to the correct template location at about line 308:
chdir(workingdir); // Add this line
f=fopen(formpath, "r" ;
chdir(szPushedDir); // Add this line
4. Added extern reference to workingdir in newmsg.c at about line 34
extern char workingdir[];
5. Added pushdir code to the start of newmsg.c/dosendmsg(...) at about line 438
char szPushedDir[512];
getcwd( szPushedDir, 512 );
6. Surrounded call to execl sendit.sh in newmsg.c/dosendmsg(...) at about line 515
chdir(workingdir); // Add this line
execl(HTMLLIBDIR "/sendit.sh",
"sendit.sh", returnaddr, sqwebmail_mailboxid,
NULL);
chdir(szPushedDir); // Add this line |
|