Re: The end of Dovecot Director?

2022-10-21 Thread Zhang Huangbin



> On Oct 21, 2022, at 5:51 PM, Zhang Huangbin  wrote:
> 
> If mailbox is in Maildir format (and stored on shared storage like NFS), 
> accessing it from different server may corrupt Dovecot index files and 
> mailbox becomes unaccessible. Director perfectly avoids this issue.

To be clear: Accessing same mailbox from different IMAP servers __at the same 
time__.


Zhang Huangbin, founder of:
- iRedMail: Open source email server solution: https://www.iredmail.org/
- Spider: Lightweight, on-premises Email Archiving Software: https://spiderd.io



Re: The end of Dovecot Director?

2022-10-21 Thread Zhang Huangbin



> On Oct 21, 2022, at 5:23 PM, hi@zakaria.website wrote:
> 
> I was wondering if one can achieve the same implementation with haproxy 
> without dovecot director?

The most important part of Director is it makes sure same mail user always 
proxied to same backend IMAP server.

If mailbox is in Maildir format (and stored on shared storage like NFS), 
accessing it from different server may corrupt Dovecot index files and mailbox 
becomes unaccessible. Director perfectly avoids this issue.

HAProxy can proxy mail user from same client IP to same backend IMAP server, 
but not same mail user from different IPs.

Quote (https://doc.dovecot.org/admin_manual/director/dovecotdirector/):

"Director can be used by Dovecot’s IMAP/POP3/LMTP proxy to keep a temporary 
user -> mail server mapping. As long as user has simultaneous connections, the 
user is always redirected to the same server. Each proxy server is running its 
own director process, and the directors are communicating the state to each 
others. Directors are mainly useful for setups where all of the mail storage is 
seen by all servers, such as with NFS or a cluster filesystem."


Zhang Huangbin, founder of:
- iRedMail: Open source email server solution: https://www.iredmail.org/
- Spider: Lightweight, on-premises Email Archiving Software: https://spiderd.io



Re: The end of Dovecot Director?

2022-10-20 Thread Zhang Huangbin



> On Oct 21, 2022, at 4:19 AM, Antonio Leding  wrote:
> 
> My understanding is that Director is targeted toward large enterprise mail 
> installations that will incorporate several servers for a given function. In 
> such an environment, Director would be the fore-person\traffic-cop keeping 
> things organized & squared-away.

Director is used when you setup frontend servers in a load-balance cluster, 
proxy imap/pop3/lmtp/managesieve requests to backend Dovecot servers.

I setup load-balance cluster for clients with HAProxy + KeepAlived + Dovecot 
Director running in frontend servers, so sad we have to find an alternative to 
replace Director in such case.

It's not about "small/medium" servers, but the demand of imap/pop3/lmtp proxy 
service, especially in load-balance cluster.


Zhang Huangbin, founder of:
- iRedMail: Open source email server solution: https://www.iredmail.org/
- Spider: Lightweight, on-premises Email Archiving Software: https://spiderd.io



Re: last login plugins

2021-02-27 Thread Zhang Huangbin


> On Feb 27, 2021, at 7:32 PM, Aki Tuomi  wrote:
> 
> last_login supports some of the variables. 

Dear Aki,

Does last_login plugin support PostgreSQL now?

Old reports:

- https://marc.info/?t=15541153161=1=2
- https://marc.info/?t=15582632791=1=2

----
Zhang Huangbin, founder of iRedMail project: https://www.iredmail.org/



Re: LastLogin update

2019-06-22 Thread Zhang Huangbin via dovecot



> On Jun 23, 2019, at 4:43 AM, @lbutlr via dovecot  wrote:
> 
>> https://docs.iredmail.org/track.user.last.login.html
> 
> This is cool, but I have a question:
> 
>> For MySQL/MariaDB backends, we create the sql table in database vmail.
> 
> Would this interfere with or confuse postfixadmin? I use that so that users 
> can update their own passwords and domain admins can add users and aliases.

The document is for iRedMail, it supports storing mail accounts in SQL or 
OpenLDAP, that's why the document mentions the difference.
You're free to use any database on your own mail server.


Zhang Huangbin, founder of iRedMail project: https://www.iredmail.org/



Re: Dict issue with PostgreSQL for last_login plugin (duplicate key)

2019-05-29 Thread Zhang Huangbin via dovecot


> On May 29, 2019, at 2:01 PM, Aki Tuomi via dovecot  
> wrote:
> 
> We'll take this under consideration, but no promises.

Dear Aki,

I reported this issue and request before:
https://marc.info/?t=15541153161=1=2

Hope we can have this feature soon. :)
Thank you very much.



Re: Feature request: exclude IP/network in allow_nets extra field

2019-04-30 Thread Zhang Huangbin via dovecot



> On Apr 30, 2019, at 10:37 PM, andre via dovecot  wrote:
> 
> You can easily do this without a new feature in Dovecot.
> 
> - Create a post login script, for instance, in bash.
> - install grepcidr on your server.
> 
> Your post login script can use grepcidr to check for white or black list.
> 
> https://wiki.dovecot.org/PostLoginScripting

Dear Andre,

Thank you very much for the input.

Post login script should work as you suggested, but consider Dovecot already 
supports "allow_nets=a.b.c.d", we just need a mark like "!" to exclude some 
IP/networks, this might be the best and most elegant solution (if it can be 
implemented, of course), because we need only one userdb/passdb for all users, 
just different "allow_nets" for access control. Not one userdb/passdb for one 
each access policy.

Re: Feature request: exclude IP/network in allow_nets extra field

2019-04-30 Thread Zhang Huangbin via dovecot



> On Apr 30, 2019, at 2:35 PM, Sami Ketola via dovecot  
> wrote:
> 
> Just create another passdb for these premium users before the actual passdb 
> and add skip = authenticated to the actual passdb.

Dear Sami,

Thank you for the suggestion.

Adding more passdb is not ideal at all, if we have more access policies, we 
don't want to add more and more userdb/passdb.
Dovecot already supports syntax "allow_nets=a.b.c.d", we just need something 
like "!" mark to exclude some IP/networks.



Re: Feature request: exclude IP/network in allow_nets extra field

2019-04-30 Thread Zhang Huangbin via dovecot



> On Apr 30, 2019, at 2:32 PM, Malcolm via dovecot  wrote:
> 
> On 4/29/2019 11:20 PM, Zhang Huangbin via dovecot wrote:
>> I understand what "allow" means. But it will be very handy to support 
>> something like "!a.b.c.d" to allow all but just exclude few
>> IPs/networks. Isn't it? :)
> I'm not sure why:
> 
> iptables -A INPUT -p tcp --match multiport --syn ! -s a.b.c.d/netmask \
> --dports 110,143,993,995 -j REJECT

Dear Malcolm,

Thanks for your reply.
As mentioned earlier, this per-user access control, not for all users. This 
firewall rule blocks all users, not just few users.

Re: Feature request: exclude IP/network in allow_nets extra field

2019-04-30 Thread Zhang Huangbin via dovecot


> On Apr 30, 2019, at 11:21 AM, @lbutlr via dovecot  wrote:
> 
> On 29 Apr 2019, at 19:56, Zhang Huangbin via dovecot  
> wrote:
>> Recently we need to allow some users to login from everywhere except some 
>> IP/networks,
> 
> Can you use firewall rules for this?

I suppose not. We don't restrict ALL users this way, just few of them.
And the client IP addresses may change frequently, not static IPs.

>> how can we accomplish this with "allow_nets"?
> 
> Allow_nets specifies allowed networks. Doesn't say anything else about any 
> other use.
> 
> "The allow_nets field is a comma separated list of IP addresses and/or 
> networks where the user is allowed to log in from."

I understand what "allow" means. But it will be very handy to support something 
like "!a.b.c.d" to allow all but just exclude few IPs/networks. Isn't it? :)



Feature request: exclude IP/network in allow_nets extra field

2019-04-29 Thread Zhang Huangbin via dovecot
Dear all,

We use `allow_nets`[1] to restrict login clients, it works fine.
Recently we need to allow some users to login from everywhere except some 
IP/networks, how can we accomplish this with "allow_nets"?

Tried allow_nets="!a.b.c.d", but Dovecot reports error "allow_nets: Invalid 
network '!a.b.c.d'".

Can we have this feature?

i guess it should be done in function "auth_request_validate_networks"[2] in 
file src/auth/auth-request.c.

[1] allow_nets: https://wiki.dovecot.org/PasswordDatabase/ExtraFields/AllowNets
[2] 
https://github.com/dovecot/core/blob/fbc3ccc4a9a02b82073585a33254eacedc6a9950/src/auth/auth-request.c#L1990

Re: Possible bug with last_login plugin and PostgreSQL

2019-04-01 Thread Zhang Huangbin via dovecot


> On Apr 1, 2019, at 6:39 PM, Zhang Huangbin  wrote:
> 
> I'm trying to get last_login plugin working with PostgreSQL, but seems Dovecot
> doesn't handle duplicate key while updating last login time (note: same 
> setting
> works fine with MariaDB). I wonder whether it's a bug of Dovecot or i should 
> handle
> this with PostgreSQL trigger.

According to Dovecot source code[1], only MySQL has the "ON DUPLICATE KEY"
support, this is out of date because PostgreSQL has similar feature ("ON 
CONFLICT")[2]
since version 9.5. Also:

- Debian 9 ships PostgreSQL-9.6.
- Ubuntu 18.04 ships PostgreSQL-10.6.
- openSUSE tumbleweed ships PostgreSQL 10 and 11.
- Although CentOS 7 ships PostgreSQL 9.2 (NOT CAPABLE), but RHEL 8 public beta
  already ships PostgreSQL 9.6 and 10.
- OpenBSD 6.4 ships PostgreSQL 10.5, upcoming OpenBSD 6.5 ships PGSQL 11.2.
- FreeBSD ports tree offers PGSQL 9.5, 9.6.

Seems latest mainstream Linux/BSD distribution releases are all ok to use this
"ON CONFLICT" support, the question is, can we have this feature in Dovecot for 
PostgreSQL?

Thank you very much for the help. :)

BTW, SQLite has similar feature since version 3.24.0. 
https://www.sqlite.org/lang_UPSERT.html

[1] Dovecot source code: 
https://github.com/dovecot/core/blob/master/src/lib-dict-backend/dict-sql.c#L108
[2] PostgreSQL: "ON CONFLICT" Clause: 
https://www.postgresql.org/docs/9.5/sql-insert.html#SQL-ON-CONFLICT



Possible bug with last_login plugin and PostgreSQL

2019-04-01 Thread Zhang Huangbin via dovecot
Dear all,

I'm trying to get last_login plugin working with PostgreSQL, but seems Dovecot
doesn't handle duplicate key while updating last login time (note: same setting
works fine with MariaDB). I wonder whether it's a bug of Dovecot or i should 
handle
this with PostgreSQL trigger.

OS: OpenBSD 6.4 (amd64)
Dovecot: 2.2.36
PostgreSQL: 10.5

Error log:
###
Mar 31 11:15:21 ob dovecot: imap-login: Login: user=, 
method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=5936, TLS, 
session=<63/jV2CFhzt/AAAB>
Mar 31 11:15:21 ob dovecot: imap(postmas...@a.io): Logged out in=300 out=1604
Mar 31 11:15:21 ob dovecot: imap-login: Login: user=, 
method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=29797, TLS, 
session=
Mar 31 11:15:21 ob dovecot: dict(9584): Error: sql dict: commit failed: ERROR:  
duplicate key value violates unique constraint "last_login_pkey"
Mar 31 11:15:21 ob dovecot: dict: Error: DETAIL:  Key 
(username)=(postmas...@a.io) already exists.
Mar 31 11:15:21 ob dovecot: imap(postmas...@a.io): Error: dict-client: server 
returned failure: 1554023721 (reply took 0.012 secs)
Mar 31 11:15:21 ob dovecot: imap(postmas...@a.io): Error: last_login_dict: 
Failed to write value for user postmas...@a.io
Mar 31 11:15:21 ob dovecot: imap(postmas...@a.io): Logged out in=70 out=732
##

My Dovecot config:

###
protocol imap {
mail_plugins = ... last_login
...
}

protocol pop3 {
mail_plugins = ... last_login
...
}

plugin {
last_login_dict = proxy::lastlogin
#last_login_key = last-login/%u
...
}

dict {
lastlogin = pgsql:/etc/dovecot/dovecot-last-login.conf
...
}
###

SQL commands used to create PostgreSQL table:
###
CREATE TABLE last_login (
username VARCHAR(255) NOT NULL,
last_login INT DEFAULT NULL,
PRIMARY KEY (username)
);
###

File /etc/dovecot/dovecot-last-login.conf:
###
connect = host=127.0.0.1 port=5432 dbname=vmail user=vmailadmin 
password=

map {
pattern = shared/last-login/$user
table = last_login
value_field = last_login
value_type = uint

fields {
username = $user
}
}
##

Re: Director+NFS Experiences

2017-02-24 Thread Zhang Huangbin

> On Feb 25, 2017, at 3:28 AM, Mark Moseley <moseleym...@gmail.com> wrote:
> 
> Attached. No claims are made on the quality of my code :)

Thank you for sharing. :)

Some suggestions:

- should replace log() by the standard logging module like "logging.debug(xx)”
- add managesieve support
- add lmtp support
- how about store command line options in a config file? remove the ‘optparse’ 
module.
- email notification support when server is up/down
- lots of PEP8 style issue :)

Would you like to publish this code in github/bitbucket/…?


Zhang Huangbin, founder of iRedMail project: http://www.iredmail.org/
Time zone: GMT+8 (China/Beijing).
Available on Telegram: https://t.me/iredmail


Re: Director+NFS Experiences

2017-02-23 Thread Zhang Huangbin

> On Feb 24, 2017, at 6:08 AM, Mark Moseley <moseleym...@gmail.com> wrote:
> 
> * Do you use the perl poolmon script or something else? The perl script was
> being weird for me, so I rewrote it in python but it basically does the
> exact same things.

Would you mind sharing it? :)


Zhang Huangbin, founder of iRedMail project: http://www.iredmail.org/
Time zone: GMT+8 (China/Beijing).
Available on Telegram: https://t.me/iredmail


Re: Replacement for antispam plugin

2017-02-10 Thread Zhang Huangbin

> On Feb 11, 2017, at 12:50 AM, Ralph Seichter <dovecot...@seichter.de> wrote:
> 
> Check out https://wiki.dovecot.org/Pigeonhole/Sieve/Plugins/IMAPSieve,

My concern is, will you experience any lag while moving message?

According to the doc, this plugin works like “pipe” backend of old “antispam” 
plugin, when you move a message from INBOX to Junk, the antispam plugin calls 
sa-learn, and you will experience noticeable lag on webmail (i used Roundcube 
webmail for testing) until sa-learn finished. It's much worse if you move 
multiple emails at the same time, because we have to wait for sa-learn to learn 
all moved messages.

I switched to “spool2dir” backend of old “antispam” plugin, and call sa-learn 
hourly to learn spam/ham. Since it simply copies moved message(s), no lag on 
webmail side at all, our users are satisfied.


Zhang Huangbin, founder of iRedMail project: http://www.iredmail.org/
Time zone: GMT+8 (China/Beijing).


Re: Error while migrating mailbox with 'doveadm sync'

2016-12-18 Thread Zhang Huangbin

> On Dec 18, 2016, at 8:26 PM, Zhang Huangbin <z...@iredmail.org> wrote:
> 
> # doveadm -o mail_fsync=never sync -1 -R -s '' -u u...@domain.com imapc:
> dsync(u...@domain.com): Panic: file mailbox-alias-plugin.c: line 77 
> (mailbox_symlink_exists): assertion failed: (ret > 0)
> Abort trap

Checked IMAP folders on old server, this user has ‘.Sent’ and ‘.Sent Messages’ 
on old server, but ‘.Sent Message’ is configured to be a alias mailbox on new 
server. After merge 2 folders, then sync works fine.

Sorry about the noise.


Error while migrating mailbox with 'doveadm sync'

2016-12-18 Thread Zhang Huangbin
Dear all,

I successfully migrated hundreds of mailboxes with Dovecot 2.2.24 on OpenBSD
6.0 (amd64. Old server is OpenBSD 5.1, i386, Dovecot-2.0.17), but got error 
while
migrating 3 mailboxes:

# doveadm -o mail_fsync=never sync -1 -R -s '' -u u...@domain.com imapc:
dsync(u...@domain.com): Panic: file mailbox-alias-plugin.c: line 77 
(mailbox_symlink_exists): assertion failed: (ret > 0)
Abort trap

Same error while running ‘doveadm … backup …'.
What does this error actually mean? How can i fix it?

- Here’s full log running doveadm with ‘-D’ option: http://pastebin.com/Um5fbuNM
- ‘dovecot -n’ on old server: http://pastebin.com/4E6xzFKU
- ‘dovecot -n’ on new server: http://pastebin.com/4uHwQnMN

I checked release notes of Dovecot 2.2.25/26/27, there’re 3 fixes related to
'doveadm sync’, but not sure whether it helps fix this issue.

2.2.26:
+ doveadm sync/backup: Added -I  parameter to skip too large mails.
+ doveadm sync/backup: Fixed -t parameter and added -e for "end date”.

2.2.27:
- doveadm sync -1: Fixed handling mailbox GUID conflicts.


authentication failed: Connection lost to authentication server

2016-07-15 Thread Zhang Huangbin
Dear all,

I got error "authentication failed: Connection lost to authentication server", 
i turned on debug mode in Postfix/Dovecot, but this is the error i can get.

All other errors point to sasl auth failure, what does "connection lost to 
authentication server" means? How can i exactly know what the problem is and 
how to fix it?

Here's my Dovecot/Postfix configuration, with Active Directory integration.

- dovecot.conf: http://pastebin.com/7T05kvmH
- dovecot-ldap.conf: http://pastebin.com/DtkAg01v
- Postfix main.cf: http://pastebin.com/Z9Wihmvr

Dovecot/Postfix and AD are running in the same network (192.168.10.X), no 
firewall between them.

Thanks for your help. :)

Re: Dovecot and Solr 6

2016-07-07 Thread Zhang Huangbin

> On Jul 8, 2016, at 5:31 AM, KSB  wrote:
> 
> 1 argument is speed, what else?

Solr is built for indexing, what else do you expect?


Re: fts_solr not working

2016-06-23 Thread Zhang Huangbin

> On Jun 24, 2016, at 2:06 AM, Jeff Gamsby <jeffgam...@merlock.com> wrote:
> 
> protocol imap {
>  plugin {
>fts = solr
>fts_solr = break-imap-search url=http://localhost:8880/solr/
>  }
> }
> protocol pop3 {
>  plugin {
>fts = solr
>fts_solr = break-imap-search url=http://localhost:8880/solr/
>  }

Don't place `plugin {}` setting in other config block.

It should be:

protocol imap {...}
protocol pop3 {...}
plugin {
...
}


Zhang Huangbin, founder of iRedMail project: http://www.iredmail.org/
Time zone: GMT+8 (China/Beijing).


Re: fts_solr not working

2016-06-23 Thread Zhang Huangbin

> On Jun 24, 2016, at 2:06 AM, Jeff Gamsby <jeffgam...@merlock.com> wrote:
> 
> doveadm(u...@user.com): Debug: fts: No fts setting - plugin disabled

Isn't it very clear here?


Zhang Huangbin, founder of iRedMail project: http://www.iredmail.org/
Time zone: GMT+8 (China/Beijing).


Question: encrypt/decrypt with plugin mail_filter

2016-03-19 Thread Zhang Huangbin
Dear all,

I'm trying to encrypt/decrypt mail body with Dovecot plugin 'mail_filter':
http://wiki2.dovecot.org/Plugins/MailFilter

I wrote a Python script to read mail body and encrypt it, the 
encryption/decryption part is working as expected, but Dovecot always fail to 
write modified email on disk:

Error: Cached message size smaller than expected (1575 < 1644)
Error: Maildir filename has wrong S value, renamed the file from 
/var/vmail/domain.com/user/cur/1458165453.M632521P17600.c7.iredmail.org,S=1575:2,
 to 
/var/vmail/domain.com/user/cur/1458165453.M632521P17600.c7.iredmail.org,S=1575:2,
Error: Corrupted index cache file 
/var/vmail/domain.com/user/dovecot.index.cache: Broken physical size for mail 
UID 4
Error: read() failed: Invalid argument (uid=4)

I know this behave is clearly explained in Dovecot wiki page, the question is, 
is there any way to overcome this and let Dovecot correctly handle the 
encrypted/decrypted mail?

Thanks. :)

Re: [Dovecot] v2.1.16 released

2013-04-05 Thread Zhang Huangbin


On Friday, April 5, 2013 at 5:16 AM, Timo Sirainen wrote:

 + Added quota-status policy service for Postfix
 


Found quota-status related settings in Dovecot-2.2 commit log here:
http://hg.dovecot.org/dovecot-2.2/rev/980be1dc80c2



[Dovecot] Custom LDAP filter for doveadm-mailbox?

2012-04-19 Thread Zhang Huangbin
Dear Timo, 

With Dovecot-2.0.16, 'doveadm mailbox list -A' will perform LDAP search with 
filter (objectClass=posixAccount), and get value of attribute 'uid' as mail 
user. Is it possible to custom the ldap filter and returned attribute name? For 
example:

- LDAP filter: ((objectClass=mailUser)(accountStatus=active))
- Returned attribute name: mail

Did i miss something?

Thanks. 


Zhang Huangbin

iRedMail: Open Source Mail Server Solution for Red Hat Enterprise Linux,
CentOS, Scientific Linux, Debian, Ubuntu, Mint, Gentoo, openSUSE,
FreeBSD: http://www.iredmail.org/




Re: [Dovecot] Custom LDAP filter for doveadm-mailbox?

2012-04-19 Thread Zhang Huangbin


On Thursday, April 19, 2012 at 11:44 PM, Timo Sirainen wrote:

 See iterate_* settings in example dovecot-ldap.conf.ext.


It works as expected. Thanks. :)


Zhang Huangbin

iRedMail: Open Source Mail Server Solution for Red Hat Enterprise Linux,
CentOS, Scientific Linux, Debian, Ubuntu, Mint, Gentoo, openSUSE,
FreeBSD: http://www.iredmail.org/





Re: [Dovecot] Web Based User Management

2011-01-16 Thread Zhang Huangbin

On Jan 15, 2011, at 4:14 AM, Matt wrote:

 Does anyone know of a web GUI type application that would allow the
 creation and deletion of email accounts on an email server?

You can also try iRedMail bundle and iRedAdmin web-based admin panel, supports
both OpenLDAP and MySQL:
http://www.iredmail.org/

[Dovecot] Share: How to share IMAP folder with Dovecot and Roundcube webmail

2011-01-16 Thread Zhang Huangbin
Hi, all.

I achieved mailbox sharing with Dovecot  Roundcube webmail in iRedMail[1]
today, just want to share you my experience, hope it helps. Although it's for
iRedMail, but it doesn't depend on it.

http://www.iredmail.org/wiki/index.php?title=IRedMail/FAQ/Share.IMAP.Folder

It describes:
- How to enable mailbox sharing in Dovecot
- How to enable mailbox sharing in Roundcube webmail.
- How to test mailbox sharing with telnet

Requirements:
- Dovecot = 1.2
- Roundcube webmail = 0.5 -stable release

[1] iRedMail - Free, Open Source Email Server Solution: http://www.iredmail.org/


Re: [Dovecot] Centos 5.5 upgrade to dovecot 1.2

2010-12-05 Thread Zhang Huangbin

On Dec 6, 2010, at 7:00 AM, Agim Cami wrote:

 error: Failed dependencies:
 libpq.so.5()(64bit) is needed by dovecot-1.2.16-1_114.el5.x86_64

Upgrade postgresql-libs to the latest version and it should work.

-- 
Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu, OpenSuSE, FreeBSD: http://www.iredmail.org/



Re: [Dovecot] Is it possible to change service name of managesieve service?

2009-12-15 Thread Zhang Huangbin

On Dec 14, 2009, at 4:14 PM, Timo Sirainen wrote:

 On Dec 14, 2009, at 3:08 AM, Zhang Huangbin wrote:
 
 With LDAP, i simiplily add two more values:
 
 
 enabledService: sieve
 enabledService: sievesecured
 
 
 Is the sievesecured intentional? %s expands only to sieve, but %s%c could 
 also expands to sievesecured.

Yes, i use '%s%c' in dovecot-ldap.conf. :)

-- 
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu: http://www.iredmail.org/



Re: [Dovecot] Is it possible to change service name of managesieve service?

2009-12-14 Thread Zhang Huangbin

On Dec 12, 2009, at 9:57 AM, Timo Sirainen wrote:

 On Dec 11, 2009, at 8:26 PM, Zhang Huangbin wrote:
 
 In dovecot-1.2, managesieve is identified as 'sieve' service while use 
 '%s'[1] in dovecot. Is it possible to change it? Because we store it in 
 SQL/LDAP as 'managesieve' service name, we don't want to change this.
 
 No. Also sieve is the official name for it, so it's not going to be 
 changed. http://www.iana.org/assignments/gssapi-service-names

OK.

 With SQL you could of course use some replace function in the SQL query. With 
 LDAP .. is it possible to do *%s?

With LDAP, i simiplily add two more values:


enabledService: sieve
enabledService: sievesecured


-- 
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu: http://www.iredmail.org/



[Dovecot] Is it possible to change service name of managesieve service?

2009-12-11 Thread Zhang Huangbin
Hi, list.

In dovecot-1.2, managesieve is identified as 'sieve' service while use '%s'[1] 
in dovecot. Is it possible to change it? Because we store it in SQL/LDAP as 
'managesieve' service name, we don't want to change this.

Thanks

[1] http://wiki.dovecot.org/Variables

-- 
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu: http://www.iredmail.org/



Re: [Dovecot] Post login script issue with pop3 protocol

2009-11-03 Thread Zhang Huangbin


On Nov 4, 2009, at 2:42 AM, Timo Sirainen wrote:


Looks like it writes some error message to POP3 session.

1) Did you look at Dovecot's error log yet to see if this script  
logged

something?


No error logs in dovecot log file.

All logs during the telnet testing session:

dovecot: Nov 03 20:45:45 Info: pop3-login: Disconnected (no auth  
attempts): rip=192.168.187.1, lip=192.168.187.128
dovecot: Nov 03 20:45:51 Info: pop3-login: Login: user=w...@a.cn,  
method=PLAIN, rip=192.168.187.1, lip=192.168.187.128
dovecot: Nov 03 20:46:08 Info: POP3(w...@a.cn): Disconnected: Logged  
out top=0/0, retr=1/1453, del=0/1, size=1436




2) Log in with telnet to see what exactly it's writing.
http://wiki.dovecot.org/TestPop3Installation


It seems works fine:

$ telnet r6 110
Trying 192.168.187.128...
Connected to r6.
Escape character is '^]'.
+OK Dovecot ready.
user w...@a.cn
+OK
pass www
+OK Logged in.
modifying entry  
mail=...@a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org


stat
+OK 1 1436
retr 1
+OK 1436 octets
Mail content here


After telnet testing, i use Thunderbird to test it again, but it  
failed with same error message i posted in previous mail:


The STAT command did not succeed. Error getting message number and  
sizes.

Mail server r6.iredmail.org responsed: ying entry
mail=...@a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org


Is it OK?

--
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu: http://www.iredmail.org/



[Dovecot] Post login script issue with pop3 protocol

2009-10-31 Thread Zhang Huangbin

Hi, all.

I want to track user last login data (ip address, login date, etc)  
with dovecot, followed dovecot tutorial[1], and it now works with  
IMAP, but failed with POP3. i don't know why.


My script:

LDAP_URI='ldap://127.0.0.1:389'
LDAP_BASEDN='o=domains,dc=iredmail,dc=org'
BIND_DN='cn=vmailadmin,dc=iredmail,dc=org'
BIND_PW='plain_passwd'

if [ X${USER} != Xdump-capability ]; then
ldapmodify -c -x \
-H ${LDAP_URI} \
-D ${BIND_DN} \
-w ${BIND_PW} EOF
dn: mail=${USER},ou=Users,domainName=$(echo ${USER} | awk -F'@'  
'{print $2}'),${LDAP_BASEDN}

changetype: modify
replace: lastLoginDate
lastLoginDate: $(date +%Y%m%d%H%M%SZ)
-
replace: lastLoginIP
lastLoginIP: ${IP}
-
replace: lastLoginProtocol
lastLoginProtocol: pop3
EOF

fi


It works with IMAP protocol, but failed with POP3 protocol.
Error msg in Thunderbird:

The STAT command did not succeed. Error getting message number and  
sizes.

Mail server r6.iredmail.org responsed: ying entry
mail=...@a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org


[1] Post-login scripting: http://wiki.dovecot.org/PostLoginScripting

--
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu: http://www.iredmail.org/



Re: [Dovecot] Best way to get login protocol (pop3/imap) in post-login script

2009-08-03 Thread Zhang Huangbin


On Aug 3, 2009, at 9:47 AM, Timo Sirainen wrote:


How about giving the imap or pop3 as parameter? You're already  
modifying

mail_executable, so:

protocol imap {
 mail_executable = script.sh imap
}
protocol pop3 {
 mail_executable = script.sh pop3
}



It works with above setting. Thanks Timo :)

--
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu:
  + http://code.google.com/p/iredmail/
  + http://www.iredmail.org/forum/



[Dovecot] Best way to get login protocol (pop3/imap) in post-login script

2009-08-01 Thread Zhang Huangbin

Hi, all.

I found doc here: http://wiki.dovecot.org/PostLoginScripting
and use ${USER}, ${IP} to track last-login username and remote ip  
address, but how can i track the mail protocol it used? like pop3,  
pop3s, imap, imaps?


Currently, i wrote shell script as post-login script, and use below  
command to get protocol:



$(basename ${MAIL_PLUGIN_DIR})


But is it the best way to get it?

Thanks very much. :)

--
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
 CentOS, Debian, Ubuntu:
 + http://code.google.com/p/iredmail/
 + http://www.iredmail.org/forum/


Re: [Dovecot] problem with mail_location

2009-07-04 Thread Zhang Huangbin


On Jul 4, 2009, at 8:22 PM, etor...@dap.es wrote:


I have:

mail_location = maildir:/var/dovecot-mail/%d/%n/Maildir


but on my /var/dovecot-mail have following directory created:

-domain
-domain.
-domain.es (only this is correct)
-DOMAIN.ES

Why is this happening?



You should set 'mail_debug = yes' in dovecot.conf, and you will find  
out why in its log file.


--
Best Regards.

Zhang Huangbin

- Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
  CentOS, Debian, Ubuntu:
  + http://code.google.com/p/iredmail/
  + http://www.iredmail.org/forum/



Re: [Dovecot] help with ldap config

2009-04-12 Thread Zhang Huangbin

Ricardo Kleemann wrote:

user_filter = ((objectClass=posixAccount)(uid=%u,ou=%d))


Do you mean '((objectClass=posixAccount)(uid=%u)(ou=%d))'? or 
'((objectClass=posixAccount)(uid=%u))'?


Or you can just use '(objectClass=posixAccount)' for test.


--
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



[Dovecot] How can i override mail_location?

2009-03-13 Thread Zhang Huangbin

Hi, all.

I use dovecot-1.1.11 with OpenLDAP backend. but i found the
mail_location is not correct. How can i override mail_location setting
in dovecot.conf?

LDAP user data and dovecot config are attached below. in dovecot config,
mail_location is:

mail_location = maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/


but the correct maildir should be 'homeDirectory' + 'mailMessageStore':

maildir:/home/vmail/a.cn/w/ww/www/


LDAP user:

dn: mail=...@a.cn,ou=Users,domainName=a.cn,o=domains,dc=iredmail,dc=org
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: top
cn: www
sn: www
uid: www
mail: w...@a.cn
accountStatus: active
homeDirectory: /home/vmail
mailQuota: 104857600
userPassword: {SSHA}crkYO5tg8KRkOY7W3bRgjtLQ+79U4NgG
enabledService: mail
enabledService: smtp
enabledService: pop3
enabledService: imap
enabledService: deliver
mailMessageStore: a.cn/w/ww/www/


Dovecot ldap config file:

user_attrs  = 
homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$



Dovecot main config file:

# dovecot -n
# 1.1.11: /etc/dovecot.conf
# OS: Linux 2.6.18-128.el5 x86_64 Red Hat Enterprise Linux Server 
release 5.3 (Tikanga)

log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps
listen: *
ssl_cert_file: /etc/pki/iRedMail/SSL_Cert.pem
ssl_key_file: /etc/pki/iRedMail/SSL_Key.pem
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
mail_uid: 500
mail_gid: 500
mail_location: maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/
mail_debug: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota zlib
mail_plugins(imap): quota imap_quota zlib
mail_plugins(pop3): quota zlib
mail_plugin_dir(default): /usr/lib64/dovecot/imap
mail_plugin_dir(imap): /usr/lib64/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 mechanisms: plain login
 default_realm: a.cn
 user: vmail
 passdb:
   driver: ldap
   args: /etc/dovecot-ldap.conf
 userdb:
   driver: ldap
   args: /etc/dovecot-ldap.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/dovecot-auth
 mode: 438
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 438
 user: vmail
 group: vmail
plugin:
 quota: maildir
 quota_rule: *:storage=10M
 expire: Trash 7 Trash/* 7 Junk 30
 expire_dict: proxy::expire
 auth_socket_path: /var/run/dovecot/auth-master
 sieve: /home/vmail/sieve/%Ld/%Ln/.dovecot.sieve
dict:
 expire: db:/var/lib/dovecot/expire/expire.db


--
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



Re: [Dovecot] How can i override mail_location?

2009-03-13 Thread Zhang Huangbin

Thanks Steffen. :)

Steffen Kaiser wrote:

mailMessageStore=maildir:mail

this looks odd. Try:

mailMessageStore=mail



If i use absolute path in mailMessageStore, the maildir path is correct 
with 'mailMessageStore=mail', but deliver doesn't create the directory 
recursively:


deliver(w...@a.cn): Mar 14 09:42:33 Info: auth input: home=/home/vmail
deliver(w...@a.cn): Mar 14 09:42:33 Info: auth input: 
quota_rule=*:bytes=104857600
deliver(w...@a.cn): Mar 14 09:42:33 Info: auth input: 
mail=/home/vmail/a.cn/w/ww/www/
deliver(w...@a.cn): Mar 14 09:42:33 Info: auth input: 
sieve_dir=/home/vmail/sieve/a.cn/www/
deliver(w...@a.cn): Mar 14 09:42:33 Info: Quota root: name= 
backend=maildir args=
deliver(w...@a.cn): Mar 14 09:42:33 Info: Quota rule: root= mailbox=* 
bytes=104857600 messages=0
deliver(w...@a.cn): Mar 14 09:42:33 Info: maildir autodetect: 
stat(/home/vmail/a.cn/w/ww/www//cur) failed: No such file or directory
deliver(w...@a.cn): Mar 14 09:42:33 Info: mbox autodetect: 
data=/home/vmail/a.cn/w/ww/www/
deliver(w...@a.cn): Mar 14 09:42:33 Info: mbox autodetect: INBOX file: 
stat(/home/vmail/a.cn/w/ww/www/) failed: No such file or directory
deliver(w...@a.cn): Mar 14 09:42:33 Info: mbox autodetect: has .imap/: 
stat(/home/vmail/a.cn/w/ww/www//.imap) failed: No such file or directory
deliver(w...@a.cn): Mar 14 09:42:33 Info: mbox autodetect: has inbox: 
stat(/home/vmail/a.cn/w/ww/www//inbox) failed: No such file or directory
deliver(w...@a.cn): Mar 14 09:42:33 Info: mbox autodetect: has mbox: 
stat(/home/vmail/a.cn/w/ww/www//mbox) failed: No such file or directory
deliver(w...@a.cn): Mar 14 09:42:33 Error: mail_location: Ambiguous mail 
location setting, don't know what to do with it: 
/home/vmail/a.cn/w/ww/www/ (try prefixing it with mbox: or maildir:)

deliver(w...@a.cn): Mar 14 09:42:33 Fatal: Namespace initialization failed


How can i solve this?

--
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



Re: [Dovecot] How can i override mail_location?

2009-03-13 Thread Zhang Huangbin

Timo Sirainen wrote:

On Fri, 2009-03-13 at 22:17 +0800, Zhang Huangbin wrote:
  

homeDirectory: /home/vmail



Is it always /home/vmail?
  


Yes, homeDirectory is always /home/vmail.

user_attrs  = 
homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$



Maybe mailMessageStore=maildir:/home/vmail/%$
  

I set it like this:

user_attrs  = 
homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:/home/vmail/%$,mailQuota=quota_rule=*:bytes=%$



It find the correct path, but deliver to path setting in mail_location:

deliver(w...@a.cn): Mar 14 09:49:31 Info: auth input: home=/home/vmail
deliver(w...@a.cn): Mar 14 09:49:31 Info: auth input: 
quota_rule=*:bytes=104857600
deliver(w...@a.cn): Mar 14 09:49:31 Info: auth input: 
maildir:/home/vmail/%$=/home/vmail/a.cn/w/ww/www/
deliver(w...@a.cn): Mar 14 09:49:31 Info: auth input: 
sieve_dir=/home/vmail/sieve/a.cn/www/
deliver(w...@a.cn): Mar 14 09:49:31 Info: Quota root: name= 
backend=maildir args=
deliver(w...@a.cn): Mar 14 09:49:31 Info: Quota rule: root= mailbox=* 
bytes=104857600 messages=0
deliver(w...@a.cn): Mar 14 09:49:31 Info: maildir: 
data=//home/vmail/a.cn/www/:INDEX=//home/vmail/a.cn/www/
deliver(w...@a.cn): Mar 14 09:49:31 Info: maildir++: 
root=//home/vmail/a.cn/www, index=, control=, inbox=//home/vmail/a.cn/www
deliver(w...@a.cn): Mar 14 09:49:31 Info: cmusieve: Using sieve path: 
/home/vmail/sieve/a.cn/www/.dovecot.sieve
deliver(w...@a.cn): Mar 14 09:49:31 Info: cmusieve: Executing script 
/home/vmail/sieve/a.cn/www/.dovecot.sievec
deliver(w...@a.cn): Mar 14 09:49:31 Info: msgid=49bb0d17.8070...@a.cn: 
saved mail to Junk



setting in dovecot.conf:

mail_location = maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/



Also home directory should be different for each user, so you most
likely don't want to set homeDirectory=home.
  

I will try to change this, thanks Timo :)

--
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



Re: [Dovecot] How can i override mail_location?

2009-03-13 Thread Zhang Huangbin

Timo Sirainen wrote:

On Fri, 2009-03-13 at 22:17 +0800, Zhang Huangbin wrote:
  

homeDirectory: /home/vmail



Is it always /home/vmail?

  
user_attrs  = 
homeDirectory=home,=sieve_dir=/home/vmail/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$



Maybe mailMessageStore=maildir:/home/vmail/%$

Also home directory should be different for each user, so you most
likely don't want to set homeDirectory=home.

  

hi, Timo.

Any suggestion about these LDAP attributes:

homeDirectory
mailMessageStore

Both are absolute path? like /home/vmail/a.cn/w/ww/www/ or what?

Need to add more attributes? How about mailbox INDEX?

--
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



[Dovecot] Performance issue about maildir path.

2008-12-14 Thread Zhang Huangbin

Hi, all.

Normally, i use 'domain.ltd/username/Maildir' as users' maildir path, if
i change them to hash style, e.g. 'A0/B0/domain.ltd/C0/D0/username/Maildir',
will it speed up the index operation for MDA? If we have 1 users,
which maildir path style will improve performance?

Thanks very much. :)

--
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/




[Dovecot] (v1.1.6) Fatal: userdb didn't return a home directory, but mail location used it (%h)

2008-11-06 Thread Zhang Huangbin

Hi, all.

I upgrade to 1.1.6, but the same config didn't work now.

Error message while start dovecot:


Starting Dovecot Imap: Fatal: userdb didn't return a home directory, but 
mail location used it (%h): /%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/

Error: imap dump-capability process returned 89
Fatal: Invalid configuration in /etc/dovecot.conf


Here is my dovecot.conf file and dovecot-ldap.conf:

# dovecot -n
# 1.1.6: /etc/dovecot.conf
# OS: Linux 2.6.18-92.el5 x86_64 Red Hat Enterprise Linux Server release 
5.2 (Tikanga)

log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps
listen: *
ssl_cert_file: /etc/pki/iRedMail/SSL_Cert.pem
ssl_key_file: /etc/pki/iRedMail/SSL_Key.pem
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
mail_uid: 2000
mail_gid: 2000
mail_location: maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/
mail_debug: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota zlib
mail_plugins(imap): quota imap_quota zlib
mail_plugins(pop3): quota zlib
mail_plugin_dir(default): /usr/lib64/dovecot/imap
mail_plugin_dir(imap): /usr/lib64/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 mechanisms: plain login
 default_realm: a.cn
 user: vmail
 passdb:
   driver: ldap
   args: /etc/dovecot-ldap.conf
 userdb:
   driver: ldap
   args: /etc/dovecot-ldap.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/dovecot-auth
 mode: 438
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 438
 user: vmail
 group: vmail
plugin:
 quota: maildir
 quota_rule: *:storage=10M
 expire: Trash 7 Trash/* 7 Junk 30
 expire_dict: proxy::expire
 auth_socket_path: /var/run/dovecot/auth-master
 sieve: /var/www/sieve/%Ld/%Ln/.dovecot.sieve
dict:
 expire: db:/var/lib/dovecot/expire/expire.db


dovecot-ldap.conf

hosts   = 127.0.0.1:389
ldap_version= 3
auth_bind   = yes
dn  = cn=vmail,dc=iredmail,dc=org
dnpass  = [EMAIL PROTECTED]29049*31446)15524
base= domainName=%d,o=domains,dc=iredmail,dc=org
scope   = subtree
deref   = never
user_filter = ((mail=%u)(objectClass=mailUser)(accountStatus=active))
pass_filter = (mail=%u)
pass_attrs  = userPassword=password
default_pass_scheme = CRYPT
user_attrs  = 
homeDirectory=home,=sieve_dir=/var/www/sieve/%Ld/%Ln/,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$




--
Best regards.

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



[Dovecot] Type error in wiki page: /Quota/1.1

2008-10-27 Thread Zhang Huangbin

Hi,

There should be an empty line between 'Subject' and mail body, otherwise
mail body won't be included.

An alternative script using deliver would be:

#!/bin/bash
PERCENT=$1
cat  EOF | /usr/local/libexec/dovecot/deliver -d $USER -c 
/usr/local/etc/dovecot-nowarning.conf

From: [EMAIL PROTECTED]
Subject: quota warning
Your mailbox is now $PERCENT% full.
EOF


Like this:

[...skip...]
Subject: quota warning

Your mailbox is now $PERCENT% full.
[...skip...]


Thanks.

--
Best regards.

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
 http://code.google.com/p/iredmail/



[Dovecot] dovecot-sieve-1.1.5 compile error

2008-09-22 Thread Zhang Huangbin

Hi, all.

I compiled and installed dovecot-1.1.3 with this cmd:

# ./configure --prefix=/usr/local/dovecot --disable-ipv6 --with-mysql 
--with-ldap --with-zlib --enable-header-install


Then compiled dovecot-sieve-1.1.5 with this cmd:

./configure --with-dovecot=/usr/local/dovecot/lib/dovecot

But i got this error msg:

stdout:1654: warning: no previous prototype for 'addrget_lineno'
stdout:1663: warning: no previous prototype for 'addrget_in'
stdout:1671: warning: no previous prototype for 'addrget_out'
stdout:1679: warning: no previous prototype for 'addrget_leng'
stdout:1688: warning: no previous prototype for 'addrget_text'
stdout:1697: warning: no previous prototype for 'addrset_lineno'
stdout:1709: warning: no previous prototype for 'addrset_in'
stdout:1714: warning: no previous prototype for 'addrset_out'
stdout:1719: warning: no previous prototype for 'addrget_debug'
stdout:1724: warning: no previous prototype for 'addrset_debug'
stdout:1758: warning: no previous prototype for 'addrlex_destroy'

How can i solve this issue? Thanks very much.



Re: [Dovecot] dovecot-sieve-1.1.5 compile error

2008-09-22 Thread Zhang Huangbin

Timo Sirainen wrote:

On Mon, 2008-09-22 at 16:05 +0800, Zhang Huangbin wrote:
  

Hi, all.

I compiled and installed dovecot-1.1.3 with this cmd:

# ./configure --prefix=/usr/local/dovecot --disable-ipv6 --with-mysql 
--with-ldap --with-zlib --enable-header-install


Then compiled dovecot-sieve-1.1.5 with this cmd:

./configure --with-dovecot=/usr/local/dovecot/lib/dovecot

But i got this error msg:

stdout:1654: warning: no previous prototype for 'addrget_lineno'
stdout:1663: warning: no previous prototype for 'addrget_in'
stdout:1671: warning: no previous prototype for 'addrget_out'



These aren't errors, they're warnings. And it's normal to get them.

  


Thanks Timo. :)



Re: [Dovecot] openbsd macppc

2008-07-23 Thread Zhang Huangbin

Scott Murman wrote:
 i run my server (web, email, calendar, etc.)  off a mac mini ppc.  
it's a beautiful thing for our modest needs (quiet, low power, stable), 
but i'm looking at switching it to a vanilla bsd.   has anyone tried 
dovecot on an openbsd (or similar) install for macppc?


 -SM-



Why not check OpenBSD ports tree to see whether all components you
need are build as binary packages? If they are there, try to install
and configure them to make them work together. :)

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux 
 CentOS 5.x: http://iRedMail.googlecode.com/



Re: [Dovecot] How can i get original mail subject in sieve vacation?

2008-07-20 Thread Zhang Huangbin

Timo Sirainen wrote:

On Sun, 2008-07-13 at 03:41 +0800, Zhang Huangbin wrote:
  

Hi, all.

I want to mix some new words and original mail subject as vacation
subject, how can i get original mail subject in sieve vacation?

Original subject: Hello.
Vacation subject: Auto-Reply msg: Hello.
  ^ New ^ ^Orig^



Yes, this would be a nice feature. But currently it's hard coded, so you
can't do it without modifying sources. Hopefully it is/will be
implemented in Stephan Bosch's Sieve rewrite:
http://hg.rename-it.nl/dovecot-libsieve/
  


Thanks for your reply. :)


--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  
 CentOS 5.x: http://iRedMail.googlecode.com/




Re: [Dovecot] How can i get original mail subject in sieve vacation?

2008-07-20 Thread Zhang Huangbin

Stephan Bosch wrote:
Yes, the new Sieve implementation supports this behavior. This is a 
typical case of the new variables extension to the rescue. The 
following script shows a tested example of how this would be achieved:




vacation :subject Auto-Reply msg: ${subject} text: 


This is really what i want, Good Job, Stephan.

Thanks for your great work. :)

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  
 CentOS 5.x: http://iRedMail.googlecode.com/




Re: [Dovecot] fd limit 1024 is lower in dovecot-1.1.1

2008-07-15 Thread Zhang Huangbin

Jack Stewart wrote:



Zhang Huangbin wrote:

Daniel L. Miller wrote:

Zhang Huangbin wrote:

Hi, all.

I just upgrade from 1.0.15 to 1.1.1 in a test box(RHEL 5.2, x86_64).

after upgrade, i got this warning msg:

8 
# /etc/init.d/dovecot restart
Stopping Dovecot Imap: [  OK  ]
Starting Dovecot Imap: Warning: fd limit 1024 is lower than what 
Dovecot can use under full load (more than 1280). Either grow the 
limit or change login_max_processes_count and max_mail_processes 
settings


I'm just guessing - but reading that warning it appears to me that 
Dovecot is saying that as it is configured, it can consume more O/S 
resources (I assume fd is file descriptors) than the O/S is 
currently configured for.  So you need to DECREASE your dovecot max 
processes to decrease the (potential) system demands - or increase 
your O/S settings.


Daniel



I think so.

I just decrease the processes, it works now.



Hi,

Just as an FYI, for some versions of linux (i.e. RHE) you need to set 
the process limit - ulimit unlimited is not enough. 1024 is the 
default number of open file descriptors.


One of the ways to solve this is by running 'ulimit -n X' in your init 
script before starting the program. Within RHE, another way is to 
configure /etc/security/limits.conf by putting something like this 
into the file:


*hardlocks 8192
*hardnofile8192
*softlocks 4096
*softnofile4096

This allows for processes to run with 4096 file descriptors by default 
and the user process can increase it to 8192 via ulimit. 
/etc/security/limits.conf can also be configured on a per user basis 
which is also nice.



Thanks Jack. I will test it later. ^_^

I just comment the 'max_processes' variable in dovecot.conf now.

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://iRedMail.googlecode.com/



[Dovecot] How can i set vacation subject in non-english characters?

2008-07-12 Thread Zhang Huangbin

Hi, all.

I have implemented vacation via dovecot sieve. but how can i use
non-english characters in vacation subject?

Thanks very much.

This is my sample sieve rule for vacation:

8
require [vacation];

vacation
   :days 1
   :mime
   :subject Auto-Reply: Out of office.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

I can use non-english character here as mail body, wrote in utf-8.
;
8

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  
CentOS 5.x:

 http://iRedMail.googlecode.com/



Re: [Dovecot] How can i set vacation subject in non-english characters?

2008-07-12 Thread Zhang Huangbin

Timo Sirainen wrote:

On Sun, 2008-07-13 at 03:00 +0800, Zhang Huangbin wrote:
  

Hi, all.

I have implemented vacation via dovecot sieve. but how can i use
non-english characters in vacation subject?



The same way as in all other email messages: MIME encode it. Perhaps
Dovecot should do this internally, but for now it doesn't.

Easiest way I can think of to generate the subject would be to let your
current MUA do that. Send yourself the subject you want and copypaste
the Subject: header from the raw message sources.

  

Got it. Thanks Timo. :)

Hope dovecot will do that in the future version.

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://iRedMail.googlecode.com/



[Dovecot] How can i get original mail subject in sieve vacation?

2008-07-12 Thread Zhang Huangbin

Hi, all.

I want to mix some new words and original mail subject as vacation
subject, how can i get original mail subject in sieve vacation?

Original subject: Hello.
Vacation subject: Auto-Reply msg: Hello.
 ^ New ^ ^Orig^

Thanks very much.

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://iRedMail.googlecode.com/



[Dovecot] 'include' feature in sieve 1.1.5

2008-07-12 Thread Zhang Huangbin

Hi, all.

I use dovecot-1.1.1 and dovecot-1.1.5 which built by atrpms, and i
use 'include' command to include two/several personal sieve rule file,
but if either of these personal sieve rule files is not exist,
sieve_execute_bytecode failed.

How can i make it just skip the non-exist personal sieve rule file,
and continue to try to include next sieve rule file?

Thanks very much. :)

In /etc/dovecot.conf:
8
protocol lda {
   postmaster_address = root
   auth_socket_path = /var/run/dovecot/auth-master
   mail_plugins = cmusieve quota
   sieve_global_path = /home/vmail/.dovecot.sieve
   log_path = /var/log/sieve.log
}
8

In /etc/dovecot-mysql.conf:

user_query = SELECT xxx, xxx, '/home/vmail/%Ld/%Ln/' AS sieve_dir, xxx


My sieve rule: /home/vmail/.dovecot.sieve:

require [fileinto, reject, include];

include :personal .dovecot.sieve;
include :personal .vacation.sieve;


Log:
8
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: Loading modules from 
directory: /usr/lib64/dovecot/lda
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: Module loaded: 
/usr/lib64/dovecot/lda/lib10_quota_plugin.so
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: Module loaded: 
/usr/lib64/dovecot/lda/lib90_cmusieve_plugin.so

deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: auth input: [EMAIL PROTECTED]
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: auth input: home=/home/vmail
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: auth input: 
sieve_dir=/home/vmail/a.cn/postmaster/
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: auth input: 
quota_rule=*:bytes=0
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: auth input: 
maildir=a.cn/postmaster/
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: Quota root: name= 
backend=maildir args=
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: Quota rule: root= 
mailbox=* bytes=0 (0%) messages=0 (0%)
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: maildir: 
data=//home/vmail/a.cn/postmaster/:INDEX=//home/vmail/a.cn/postmaster/
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: maildir++: 
root=//home/vmail/a.cn/postmaster, index=, control=, 
inbox=//home/vmail/a.cn/postmaster
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: cmusieve: Using sieve 
path: /home/vmail/.dovecot.sieve
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: cmusieve: Executing 
script /home/vmail/.dovecot.sievec
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: cmusieve: Script not 
found: /home/vmail/a.cn/postmaster//.dovecot.sieve
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: include: Script not 
found: '.dovecot.sieve'
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: sieve runtime error: 
Include can not find script
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Error: 
sieve_execute_bytecode(/home/vmail/.dovecot.sievec) failed
deliver([EMAIL PROTECTED]): Jul 13 11:48:24 Info: 
msgid=[EMAIL PROTECTED]: saved mail to INBOX



--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux 
 CentOS 5.x: http://iRedMail.googlecode.com/



Re: [Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2008-07-04 Thread Zhang Huangbin

Ralf Becker wrote:

Hello everybody!

I'm trying to configure dovecot 1.1.1 with different proxy hosts 
and/or ports for different protocols (IMAP, POP3). I'm using LDAP for 
authentication.


I've tried: 



Refer to this thread:
http://marc.info/?l=dovecotm=121376558429308w=2

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://iRedMail.googlecode.com/



[Dovecot] [Help] quota_rule with LDAP backend, dovecot-1.1.1

2008-07-03 Thread Zhang Huangbin

Hi, all.

I use dovecot-1.1.1 with OpenLDAP as userdb. but i failed to convert
quota value as expect.

I set '10' as mail quota, and it should be '10M' as expect, but it's
not effect, dovecot always uses 'quota_rule' setting in dovecot.conf.

How can i fix this issue? 10*1047576?

I have 'mailQuota' attr in ldap schema, such as:

8
mailQuota: 10   # - 10M
8

My dovecot-ldap.conf:

8
user_attrs = 
homeDirectory=home,mailMessageStore=maildir:mail,mailQuota=quota_rule=*:bytes=%$

8

And my dovecot.conf:

8
plugin {
   quota = maildir

   # Quota rules.
   quota_rule = *:storage=10M
}
8


--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://iRedMail.googlecode.com/



Re: [Dovecot] fd limit 1024 is lower in dovecot-1.1.1

2008-06-29 Thread Zhang Huangbin

Daniel L. Miller wrote:

Zhang Huangbin wrote:

Hi, all.

I just upgrade from 1.0.15 to 1.1.1 in a test box(RHEL 5.2, x86_64).

after upgrade, i got this warning msg:

8 
# /etc/init.d/dovecot restart
Stopping Dovecot Imap: [  OK  ]
Starting Dovecot Imap: Warning: fd limit 1024 is lower than what 
Dovecot can use under full load (more than 1280). Either grow the 
limit or change login_max_processes_count and max_mail_processes 
settings

  [  OK  ]
8 

but i changed either login_max_processes_count and max_mail_processes
to 2048, it raised the same msg. How can i solove this issue?

I'm just guessing - but reading that warning it appears to me that 
Dovecot is saying that as it is configured, it can consume more O/S 
resources (I assume fd is file descriptors) than the O/S is 
currently configured for.  So you need to DECREASE your dovecot max 
processes to decrease the (potential) system demands - or increase 
your O/S settings.


Daniel



I think so.

I just decrease the processes, it works now.

Thanks Daniel and all replies. :)


--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://rhms.googlecode.com/



[Dovecot] fd limit 1024 is lower in dovecot-1.1.1

2008-06-28 Thread Zhang Huangbin

Hi, all.

I just upgrade from 1.0.15 to 1.1.1 in a test box(RHEL 5.2, x86_64).

after upgrade, i got this warning msg:

8 
# /etc/init.d/dovecot restart
Stopping Dovecot Imap: [  OK  ]
Starting Dovecot Imap: Warning: fd limit 1024 is lower than what Dovecot 
can use under full load (more than 1280). Either grow the limit or 
change login_max_processes_count and max_mail_processes settings

  [  OK  ]
8 

but i changed either login_max_processes_count and max_mail_processes
to 2048, it raised the same msg. How can i solove this issue?

Thanks very much.

My dovecot -n output:

8
# dovecot -n
# 1.1.1: /etc/dovecot.conf
Warning: fd limit 1024 is lower than what Dovecot can use under full 
load (more than 1280). Either grow the limit or change 
login_max_processes_count and max_mail_processes settings

log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps
listen: *
ssl_cert_file: /etc/pki/dovecot/certs/dovecotCert.pem
ssl_key_file: /etc/pki/dovecot/private/dovecotKey.pem
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
max_mail_processes: 1024
mail_uid: 2000
mail_gid: 2000
mail_location: maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib64/dovecot/imap
mail_plugin_dir(imap): /usr/lib64/dovecot/imap
mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 mechanisms: plain login
 user: vmail
 passdb:
   driver: sql
   args: /etc/dovecot-mysql.conf
 userdb:
   driver: sql
   args: /etc/dovecot-mysql.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 432
 user: vmail
 group: vmail

--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://rhms.googlecode.com/



Re: [Dovecot] How to seperate pop3 and imap user lookup?

2008-06-18 Thread Zhang Huangbin

Timo Sirainen wrote:

On Wed, 2008-06-18 at 13:05 +0800, Zhang Huangbin wrote:
  

Hi, all.

I have two column in MySQL user table:

- enablepop (NOT NULL default '1')
- enableimap (NOT NULL default '1')

How can i config dovecot to seperate pop user lookup and imap user lookup?



Use %s which expands to IMAP or POP3 in the query. See
http://wiki.dovecot.org/Variables for list of all variables.

  

Hi, Timo.

It works now. Thanks :)

for mysql query(MySQL column: enablepop3, enableimap):
8
user_query = SELECT xxx FROM mailbox WHERE username='%u' AND active='1' 
AND enable%Ls='1'

8

for LDAP query(LDAP attr: enablePOP3, enableIMAP):
8
user_filter = ((mail=%u)(xxx other filter here)(enable%Us=yes))
8

--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://rhms.googlecode.com/



Re: [Dovecot] Error while set mailQuota=0 with mbox and LDAP backend

2008-05-25 Thread Zhang Huangbin

Hi, Timo.

Timo Sirainen wrote:

 
homeDirectory=home,mailMessageStore=dirsize:mail,mailQuota=quota=dirsize:storage


 Also what is mailMessageStore=dirsize:mail? I don't think it does
 anything.

After some test, i think 'mailMessageStore=dirsize:mail' is an optional
parameter for LDAP backend.

mail_location in dovecot.conf:


mail_location = 
mbox:/%Lh/%Ld/%Ln:INBOX=/%Lh/%Ld/%Ln/inbox:INDEX=/%Lh/%Ld/%Ln/indexes



Below is sieve log file without 'mailMessageStore=dirsize:mail':


deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: Loading modules from directory: 
/usr/lib64/dovecot/lda
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: Module loaded: 
/usr/lib64/dovecot/lda/lib10_quota_plugin.so
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: Module loaded: 
/usr/lib64/dovecot/lda/lib90_cmusieve_plugin.so

deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: auth input: [EMAIL PROTECTED]
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: auth input: home=/home/vmail
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: auth input: 
quota=dirsize:storage=10240

deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: auth input: uid=2000
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: auth input: gid=2000
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: mbox: 
data=//home/vmail/a.cn/www:INBOX=//home/vmail/a.cn/www/inbox:INDEX=//home/vmail/a.cn/www/indexes
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: mbox: 
root=//home/vmail/a.cn/www, index=//home/vmail/a.cn/www/indexes, 
inbox=//home/vmail/a.cn/www/inbox

deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: dirsize quota limit = 10240kB
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: cmusieve: Using sieve path: 
/home/vmail/.sieve.rule
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: cmusieve: Executing script 
/home/vmail/.sieve.rulec
deliver([EMAIL PROTECTED]): May 25 12:10:09 Info: 
msgid=[EMAIL PROTECTED]: saved mail to INBOX



And below is sieve log with 'mailMessageStore=dirsize:mail':


deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: Loading modules from directory: 
/usr/lib64/dovecot/lda
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: Module loaded: 
/usr/lib64/dovecot/lda/lib10_quota_plugin.so
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: Module loaded: 
/usr/lib64/dovecot/lda/lib90_cmusieve_plugin.so

deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: auth input: [EMAIL PROTECTED]
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: auth input: home=/home/vmail
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: auth input: 
dirsize:mail=a.cn/www
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: auth input: 
quota=dirsize:storage=10240

deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: auth input: uid=2000
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: auth input: gid=2000
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: mbox: 
data=//home/vmail/a.cn/www:INBOX=//home/vmail/a.cn/www/inbox:INDEX=//home/vmail/a.cn/www/indexes
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: mbox: 
root=//home/vmail/a.cn/www, index=//home/vmail/a.cn/www/indexes, 
inbox=//home/vmail/a.cn/www/inbox

deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: dirsize quota limit = 10240kB
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: cmusieve: Using sieve path: 
/home/vmail/.sieve.rule
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: cmusieve: Executing script 
/home/vmail/.sieve.rulec
deliver([EMAIL PROTECTED]): May 25 12:11:43 Info: 
msgid=[EMAIL PROTECTED]: saved mail to INBOX



--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://rhms.googlecode.com/



Re: [Dovecot] Error while set mailQuota=0 with mbox and LDAP backend

2008-05-24 Thread Zhang Huangbin

Timo Sirainen wrote:

On Sat, 2008-05-24 at 04:39 +0800, Zhang Huangbin wrote:
  

The problem is if i set 'mailQuota=0' in LDAP, postfix can't send mail
to recipient user. But it works fine with 'mailQuota != 0', such as
'10240'(10M).



0 means the user has 0 bytes quota, not unlimited. Maybe this should be
changed.. You could always work around it by just returning a very large
value.
  

Hope to see this change. :)
  

homeDirectory=home,mailMessageStore=dirsize:mail,mailQuota=quota=dirsize:storage



Also what is mailMessageStore=dirsize:mail? I don't think it does
anything.
  

I will delete 'mailMessageStore' for test. Thanks Timo. :)


--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://rhms.googlecode.com/



[Dovecot] Error while set mailQuota=0 with mbox and LDAP backend

2008-05-23 Thread Zhang Huangbin
 = ((mail=%u)(objectClass=qmailUser)(accountStatus=active))
pass_filter = (mail=%u)
pass_attrs  = userPassword=password
user_global_uid = 2000
user_global_gid = 2000
default_pass_scheme = CRYPT
user_attrs  = 
homeDirectory=home,mailMessageStore=dirsize:mail,mailQuota=quota=dirsize:storage

-- End /etc/dovecot-ldap.conf ---

transport entry in Postfix master.cf:

--- /etc/postfix/master.cf 
dovecot unix-   n   n   -   -  pipe
 flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -d 
${recipient} -f ${sender}

--- End /etc/postfix/master.cf 


--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://rhms.googlecode.com/



Re: [Dovecot] problem about mbox with quota

2008-05-18 Thread Zhang Huangbin

Hi, Timo.

Timo Sirainen wrote:

On May 18, 2008, at 5:13 AM, Zhang Huangbin wrote:


Hi, all.

Does mbox format support quota?


dirsize backend should work pretty well.

dovecot: May 18 02:10:36 Error: POP3([EMAIL PROTECTED]): Unknown quota 
backend: storage=10240


You need to select the backend.

user_query = SELECT 2000 AS uid, 2000 AS gid, /home/vmail AS home, 
maildir, CONCAT('storage=',quota) AS quota FROM mailbox WHERE 
username='%u' AND active='1'


CONCAT('dirsize:storage=',quota)



Thanks very much. :)

I think we should add this tip in wiki page:
http://wiki.dovecot.org/Quota
OR
http://wiki.dovecot.org/MailLocation/Mbox

--
Best Regards.

Zhang Huangbin

- OpenBSD 4.2 -release, i386.
- RHEL 5.1 Client




[Dovecot] problem about mbox with quota

2008-05-17 Thread Zhang Huangbin

Hi, all.

Does mbox format support quota?

I got this error in log file:

dovecot: May 18 02:10:36 Error: POP3([EMAIL PROTECTED]): Unknown quota backend: 
storage=10240


How can i solved it?

Thanks very much. :)

My dovecot configuration:

# /etc/dovecot.conf
log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps
ssl_cert_file: /etc/pki/dovecot/certs/dovecotCert.pem
ssl_key_file: /etc/pki/dovecot/private/dovecotKey.pem
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
mail_location: mbox:/%Lh/%Ld/%Ln:INBOX=/%Lh/%Ld/%Ln
mbox_write_locks: dotlock fcntl
mbox_min_index_size: 10240
mbox_very_dirty_syncs: yes
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/pop3
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
 mechanisms: plain login
 user: vmail
 passdb:
   driver: sql
   args: /etc/dovecot-mysql.conf
 userdb:
   driver: sql
   args: /etc/dovecot-mysql.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 432
 user: vmail
 group: vmail

# /etc/dovecot-mysql.conf
driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=vmail user=vmail 
[EMAIL PROTECTED]11769*16758)17720
password_query = SELECT password FROM mailbox WHERE username='%u' AND 
active='1'
user_query = SELECT 2000 AS uid, 2000 AS gid, /home/vmail AS home, 
maildir, CONCAT('storage=',quota) AS quota FROM mailbox WHERE 
username='%u' AND active='1'


--
Best Regards.

Zhang Huangbin

- OpenBSD 4.2 -release, i386.
- RHEL 5.1 Client




[Dovecot] Howto create maildir in lower case while user login via imap/pop3?

2008-03-26 Thread Zhang Huangbin

Hi, all.

I searched mail archives, but no result.

I use OutLook Express on Windows XP as MUA, login username is in upper case,
such as '[EMAIL PROTECTED]', when login via imap, dovecot create directories:

/home/vmail/
   |- BBB.COM/ # - Domain name
   |- AAA/ # - User name
   |- cur/
   |- xxx

Here, domain name and user name are in upper case.

How can i make it create directories in lower case?

#
# dovecot -n
#
# /etc/dovecot.conf
log_path: /var/log/dovecot
login_dir: /var/run/dovecot/login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
mail_location: maildir:/%h/%d/%n/:INDEX=/%h/%d/%n/
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/pop3
auth default:
 mechanisms: plain login
 user: vmail
 passdb:
   driver: ldap
   args: /etc/dovecot-ldap.conf
 userdb:
   driver: ldap
   args: /etc/dovecot-ldap.conf
 socket:
   type: listen
   client:
 path: /var/spool/postfix/private/auth
 mode: 432
 user: postfix
 group: postfix
   master:
 path: /var/run/dovecot/auth-master
 mode: 432
 user: vmail
 group: vmail

#
# File: /etc/dovecot-ldap.conf
#
hosts   = 127.0.0.1:389
ldap_version= 3

auth_bind   = yes
dn  = cn=vmail,dc=openbsdonly,dc=org
dnpass  = passwd

base= o=%d,o=domains,dc=openbsdonly,dc=org
scope   = subtree

deref   = never

user_filter = ((mail=%u)(objectClass=qmailUser)(accountStatus=active))
user_attrs  = 
homeDirectory=home,mailMessageStore=maildir:mail,mailQuota=quota=maildir:storage


pass_filter = (mail=%u)
pass_attrs  = userPassword=password

user_global_uid = 2000
user_global_gid = 2000

default_pass_scheme = CRYPT

--
Best Regards.

Zhang Huangbin

- OpenBSD 4.2 -release, i386.
- RHEL 5.1 Client



Re: [Dovecot] Howto create maildir in lower case while user login viaimap/pop3?

2008-03-26 Thread Zhang Huangbin

Hi, Toms.

Toms Trankalis wrote:
I have a similar problem. When mail comes to [EMAIL PROTECTED] (in 
lovercase) dovecot creates directory /vmail/domain.com/user, but if 
user types login like [EMAIL PROTECTED], then dovecot creates dir 
/vmail/domain.com/User and I wonder why dovecot accepts the login name 
at all?


In my sutiation dovecot is auth against mysql database.


I fixed this situation, and sorry for the noise :(

Reference:
http://wiki.dovecot.org/Variables#head-010a6461d783547686f70249e820fd6b83fd453e

%L - lowercase

So i set mail_location to:

mail_location = maildir:/%Lh/%Ld/%Ln/:INDEX=/%Lh/%Ld/%Ln/

It works.


--
Best Regards.

Zhang Huangbin

- OpenBSD 4.2 -release, i386.
- RHEL 5.1 Client