summary FAQ
About this article
- It's part of PuffyMail Tutorial (OpenBSD Mail Server Solution).
- Author: Zhang Huangbin (michaelbibby (at) gmail.com).
Postfix
How to add a new domain and new user?
Two methods:
- Use PuffyMail shell script to do this:
```
cd puffymail/tools/
sh create_mail_ldap_user.sh example.com www
``` * It will create a virtual domain: example.com * Then create a user: www@example.com
- Use phpLDAPadmin
- Login to phpLDAPadmin
- Expand LDAP tree in left frame
The following steps will create a virtual domain: example.com.
- Click 'Create new entry here' under 'o=domains' to create a new virtual domain
- Choose 'Custom' in right frame and click 'Proceed'
RDN: o=example.com Container: o=domains,dc=openbsdonly,dc=org ObjectClasses: organization
The following steps will create a virtual user: www@example.com.
- Click 'Create new entry here' under 'o=example.com' in left frame
- Choose 'Custom' in right frame and click 'Proceed'
```
in Page 1
RDN: mail=www@example.com Container: o=example.com,o=domains,dc=openbsdonly,dc=org ObjectClasses: inetOrgPerson, qmailUser
in Page 2
cn: www # This is 'Comman Name' mail: www@example.com sn: www # SurName uid: www # User ID
in Page 2, 'Optional Attributes'.
Use the drop-down menu to select the LDAP attrs.
accountStatus: active # Value: active, disable userPassword: your_password homeDirectory: /home/vmail/domains # $HOME of 'vmail' user mailMessageStore: example.com/www/Maildir/ # Domain_Name/User_Name/Maildir/ mailQuota: 1024000S # Mail Quota. ```
OpenLDAP
How to start and stop OpenLDAP?
- Stop OpenLDAP:
```
kill $(cat /var/run/openldap/slapd.pid)
```
- Start OpenLDAP:
```
cat /etc/rc.conf.local |grep openldap_flags
openldap_flags='-h ldap://127.0.0.1:389/ -u _openldap -g _openldap'
/usr/local/libexec/slapd -h ldap://127.0.0.1:389/ -u _openldap -g _openldap
```
How to debug OpenLDAP
Change loglevel in '/etc/openldap/slapd.conf':
loglevel 256 # default is: 0.
Restart OpenLDAP.
Monitor the log file: ```
tail -f /var/log/openldap
```
ClamAV
How to disable automatic freshclam update?
- Disable freshclam during system boot:
```
File: /etc/rc.conf.local
freshclam_flags='-d -c 2'
freshclam_flags=NO ```
- Kill the daemon:
```
kill $(cat /var/run/clamav/freshclam.pid
```
If you want to run freshclam manually, just type 'freshclam' in command line: ```
freshclam
```
spamd(8) & PF
Where's spamd(8)'s log file?
Default file is:
/var/log/daemon
For more details, check the manual page: spamd(8).
How to debug PF rules?
It is descripted in PF FAQ: * PF: Logging
How do i control spamd(8) whitelist/blacklist?
- Show whitelist in spamd(8):
```
pfctl -t spamd-white -T show
```
- Add/delete a client into whitelist host via pfctl:
```
pfctl -t spamd-white -T add 192.168.1.3
pfctl -t spamd-white -T delete 192.168.1.3
```
For more details, please read PF FAQ: * Manipulating with pfctl
SquirrelMail
about Global LDAP Address Book
Global LDAP Address Book is enabled by default. But it can list all virtual users in your LDAP tree, not only the user in the same domain.
Because it will bind as this dn be default:
cn=vmail,dc=openbsdonly,dc=org
It can search the LDAP tree which stored all virtual domains and users. So, it's NOT recommended while you host virtual domains.
How to add a new plugin and enable it by default?
Add variable in 'conf/squirrelmail', such as:
PLUGIN_CHECK_QUOTA_TARBALL="check_quota-2.2-1.4.0.tar.gz"
Add URL in 'pkgs/misc_list' to fetch plugin, such as: ```
Check Quota.
http://www.squirrelmail.org/plugins/${PLUGIN_CHECK_QUOTA_TARBALL} ```
while you execute script 'pkgs/get_all.sh', it will be downloaded automatic.
Write function(s) to do the following steps.
You can follow the rest steps to install and enable plugin after SquirrelMail has been installed successfully:
- extract the source tarball
- copy to squirrelmail plugin directory
- configure it
Enable it by set the plugin name in file 'conf/squirrelmail':
ENABLED_PLUGINS="calendar change_ldappass compatibility check_quota select_language"