免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1227 | 回复: 1
打印 上一主题 下一主题

[Mail] sqwebmail的多虚拟域不同风格的支持! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-17 22:40 |只看该作者 |倒序浏览
我本来是为了找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

论坛徽章:
0
2 [报告]
发表于 2003-06-18 07:43 |只看该作者

sqwebmail的多虚拟域不同风格的支持!

不错,偶试一试。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP