sample sieve filter in SunONE Messaging Server 5

2 – imsimta refresh
3 – should work – imsimta test -rewrite -filter [email protected] If you look at RFC 3028, you could get a better understanding of the
language. Example of imta.filter file:
require “envelope”;
require [“reject”]; if header :contains “From” “[email protected]
{
reject “[email protected]”;
} if envelope :contains “From” “[email protected]
{
discard;
} if header :contains “Subject” “$$$” {
reject “I don’t want your mail!”;
} if header :contains “To” “Undisclosed Recipients” {
reject “I don’t want your mail!”;
} require “fileinto;
if header :contains “To” “Undisclosed Recipients” {
fileinto “SPAM”;
}]]>

How to change Admin Server user in SunONE Directory Server 5

How to change user for Admin Server

Problem Statement:

S1DS 5.2(compressed archive) does not offer the option of specifying the

owner of the admin server during installation. When you specify

non-privilege user, such as nobody, for directory server, admin server is

also running as same non-privilage user as well as directory server.

Therefore, if you specify privilege port in unix (<1024) for the directory server, this will result in not being able to start / restart the directory server instance via the console. Troubleshooting Steps: If admin server is running as user except for root, you can't change the user for admin server via cosole. Here is a steps to change user for Admin server by hand. ** admin server should be stopped before conducting this procedure, but ns-slapd for configuration instance should be on-line. 1. change directive named 'User' in ServerRoot/admin-serv/config/magnus.conf to 'root' by text editor. 2. change file owner under ServerRoot/admin-serv to user you want as follows a. # cd /admin-serv

b. # chown -R root *

3. change attribute ‘nsSuiteSpotUser’ of admin server configuration entry

in your Directorty Server like

dn: cn=configuration, cn=admin-serv-, cn=Administration

Server, cn=Server Group, cn=, ou=, o=NetscapeRoot

to the user you want to change to.

For example) in case of using ldapsearch

a. do the following ldapsearch to determine target entry

#./ldapsearch -p -h -D “cn=Directory Manager” -w -b o=NetscapeRoot -s sub “nsSuiteSpotUser=*” dn nsSuiteSpotUser

dn:cn=configuration, cn=admin-serv-test, cn=Administration Server,

cn=Server Group,cn=test.example.com, ou=example.com, o=NetscapeRoot

nsSuiteSpotUser=nobody

#

b. modify usr in attribute nsSuiteSpotUser of this entry to ‘root’

# ldapmodify -p -D “cn=Directory Manager” -w dn: cn=configuration, cn=admin-serv-test, cn=Administration Server,

cn=Server Group, cn=test.example.com, ou=example.com, o=NetscapeRoot

changetype: modify

replace: nsSuiteSpotUser

nsSuiteSpotUser: root

modifying entry cn=configuration, cn=admin-serv-test,

cn=Administration Server, cn=Server Group, cn=test.example.com,

ou=example.com, o=NetscapeRoot

^D

#

you can also do same modification via directory TAB in directory

server console.

How to disable SSL in SunONE directory server

Problem Statement: What can happen if you delete your certificates and forget to disable
encryption on your ldap server is that your directory server will not
start the next time you go to restart it. Resolution: What can happen if you delete your certificates and forget to disable
encryption on your ldap server is that your directory server will not
start the next time you go to restart it. Here’s how it looks:
bash-2.05# ./start-slapd
Enter PIN for Internal (Software) Token:
Server not running!! Failed to start ns-slapd process. tail /logs/errors
[24/Apr/2004:12:31:48 -0700] – Sun-ONE-Directory/5.2 B2003.143.0020 (32-
bit) starting up
[24/Apr/2004:12:31:48 -0700] – WARNING<4753> – SSL – conn=-1 op=-1 msgId=-
1 – Security Initialization: Can’t find certificate (server-cert) for
family cn=RSA,cn=encryption,cn=config (error -5978 – Network file
descriptor is not connected.)
[24/Apr/2004:12:31:48 -0700] – WARNING<4754> – SSL – conn=-1 op=-1 msgId=-
1 – Security Initialization: Unable to retrieve private key for cert
server-cert of family cn=RSA,cn=encryption,cn=config (error -5978 –
Network file descriptor is not connected.)
[24/Apr/2004:12:31:48 -0700] – ERROR<4756> – SSL – conn=-1 op=-1 msgId=-1 –
None of the cipher are valid.
[24/Apr/2004:12:31:48 -0700] – DEBUG – conn=-1 op=-1 msgId=-1 – SSL
socket import or configuration failed.
[24/Apr/2004:12:31:48 -0700] – DEBUG – conn=-1 op=-1 msgId=-1 – Failed
to init daemon To fix this, open the /config/dse.ldif and change
nsslapd-security: on
to:
nsslapd-security: off Then, restart the directory server.]]>

How to run SunONE directory server as a diff (unix) user.

Description: Directory server 5.2 may have trouble in configuring itself on installation
if you set the server to run as another user. Here’s the workaround. Document Body: Directory server 5.2 may have trouble in configuring itself on installation
if you set the server to run as another user. Here are sample error messages you will get on installation: Created new Directory Server
Start Slapd Starting Slapd server configuration.
Fatal Slapd Missing configuration file
/opt/app/sunone/dir5_2/setup/slapd/slapd.inf
Configuration of the Directory Server failed.
Error Directory Server configuration failure Here’s the workaround. cd
slapd-/stop-slapd
find slapd- | xargs chown the_right_user
edit slapd-/config/dse.ldif
replace nsslapd-localuser line with:
nsslapd-localuser: the_right_user
slapd-/start-slapd Now you have a directory server that should be started by root or through
the admin server and run as “the_right_user”]]>

Reload/restore replication in SunONE Directory Server 5.1

2.On all hosts, remove replication state.
– Use Console disable the replica role for userRoot.
– If a master, delete the changelog associated with the userRoot database
– restart the slapd process. 3.Reinitialize primary master with it’s own data, stripped of replication state
– invoke an in-line db2ldif dump, without the ( -r ) switch
– stop slapd
– classic ldif2db using the dump just created to rebuild database
– start slapd, validate basic serviceability 4.Configure Replication on master 1
– Use console to enable/ configure a changelog for userRoot
– Enable replication in a multi master role 5.Prepare seed LDIF
– invoke and in-line db2ldif dump, USING the ( -r ) switch. Confirm that ldif carries replication state data.
– Copy the seed LDIF to consumer (master 2) 6.Enable replication on master 2
– Enable / configure a changelog for userRoot
– Enable replication in a multi-master role
– stop slapd
– classic ldif2db import using the seed ldif from master1
– start slapd (master 2), validate basic serviceability 7.Test functional replication , both ways, master1 <-> master 2]]>

Postfix install notes

make -f Makefile.init makefiles “CCARGS=-DUSE_SASL_AUTH -DHAS_PCRE -DHAS_LDAP -I/usr/include -I/usr/include/pcre -I/usr/include/sasl” “AUXLIBS=-L/usr/lib -lpcre -lldap -L/usr/local/lib -llber -lsasl2” clam install
./configure –enable-milter –prefix=/usr –sysconfdir=/etc –localstatedir=/var –mandir=/usr/share/man/ general install
./configure –bindir=/usr/bin –mandir=/usr/share/man –includedir=/usr/include –sbindir=/usr/sbin –sysconfdir=/etc –localstatedir=/var]]>

DSPAM install notes

with-mysql-includes=/usr/local/include/mysql –with-mysql-libraries=/usr/local/lib/mysql
./configure –bindir=/usr/bin –sbindir=/usr/sbin –enable-whitelist –enable-source-address-tracking\
–with-userdir=/var/dspam –with-logdir=/var –sysconfdir=/etc –prefix=/usr –localstatedir=/var\
–with-userdir-owner=amavisd –mandir=/usr/share/man –libexecdir=/usr/libexec –datadir=/usr/share\
–with-userdir-group=amavisd \
–with-dspam-owner=amavisd \
–with-dspam-group=amavisd \
–with-dspam-mode=4510 \
–with-local-delivery-agent=/usr/sbin/sendmail \
–with-storage-driver=mysql_drv \
–with-mysql-includes=/usr/include/mysql \
–with-mysql-libraries=/usr/lib/mysql \
–enable-alternative-bayesian \
–disable-trusted-user-security \
–enable-opt-in \
–enable-large-scale \
–enable-virtual-users \
–enable-long-usernames \
–enable-debug –enable-robinson –enable-robinson-pvalues –enable-neural-networking
./configure –with-ldap –bindir=/usr/bin –mandir=/usr/share/man –includedir=/usr/include –sbindir=/usr/sbin –sysconfdir=/etc –localstatedir=/var –prefix=/usr –with-group=amavisd –with-user=amavisd –with-dbdir=/var/clamav/
mkdir /var/dspam/opt-in
chown -R amavisd:amavisd /var/dspam/opt-in 1028 mkdir /var/dspam
1029 chown -R amavisd:amavisd /var/dspam/
1030 ls -l /var/dspam/
1031 ls -ld /var/dspam/
1032 service mysqld start
1033 service mysql start
1034 ps -ef
1035 mysql -e “create database dspam”
1036 mysql -e “grant all on dspam.* to dspam@localhost identified by ‘DSPAMPASS'”
1037 ls
1038 cd dspam-3.2.1/tools.mysql_drv/
1039 mysql dspam < mysql_objects-4.1.sql
1040 mysql dspam < mysql dspam < virtual_users.sql
1041 mysql dspam < mysql dspam < virtual_users.sql
1042 mysql dspam < virtual_users.sql
1043 vi /var/dspam/mysql.data
1044 chown amavisd:amavisd /var/dspam/mysql.data
1045 chmod 440 /var/dspam/mysql.data
1046 tail -f /var/log/mail/info
1047 bg
1048 service amavisd restart
1049 service amavisd stop
1050 amavisd debug
1051 service amavisd start
1052 dspam_stats
1053 vi /etc/dspam.conf
1054 dspam_stats
1055 netstat -apn | grep mysql
1056 vi /etc/dspam.conf
1057 dspam_stats]]>

How to share Windows to Linux (mount Windows share)

1) Create the Windows share on the Windows box.
2) Log into linux as root. Then type “smbclient -L
You’ll get some output like this:
# smbclient -L 10.16.8.210
added interface ip=10.16.80.1 bcast=10.16.95.255 nmask=255.255.240.0
Password:
Anonymous login successful
Domain=[OFFICE] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager] Sharename Type Comment
——— —- ——-
IPC$ IPC Remote IPC
print$ Disk Printer Drivers
shareddocs Disk
tmp Disk Temporary file space 3) With this, you’ll have the share names.
4) To mount, you can run:
mount -t smbfs -o username=nobody,password=”” //10.16.8.210/tmp /mnt
5) ls -l /mnt
You should see the files there.]]>

How to remove hidden devices from Windows

Properties > Hardware > Device Manager) Microsoft addresses this issue in their Knowledge Base article 269155, which is available at the time of this writing at: http://support.microsoft.com/kb/269155 To resolve this problem, follow these steps to remove fancy undetected devices in the Device Manager and uninstall them from the registry: 1. Select Start> Run.
2. Enter cmd.exe and press Enter.
3. At the command prompt, run this command: set devmgr_show_nonpresent_devices=1 4. Enter Start DEVMGMT.MSC and press Enter to start Device Manager.
5. Select View > Show Hidden Devices.
6. Expand all trees – you can just press “*” from the keypad on the “My Computer”
7. Right-click the dimmed items, and then select Uninstall.
8. Close Device Manager and reboot.]]>