This an implementation of Base64 as described in rfc4648 (The Base16, Base32, and Base64 Data Encodings) for the Lotus Notes environment.
Base64 is an algorithm to encode binary data into a ascii text representation. Common applications are
- Passing credentials to web servers: HTTP Authentication: Basic and Digest Access Authentication.
- Transferring binary data in email:For this purpose, the encoding can be run in MIME-mode to produce line breaks.
- Transferring or storing binary data in other formats, like XML.
This library makes use of NotesStreams and NotesMIMEEntity that came with Notes 6.
Usage
- Save and unzip the code to a text file (libBase64.lss)
- Use Domino Designer to create a new empty Lotus Script library ‘libBase64′
- Import libBase64.lss and save the lib
- Now you can include the library (
Use "libBase64") and use it:Dim b64 As New CBase64()
Call b64.encode (..)
Samples
Encode a string to base64
Dim b64 As New CBase64()
Print b64.encodeString ("foobar")
Encode a binary file to a base64 encoded file
Dim b64 As New CBase64()
Call b64.encodeFileToFile (fspecInput, fspecOutput)
The result file will have line breaks at column 76. If this is not desired, than it can be suppressed. This will be a bit slower however:
Dim b64 As New CBase64()
b64.bMimeModeEncoding = False
Call b64.encodeFileToFile (fspecInput, fspecOutput)
Decode a base64 encoded file to a (probably binary) file
Dim b64 As New CBase64()
Call b64.decodeFileToFile (fspecInput, fspecOutput)
问题描述:
Domino的用户可以自己通过Web的方式去修改internet密码,更改结束后,旧的密码被放到服务器的缓存中,保留两天来确保管理请求数据库和domino通讯录之间的复制完成。更改密码的请求是由adminP这个任务,在管理请求数据库admin4.nsf中发起“change http password in domino directory”的管理请求从而得以完成的。如果这个默认的缓存时间过长或者过短怎么办?能调整这段缓存时间吗?
解答:
缓存时间可以通过在server的notes.ini里面添加以下参数来修改:
HTTP_Pwd_Change_Cache_Hours
使用的格式如下:
HTTP_Pwd_Change_Cache_Hours=X(X是旧的密码保存在缓存中的小时数目)。
在这段缓存时间内,旧的密码和新的密码都是有效的。
此外,如果服务器有设置过安全性策略文档,在“口令管理”标签下面,“允许用户通过 HTTP 改变 Internet 口令”这个域值应该是“是”。
上个月,由于邮件系统转移到DOMINO平台上,发生了一件非常奇怪的事情.
整个情况:内网邮件接发正常,可以接到外网邮件,但是发出的外网邮件,提示发送成功,但是对方却收取不到.
分析:邮件系统是由2台server组成的.
domino的邮件收取是由代理完成,即server1完成内部邮件的发送收取,外部邮件的发送.
按上面的情况,这3点正常就证明server1是不存在问题的.
向外发,由server2发向server1,server1转发出去,DOMINO进行邮件发送时候,所有有问题的邮件可以用domino administrator 消息处理检查mailbox,找到发不出的邮件,打开,可以看见正式错误提示
另外,domino邮件系统可以提供邮件追踪,可以追踪到邮件状态.
当我们在mailbox找到邮件的时候可以确定:邮件没有发出.
当时唯一通过google收集的有效信息就是,DNS出现错误了.
检查server的IP配置,可以确定没有问题,可是问题再那里呢?
再google提示到双网卡的问题,由于DOMINO是不识别双网卡的,双网卡会导致识别不了DNS.可是,我们只对一块网卡设置了IP,另一块的禁用的.
事实证明DOMINO就是这么笨蛋,只要有二块网卡DNS就是不认.
解决的办法很简单.
在domino目录的notes,ini文件中间增加一句话:DNSServer=DNS IP.例如是深圳的用户:DNSServer=202.96.134.133,这样就可以确信DOMINO可以识别正确的DNS了
一些邮件问题解决步骤:
●邮件不能发送出去?
【对策】
检查[配置]—[服务器/配置]—[编辑]:
a.发件人地址
b.任务
c.目的服务器
d.网络连接
e.路由时间安排
f.连接文档
g.邮件大小
h.优先级与待发邮件数
i.邮递限制j.宿主邮件服务器
●收到退信?
【对策】
查看:消息处理、邮件、public邮箱(mail.box)、Console command:show server
处理:删除或释放死锁邮件
●发出,无退信,但对方无法及时收到?
【对策】
检查:1)用户惯用选项—端口—跟踪—跟踪,选择跟踪条件,发跟踪邮件,返回跟踪报告。
2)路由时间安排
[color=blue]★邮件诊断操作步骤[/color]
☆配置邮件跟踪:
配置、服务器、配置、填加配置(或编辑现有的服务器配置文文件)
基本:使用这些设置作为所有服务器的缺省设置(是)
或 添入具体的群组或服务器名称
路由器/SMTP、消息跟踪:
消息跟踪:启用
记录消息主题:是
消息跟踪集合时间间隔:15
允许跟踪消息:加入服务器名
允许跟踪主题:
保存退出
☆启动、停止邮件跟踪任务
配置邮件跟踪后,在服务器启动时,会自动创建“邮件跟踪储存”数据库:
\lotus\domino\data\mtdata\mtstore.nsf
服务器启动时,自动启动服务器上的邮件跟踪。
手动:
Load mtc
Tell mtc quit
Tell mtc process
☆发送跟踪邮件:
消息处理、邮件、工具、消息处理、发送邮件跟踪
收件人:
主题:
发送跟踪报告来自:
发送、完成
☆查看邮递报告
消息处理、邮件、邮件路由事件
打开相关文档,查看邮递报告或打开邮箱,会收到邮递报告
☆跟踪中心:
消息处理、跟踪中心
新建跟踪请求
从;到;发送;开始;主题等
确定
选择一个邮件
跟踪选定的信息
查看跟踪结果
[color=blue]★邮箱方面操作点滴[/color]
◆优化邮件
多个邮箱:
设置多个(3--5)MAIL.BOX,同时处理邮件
减少争夺
增加可靠性
提高传送速度
配置、服务器、配置、打开服务器配置文文件、路由器/SMTP
基本:邮箱数(N)
RES S
◆共享邮件:
邮件:
信头:发送给所有用户
信体:发送一份到共享邮箱中
配置、服务器、配置、打开服务器配置文文件
在NOTES.INI中加入SHARED_MAIL=1
RES S
◆邮件限额:限制NOTES用户的邮箱和邮件的大小
1、邮件文件
文件、MAIL活页夹、选一个用户文件、工具、数据库、限额、限制限额及警告值
在其它消息中可疑查看限额
在建立用户时,也可以进行限额设定操作
2、每个邮件的限额
配置、服务器、配置、打开配置文文件、路由器/SMTP、限制和控件、限制
最大消息长度
◆邮件内容格式:
用户个人文文件:邮件、外出邮件的惯用格式
场所文档:编辑场所、邮件、寻址发送到internet的邮件的消息格式
◆设置用户执行邮件代理
编辑服务器文文件、安全性、代理限制、在“运行受限制的LotusScript/Java代理”中填加用户
The following table summarizes the known maximum limits of various Notes and Domino features.
Item | Maximum limit |
Database size | The maximum OS file size limit -- (up to 64GB) |
Text field size | 32KB (storage); 32KB displayed in a view's column |
Rich text field size | Limited only by available disk space up to 1GB |
Response levels in a hierarchical view; number of documents per level | 31 levels; 300,000 documents |
Characters in names | Database Title: 96 bytes Filenames: On Windows® and UNIX®platforms minimum of 255 and/or OS limits; on local Macintosh workstation 31 Field names: 32 View names: 64 Form names: 32 Agent names: 32 |
Fields in a database | ~ 3000 (limited to ~ 64K total length for all field names). You can enable the database property "Allow more fields in database" to get up to 22,893 uniquely-named fields in the database. |
Columns in a table | 64 |
Rows in a table | 255 |
Views in a database | No limit; however, as the number of views increases, the length of time to display other views also increases |
Forms in a database | Limited only by database size. |
Columns in a view | 289 ten-character columns; dependent upon # or characters per column |
Documents imported into a view | Documents totaling at least 350K |
Cascading views in a database | 200 |
Margin size (in inches) | 46 |
Page cropping size (in inches) | 46 |
Point size to select or print | 250 |
Documents in a view | Maximum of 130MB for a view index |
Documents that can be exported to tabular text | Limited only by available disk space |
Entries in an Access Control List (ACL) | ~950 names (ACL size is limited to 32767 bytes) |
Roles in an Access Control List | 75 Roles |
ID password length | 63 characters |
Authorized users on a multiple password ID | 8 users |
Outline entries in an outline | ~21,000 entries |
1.在表单的JS Header中写判断的javascript函数:
var request;
function checkloginname(){
request = new ActiveXObject("Msxml2.XMLHTTP")
if (!request){
request=new ActiveXObject("Microsoft.XMLHTTP");}
request.onreadystatechange=aftercheckloginname;
//这里假设数据库路径为mis/accounts.nsf,且表单中输入帐号的域是account,将这个域的值传递到代理中
url="/mis/accounts.nsf/checkRepeatId?openagent&Id="+document.forms[0].account.value;
request.open("post",url,true);
request.send(null);
}
function aftercheckloginname(){
if (request.readystate==4){
if (request.status==200){
if (request.responseText.indexOf("1")>-1){
alert (" 对不起,该帐号已经被使用!");
document.forms[0].account.value="";
document.forms[0].account.focus();
}
}
}
}
2.新建一个checkRepeatId的代理:
Sub Initialize
Dim ss As New NotesSession
Dim doc,docx As NotesDocument
Dim view As NotesView
Dim db As NotesDatabase
Set doc=ss.DocumentContext
Set db=ss.CurrentDatabase
Set view=db.GetView("checkid") '这个试图即为帐号的试图,试图第一列为帐号
macro=|@RightBack(Query_String_Decoded;"=")| '这句是获取从URL传过来的参数
id=Evaluate(macro,doc)
Set docx=view.GetDocumentByKey(id(0),True)
Print "Content-type: text/xml"
If Not docx Is Nothing Then
Print "1"
Else
Print "0"
End If
End Sub
3.在表单中输入帐号的域,这里举例为account,在域的onchange或者onblur事件中调用javascript方法checkloginname()
thisDb:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName;-1);" ";"+");"\\";"/");
@If(@Attachments!=0;"[<a href=\"/"+thisDb+"/0/"+@Text(@DocumentUniqueID)+"/$FILE/"+@AttachmentNames+"\" target=\"_blank\">"+@AttachmentNames+"</a>]";"")
二、可删除链接
thisDb:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName;-1);" ";"+");"\\";"/");
@If(@Attachments!=0;"[<INPUT TYPE=checkbox NAME=\"%%Detach.1\" VALUE=\""+@AttachmentNames+"\"><a href=\"/"+thisDb+"/0/"+@Text(@DocumentUniqueID)+"/$FILE/"+@AttachmentNames+"\" target=\"_blank\">"+@AttachmentNames+"</a>]";"")
但是,当附件的名称中包含“#”、“&”等特殊符号时(例如jeep#beijing.jpg),上面写的链接在特殊符号处就会被截断,从而导致附件不能正常打开。要解决这个问题,需要在写链接的时候把这些特殊符号进行转换,具体方法如下:
thisDb:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName;-1);" ";"+");"\\";"/");
aa:=@URLEncode("domino";@AttachmentNames);
@If(@Attachments!=0;"[<a href=\"/"+thisDb+"/0/"+@Text(@DocumentUniqueID)+"/$FILE/"+aa+"\" target=\"_blank\">"+@AttachmentNames+"</a>]";"")
Public Function urlDecode(s As String) As String
If Len(s) = 0 Then Exit Function
Dim i As Integer
Dim tmp As String
Dim c As String
For i = 1 To Len(s)
c = Mid$(s, i, 1)
If c = "+" Then c = " "
If c = "%" Then
c = Chr$("&H" + Mid$(s, i + 1, 2))
i = i + 2
End If
tmp = tmp + c
Next i
urlDecode = tmp
End Function
Public Function urlEncode(s As String) As String
If Len(s) = 0 Then Exit Function
Dim tmp As String
Dim c As String
Dim i As Integer
For i = 1 To Len(s)
c = Mid(s, i, 1)
If (Asc(c) >= 65 And Asc(c) <= 90) _
Or (Asc(c) >= 97 And Asc(c) <= 122) _
Or (Asc(c) >= 48 And Asc(c) <= 58) _
Or Asc(c) = 38 _
Or (Asc(c) >= 45 And Asc(c) <= 47) _
Or Asc(c) = 58 Or Asc(c) = 61 _
Or Asc(c) = 63 Or Asc(c) = 126 Then
tmp = tmp + c
Else
tmp = tmp + "%" + Hex(Asc(c))
End If
Next i
urlEncode = tmp
End Function