Tuesday, January 30, 2007

Sample Code: Shell function

In the forum, some one asked how he can download a file from a web server
via lotus script. It hit me. I have exactly almost the same function, but I
download from a ftp server instead of a web server. But, it almost the
same.

Actually lotus script - as far as I know - doesn't provide function for
that. So, I look elsewhere, then I found a very interesting function call
shell.

From Designer Help, description about shell function is very short - Starts
another program - that it, no more no less.

Later I found out that shell can 'almost' run anything via command line,
like my agent that called an ftp program to download or upload a file.

Sample of my agent:
Dim TaskID as integer
TaskID = Shell ("c:\programto\download.bat")

Than I create a batch file called download.bat
ftp.exe -i -s:"c:\programto\download.txt">c:\jbadownload\log\getsO13Log.txt

Than I create a download.txt
open ftp.server.com
ftpusername
ftpusepassword
ascii
prompt
cd tosomefolder
lcd tosomelocalfolder
get somefile
bye

See the tricks?

I don't use any third party ftp client, just using ftp client that already
included in all windows distribution. That's works.

I also use the shell function to do many things, like extract zip files
with pkunzip and many more.

Thursday, January 25, 2007

How to configure sendmail as a gateway

This is a simple how to about how to configure sendmail to act as a mail
gateway.

This how to will only talk about 3 files: access, mailertable and
relay-domains.

File relay-domains NOT included in sendmail distribution (at least in my
CentOS distribution), you have to create it manually.
All files (at least in my CentOS) located in directory /etc/mail

Access file
First, we put our host and our network to be able to relay through our
server.
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.1 RELAY
192.168.2 RELAY

If you use GreetPause feature, you can put no waiting for local email.
GreetPause:localhost 0
GreetPause:192.168.1 0
GreetPause:192.168.2 0

If you using DNSBL, and want to skip one or two domains from DNSBL check,
you can use this
Connect:friendlydomain.com OK

Now for the big part.
Put all the domain that you want to relay BUT put it as REJECT. This way by
default all emails to that domain will be rejected unless we specify
otherwise - in this case OK.

indomino.net REJECT
blablabla.org REJECT
something.edu REJECT

user1@indomino.net OK
user2@indomino.net OK
user3@indomino.net OK

user1@blablabla.org OK
user2@blablabla.org OK

user1@something.com OK

Finish. For access file, you can use make -C /etc/mail to 'compile' it.

Mailertable file
Now put this entry in mailertable, so sendmail will know to where it will
route the emails.
indomino.net smtp:smtp.indomino.net
blablabla.org smtp:[192.168.1.25]
something.edu esmtp:[192.168.1.50]

Finish. Do make -C /etc/mail to 'compile' it.

Relay-domains file.
Most forgotten file, I think because it's not included in most
distribution. You have to create it manually. Simply as type touch
/etc/mail/relay-domains to create the file.

Now type all the domain that you want to relay.
indomino.net
blablabla.org
something.edu

Finish. Now restart the server.

Monday, January 22, 2007

How to create your first notes database

Once, I met a friend who just take a course on domino designer. After a
small talk, he ask a question that surprised me. How to create a lotus
notes database? I look at him, and ask didn't he just take a course for
that? It seem a stupid question. then he explain me that he know how to
create form, views etc, BUT he doesn't how to start and how they linked to
each other. Based on my friend experienced, I create this mini how to. This
is a very basic tutorial on how to create your first lotus notes database.

To do this, you must installed domino designer.

First of all, create a blank database.
>From File menu, select Database and click New. Than right click the
database, then click Open in Designer.

Second, create a form.
In the form, you should at least add one field, and action buttons to edit
and save.
For edit button, you can use this simple formula:
@Command([EditDocument])

For save button, you can use this formula
@Command([FileSave]);

If needed, you can add another action button, called Exit or Close
@Command([FileCloseWindow])


Third, create a view to display the form.
In the view, you should add an action button to create the form that you
just created.
Example:
@Command([Compose];"Form A")

That it. Very basic, but your first notes database is ready to go.


To make your database more readable by users or to make it more good
looking, you can add these additional steps.

First, I like how IBM design the mail template. Therefore I like to use the
same design as in the mail template.

Create few pages
As in mail template, create two pages, one for database name, and second to
display your user name.
For page to display your database name, just type the name, no formula
needed.
For page to display your user name, create a computed text, and in the
formula windows type this formula @Name([CN];@UserName).

Create an outline.
Outline will simplify how your notes user will switch on different view.
Create one outline, and click generate default outline and then create a
page to display the outline.

Create a frame.
And to put the whole elements that you just created, you use a frame.

Now from the database properties, in launch tab, select the frame that you
just created as default launcher.

That it. Your database now look more professional with pages and frame. Add
more colors or pictures if you have too.

To add more functionality for your database, create an agent. This, another
story.

Tuesday, January 16, 2007

Steps to stop SPAM

There is a good article about steps that we can use to prevent spam, you
can find the very good article in here
http://www.spamhaus.org/effective_filtering.html.

Personally, I use spamhaus as my primary DNSBL. It never let me down. Off
course there are some legitimate emails that being block by spamhaus, very
few, and that's not my problem. :).
I believe email administrators and ISP admin must protect they servers and
their network from spammers.

These is my configuration to stop spam:

1. DNSBL test in mta level.
I use sendmail as my mta server, and activated DNSBL in sendmail. Why put
DNSBL in mta level? Because it can stop a lot of spam before it transferred
to our mail server. But because it will stop few legitimate emails, I try
to put 'not so aggressive' DNSBL like sbl from spamhaus (actually I use
sbl-xbl.spamhaus.org).

2. Greetpause
Great new feature from sendmail. This way all emails (except if we put some
conditional) will be forced to wait for HELO or EHLO command from the mta
server. If the email doesn't bother to wait for HELO or EHLO command, the
we don't bother to receive, we simply kick it.

3. Mailscanner
Great software. Nothing more to say. You can download the latest version in http://www.mailscanner.info. In Mailscanner I activate these
features:

3.1. Spamassassin
A must. In new version of spamassassin there a script called sa-update to update builtin spamassassin rules, you can use cron job to make it run automatically every day.
You can add additional rules for spamassassin, most of them are in http://www.rulesemporium.org, additional rules can be automatically updated with smart cron job called rules_du_jour.

3.1.1. DCC + Razor
Inside the Spamassassin, I turn on both DCC and Razor. Increase the spam
score enough to make it a spam.

3.1.2. Bayes
Help a lot to stop more spam. I create two mail box, one for spam and one
for ham (non spam). Each day, a cron job will learn from each mail box, and
learn it as spam or ham.

3.2. Clamav (for check viruses)
Every mail server need antivirus. Clamav is the best there is, and free.

3.3. Another DNSBL test (to increase score)
This DNSBL actually will increase the spam score.

That's are my configurations. Hope that will help you to create your own
configuration for battle against spam.

Monday, January 15, 2007

Sample Code: Import data from a text file into notes database

This morning, I have a question for a member of mailing list, how we can
import data from a text file. Well I just have the code for that. Is quite
simple on how to import the data from a text file, but what you gonna do
with the data, is another question.

This a cut version of my lotusscript agent. I only show how we import the
data from a text file. My agent, actually use the data to create new
documents in notes database. The text file should located in the server
where the agent run. Also the signer of the agent must have appropriate
rights in the server.

In the agent, you will see the NoteLog object. Well, I have a habit to
create a log on every agent that I created. So I can troubleshoot the agent
easily if something goes wrong.

>>>>>
Sub Initialize
Dim fileNum As Integer
Dim strLine As String

'//=====prepare for loging
Dim currentLog As New NotesLog( "Import data from text file" )
Call currentLog.OpenNotesLog( "", "AMgrLog.nsf" )
'//=====

fileNum = Freefile()
Open "c:\data\import\sample.txt" For Input As fileNum

'//=====
Call currentLog.LogAction( "Import data from text file - Start")
'//=====

Do While Not Eof (fileNum)
Line Input #fileNum, strLine
'//===now you have strLine variable that you can manipulate as
you want
'//===example Trim(Mid$(strLine,69,7))
Loop

Close fileNum
'//=====loging
Call currentLog.LogAction( "Import data from text file - End")
Call currentLog.Close

End Sub
>>>>>

Now, you have it and have fun.

Friday, January 12, 2007

Lotus notes client 7.01 for Linux

Maybe some of you remember when WE - Lotus Notes user and also Linux lovers
- ask when will the IBM release Lotus Notes client for Linux? The answer is
simple, NEVER because it will need to redesign and recoding the software
completely, and even IBM doesn't have resources for that.

But now, there is.

IBM finally launching Lotus Notes client for Linux since June 2006. Thanks
to eclipse powerful software, IBM engineers able to run Lotus Notes client
as eclipse plug-in.

Some user report that the client is take a lot of memory because it run
under the eclipse software. While eclipse software it self take a lot of
memory. Users hope that maybe in future, respectful IBM engineers will able
to make eclipse software much thinner and lighter and of course faster. So
Lotus Notes client able to run under it with better performance.

Right now, only passport customers are able to download the software. There
is no trial version - yet.

Well, at least we have hope now. Not that simple answer NEVER.

Linux is the future, as simple is that. And IBM knew it, that why despite
the NEVER answer, IBM still looking for a way to make Lotus Notes run under
linux. Thanks IBM for great and wonderful software's.

Wednesday, January 10, 2007

Funambol: Open Source Domino Sync

While I'm browsing the openntf.org I saw an add that interest me. Open Source Domino Sync. The first two words very interesting, 'Open Source' :).
When I click that link, it link to me to this site at http://www.funambol.com/opensource/, and inside its much much more interesting.

It's very like similiar with software like commontime, where we can sync our contact, calendar even email and journal to our 'mobil device' but it's an open source. It's compatible with many mail server and with many 'mobile device'. It even provide domino connector, so Funambol server can connect to the domino server.

I have an old palm device and been searching for sync software for a while, and found out that commontime is more suitable for my purpose. But, with my budget, I can only afford the desktop version where I can only sync when I connect to my pc at work. I can not sync from anywhere else.

But with this, push email for domino is in the horizon with no cost at all.

I not yet try this piece of software, but after I create a testing environmet, I will try it asap.

Monday, January 8, 2007

How to block spam in Lotus Domino 6.x?

This is a simple how to, and I hope will take you a quick guide to block spam with Lotus Domino 6.x
First, Lotus Domino is a great software. It's not just email, it simple more than that. If you want to use just email, you can have many options availbale, from pop3, imap, exchange, webmail etc. But if you need email AND also sharing, groupware and colaboration capabilities, Lotus Domino is the BEST choice.

But, when it many features, Lotus Domino is lack of it anti spam capabilities. It's improving, but still not enough.

If you have resources and time, you should put another server in the front of Lotus Domino to handle spam, but if you not, you can maximize Lotus Domino features. Like I said, its not enough, but its better then nothing.

All smtp configurations available in Domino Directory at Configuration --> Servers --> Configuration

DNS Blacklist Filters
This is a must. This is the first guard againts spam, in others mta, it known as rbl or dnsbl.
Most popular rbl servers are spamhaus and spamcop.
How it works? In smtp connection, smtp task will do a query for every incoming email if that email originating ip listed in the rbl server. If listed, then the smtp task simple reject the server, if not than continue the smtp connection. It saves bandwith and server resources and it block spam.
One must be carefull to choose the rbl server, because some servers are very aggresive, it may block your legitimate emails.
My persoanl choice is spamhaus, and the server is sbl-xbl.spamhaus.org. But that my personal choice.

Options available in DNS Blacklist Filters and also an example:
DNS Blacklist filter: Enabled
DNS Blacklist sites: sbl-xbl.spamhaus.org
Desired Actions when a connecting host is found in a DNS Blacklist: Log and Reject messages.
Custom SMTP error response for rejected messages: 'leave it blank'

Inbound Connection Controls
If you want to tight up the spam control than you can enable this. It will check your the host (computer name) than send the emails is listed in DNS query, and it must have reverse lookup entry in DNS.
Example: If new email come from domain testdomain.com with hostname testhost, the smtp will check if the testhost.testdomain.com will resolve an ip address. If not the it will reject the connection. If it resolve an ip address like 202.xxx.xxx.xxx then it will accept the connection.

Options availbale in Verify connecting hostname is DNS:
Allow connections only from the following SMTP internet hostnames/IP addresses:
Deny connections only from the following SMTP internet hostnames/IP addresses:

Inbound Sender Controls
This is a must. The smtp will check if the domain sender can be found in a DNS query. If not, it simply reject the connection.

Options available in Verify sender's domain in DNS:
Allow messages only from the follwoing external internet addresses/domains:
Deny messages only from the follwoing external internet addresses/domains:

Sunday, January 7, 2007

About MailScanner

One word about MailScanner, great.
It a tools that, well almost eliminate all your emails problem. Virus, and spam email will be eliminated. Not 100% though, but hey, nothing can.
MailScanner it a perl script that rely on other tools and software to eliminate virus and spam. It heavily rely on Spamassassin to check if the email is spam or not. For viruses, it can detect and use multiple anti virus installed, for example you can use clamav and f-prot for the same time.

MailScanner have many rules to simplify it setting. It have whitelist, blacklist, file name rules, file type rules and many others. For rbl, we can put it in mta level or in MailScanner. For example, we can put a safe rbl (which almost ONLY block spam) in mta level, and we put more agressive rbl in mailscanner. Very flexible.

You can configure MailScanner in most known mta server, like sendmail, postfix and exim. It very easy to install, my first try take me about 2 hours. And the server is up and running.
With the default configuration, it more than enough. to handle spam, but you tweak it if you like. The configuration is self explain, very easy to understand.

Conclusion.
MailScanner it a very usefull software. If you are a mail administrator, its a must. The features is more powerfull than most paid software.

I will write more about mailscanner, very interesting software.
You can learn more about mailscanner at http://www.mailscanner.info

Friday, January 5, 2007

A great place to blog.

Ok, just create an account in blogger.com. I think this will be great place to post tips and tricks about lotus notes/domino. Later I will create a link from my website whic is http://www.indomino.net to this blog, and vise versa.

Template Designed by Douglas Bowman - Updated to Beta by: Blogger Team
Modified for 3-Column Layout by Hoctro