Re: [Dovecot] Dovecot Migration: Retrieving/Logging POP/IMAP Passwords in Plaintext

2014-03-06 Thread Gilles van den Hoven
Traiano Welcome  gmail.com> writes:

> 
> Hi List
> 
> I'm currently in the process of migrating my dovecot imap/pop users to a
> new server and have to extract their passwords in order to import them 
into
> the new system (different password encryption schemes).
> 
> I've tried enabling auth_* debug parameters in my dovecot.conf in the hope
> that this would result in logging plaintext passwords to the dovecot log.
> However dovecot does not log the passwords in plaintext under any 
debugging
> configuration.
> 
> My question: Is there any other configuration of dovecot that would allow
> me to capture POP/IMAP passwords at a successful login time?
> 
> Dovecot version:  1.0.7 (from dovecot-1.0.7-7.el5_7.1 rpm)
> 
> The output of dovecot -n is:
> 
> ---
> # 1.0.7: /etc/dovecot.conf
> info_log_path: /var/log/dovecot.debug
> verbose_ssl: yes
> 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:~:INBOX=~/Mailbox
> 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_plugin_dir(default): /usr/lib64/dovecot/imap
> mail_plugin_dir(imap): /usr/lib64/dovecot/imap
> mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3
> auth default:
>   mechanisms: plain login
>   verbose: yes
>   debug: yes
>   debug_passwords: yes
>   passdb:
> driver: pam
>   userdb:
> driver: passwd
>   socket:
> type: listen
> client:
>   path: /var/run/dovecot/auth-client
>   mode: 438
> ---
> 
> My dovecot.conf is as follows:
> 
> --
> info_log_path = /var/log/dovecot.debug
> verbose_ssl = yes
> mail_location = mbox:~:INBOX=~/Mailbox
> mail_debug = yes
> protocol imap {
> }
> protocol pop3 {
> }
> protocol lda {
>   postmaster_address = postmaster  example.com
> }
> auth_verbose = yes
> auth_debug = yes
> auth_debug_passwords = yes
> auth default {
>   mechanisms = plain login
>   passdb pam {
>   }
>   userdb passwd {
>   }
>   user = root
>   socket listen {
> client {
>   path = /var/run/dovecot/auth-client
>   mode = 0666
> }
>   }
> }
> dict {
> }
> plugin {
> }
> ---
> 
> Many thanks in advance!
> Traiano
> 
> 

Yes this is possible, i did it today for my own server which was also 
running dovecot 1.x. I hope i got all steps; but if not this should get you 
a head start in the right direction.

requires SQL and prefetching; largely based on a lot of googling, trying and 
this page; http://wiki1.dovecot.org/UserDatabase/Prefetch

Steps to implement (based on SQL login);

1) Change MySQL 'user' query (all fields that are needed for LDA)
note: adjust query to match your own fields/query
user_query = SELECT home, uid, gid FROM mail_users WHERE address = '%u' AND 
active = '1'

2) Change MySQL 'password' query (prepend all 'user info' fields with 
userdb_)
note: adjust query to match your own fields/query
password_query = SELECT <...>, '%w' as userdb_plain_pass FROM mail_users 
WHERE address = '%u' AND active = '1'

3) Add new executables for imap and pop3 login;
vi /usr/local/sbin/pop3.sh

add this:
#!/bin/sh
echo "UPDATE mail_users SET modified=now(), type='pop3', 
plainpwd='$PLAIN_PASS' WHERE address = '$USER'" | mysql --host= --
user= --password= 
exec /usr/lib/dovecot/pop3 "$@"

vi /usr/local/sbin/imap.sh

add this:
#!/bin/sh
echo "UPDATE mail_users SET modified=now(), type='pop3', 
plainpwd='$PLAIN_PASS' WHERE address = '$USER'" | mysql --host= --
user= --password= 
exec /usr/lib/dovecot/imap "$@"

Chmod +x them and make sure both the query as the "/usr/lib/dovecot/" 
matches your environment.

4) In dovecot.conf; change executables for imap and pop3 login to point to 
new bash scripts
protocol pop3 {
  ...
  mail_executable = /usr/local/sbin/pop3.sh
  ...
}

protocol imap {
  ...
  mail_executable = /usr/local/sbin/imap.sh
  ...
}


5) Still in dovecot.conf add:
userdb {
  driver = prefetch
}

6) restart dovecot, done.
/etc/init.d/dovecot restart

Regards,
Gilles


Re: [Dovecot] no sieve with lmtp_save_to_detail_mailbox=yes

2014-03-06 Thread Stephan Bosch
On 3/6/2014 5:19 PM, Dennis Kuhn wrote:
> i have a problem with sieve and lmtp_save_to_detail_mailbox = yes. If
> the mailbox "detail" exists everything works fine, but if the mailbox
> detail does not exist then sieve does not work. The .dovecot.sieve.log
> file says
>
> sieve: info: started log at Mar 06 14:28:47.
> error: msgid=<531877ee.7070...@heinlein-support.de>: failed to store
> into mailbox 'test2': Mailbox doesn't exist: test2.
>
> I think this is the reason why no sieve script is executed, but why is
> sieve here involved?
> Is there any relation between lmtp_save_to_detail_mailbox=yes and sieve
> or is this a bug?
>
> The same sieve file works with the same mailaddress without
> mailextension, so the sieve script is not the reason for the failure.

That setting changes the default `keep;' mailbox from INBOX to whatever
the detail is. You can set lda_mailbox_autocreate=yes to make sure that
the detail folder exists.

If you don't want to create this folder implicitly, you have a bit of an
issue. The use of the detail as the default keep mailbox has existed
since the old CMUSieve plugin and I didn't bother to change this. There
is currently no way to prevent this behavior, other than using `fileinto
"INBOX";' explicitly rather than `keep;'. You can check for the presence
of a detail in the message using the subaddress extension
(http://tools.ietf.org/html/rfc5233) and then do whatever is needed to
prevent this error; i.e. not execute (implicit) keep.

Better yet: you can also turn off this setting and let Sieve do
everything. This way, you can define a default script that recognizes
the detail and stores the mail in the corresponding folder if it exists.
An example is here:
http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples#Plus_Addressed_mail_filtering
. Use the sieve_default setting to configure a default script which is
executed when the user has no active Sieve script. Alternatively, if you
always want a certain action for a detail'ed message, you can force it
using a sieve_before script.

Of course, it all depends a bit on what you're trying to achieve.

Regards,

Stephan.


[Dovecot] no sieve with lmtp_save_to_detail_mailbox=yes

2014-03-06 Thread Dennis Kuhn
i have a problem with sieve and lmtp_save_to_detail_mailbox = yes. If
the mailbox "detail" exists everything works fine, but if the mailbox
detail does not exist then sieve does not work. The .dovecot.sieve.log
file says

sieve: info: started log at Mar 06 14:28:47.
error: msgid=<531877ee.7070...@heinlein-support.de>: failed to store
into mailbox 'test2': Mailbox doesn't exist: test2.

I think this is the reason why no sieve script is executed, but why is
sieve here involved?
Is there any relation between lmtp_save_to_detail_mailbox=yes and sieve
or is this a bug?

The same sieve file works with the same mailaddress without
mailextension, so the sieve script is not the reason for the failure.

I am using dovecot version 2.2.12

Dennis Kuhn

-- 
Heinlein Support GmbH
Schwedter Str. 8/9b, 10119 Berlin

http://www.heinlein-support.de

Tel: 030 / 405051-57
Fax: 030 / 405051-19

Zwangsangaben lt. §35a GmbHG: 
HRB 93818 B / Amtsgericht Berlin-Charlottenburg,
Geschäftsführer: Peer Heinlein -- Sitz: Berlin


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Dieter Knopf
2014-03-06 16:32 GMT+01:00 Steffen Kaiser :

>
> If you don't get it to work, fake an INBOX by symlinking cur/new/tmp into
> ".INBOX". It's not the nice, but should work.
>
>
Thanks, because of that i tried it with a custom INBOX in mail_location and
it worked, but i still only see FOO/INBOX as folder and not FOO itself.


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 6 Mar 2014, Dieter Knopf wrote:


sure, it's a standard virtual mailbox, INBOX is working fine. I just used
the same directory for a PUBLIC namespace.


If you don't get it to work, fake an INBOX by symlinking cur/new/tmp into 
".INBOX". It's not the nice, but should work.


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUxiVIHD1/YhP6VMHAQJZEwgApof9omD+MoSDPtEL5qWtiNY68SRMNatH
bL0y0AvNWsf5GTfNf6vPCeM7dR/QTqMpOtUpUJZS3gzbbplVP8NRV+CdvtRAX5g0
ap3m4a3ktpKnQCLhXdInd7EbEwQjBKBMa+T1QMDvY5St4gtrRmWcF1nCWGRg1WNa
QHTIJaTBYY4tQyNR+CGMIdNUlmCEQSg+ROUOFDRnfPMWJExWRxk6fThSXJ4o346v
/K5ctglSPBTwHX/IVJ+Q93nJDynCgSt7/w8EbHt39/9iHNXnxCX1s6Z2zkx6njQn
rjOwYIm3PmL9c1TuY7C2zoGKNCtjPKP4aiSWGdqup2Ohp+knV+Bl3A==
=Ivse
-END PGP SIGNATURE-


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Dieter Knopf
Hello,

sure, it's a standard virtual mailbox, INBOX is working fine. I just used
the same directory for a PUBLIC namespace.

Thanks


2014-03-06 14:26 GMT+01:00 Darac Marjal :

> On Thu, Mar 06, 2014 at 11:49:07AM +0100, Dieter Knopf wrote:
> > Hello,
> >
> > i added a existing MAILDIR as a Public Namespace and i can subscribe to
> > this Namespace without a problem.
> >
> > I can access every folder except the INBOX. Thunderbird just shows a GREY
> > "INBOX".
>
> This is a symptom of a folder not existing, but folders beneath it
> existing. For example, I filter Debian Bug mails into
> INBOX\Bugs\$BugNumber. There is no INBOX\Bugs folder, so it shows up
> greyed.
>
> If you have a greyed out INBOX, then either you've made a mistake in
> your config or perhaps there's an issue with the mailbox itself. Can you
> access the maildir as a private namespace?
>
> >
> > Is there any way to access the INBOX of a maildir?
> >
> > Thanks
> > Dieter Knopf
>


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Darac Marjal
On Thu, Mar 06, 2014 at 11:49:07AM +0100, Dieter Knopf wrote:
> Hello,
> 
> i added a existing MAILDIR as a Public Namespace and i can subscribe to
> this Namespace without a problem.
> 
> I can access every folder except the INBOX. Thunderbird just shows a GREY
> "INBOX".

This is a symptom of a folder not existing, but folders beneath it
existing. For example, I filter Debian Bug mails into
INBOX\Bugs\$BugNumber. There is no INBOX\Bugs folder, so it shows up
greyed.

If you have a greyed out INBOX, then either you've made a mistake in
your config or perhaps there's an issue with the mailbox itself. Can you
access the maildir as a private namespace?

> 
> Is there any way to access the INBOX of a maildir?
> 
> Thanks
> Dieter Knopf


signature.asc
Description: Digital signature


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 6 Mar 2014, Dieter Knopf wrote:


I can subscribe to anything but the FOO/ folder is empty (Mailbox doesn't
exist FOO/FOO)


Please search the list, I'm 80% sure that I've read the same question some 
weeks back and Timo answered that.


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUxh2B3D1/YhP6VMHAQLXbQf/d0IKbMY9h1UwJZ+aSmBfNEFVcN71DZba
N2CTkltFjQzy9XVnqwHA3uLrwDuqD3+fv0Nr6E6SJywerN0EIo+/iQ9lNbVt8Muv
e3nhEHuCT6OHRB/MqBhb5rX+56sTBvlXwlZndQvzzqtRGQ6Qg4TEe23ER489dFN5
8PSdCXAcjzWwnI/4+7l2FrwFPbLf0MxDlJNSScROsMJyWVPR0p1eqDiWAYXukcNX
93rO/0FM14hvuxrFonHchU837erVAOqA9Kqy5TKT8Qny/FOyTiVv6XWGxJnHwtpF
dvmLZFdFZHcrE1zQBjWlOjXoNtZS+O1zdyJH1ci/zds37OQTScghLQ==
=nSoR
-END PGP SIGNATURE-


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Dieter Knopf
Sorry.

Config is:
namespace inbox {
  type = private
  separator = /
  prefix =
  inbox = yes
}
namespace {
  type = public
  separator = /
  prefix = FOO/
  location = maildir:/home/vmail/
foo.eu/info/MAILDIR:INDEX=/home/vmail/foo.eu/info/S_INDEX:INDEXPVT=/home/vmail/foo.eu/info/S_INDEXPVT/%u
  subscriptions = no
}

I can subscribe to anything but the FOO/ folder is empty (Mailbox doesn't
exist FOO/FOO)

It works with a custom INBOX (mail_location = .INBOX=.../.INBOX/", then
i can subscribe to INBOX, but it would be nice if the PREFIX-Folder shows
the INBOX.

Thanks
Dieter




2014-03-06 13:41 GMT+01:00 Charles Marcus :

> On 3/6/2014 5:49 AM, Dieter Knopf  wrote:
>
>> i added a existing MAILDIR as a Public Namespace and i can subscribe to
>> this Namespace without a problem.
>>
>> I can access every folder except the INBOX. Thunderbird just shows a GREY
>> "INBOX".
>>
>> Is there any way to access the INBOX of a maildir?
>>
>
> I'm really confused at the number of people who ask questions like this
> without providing their configuration.
>
> Do you people think everyone here has a crystal ball?
>
> --
>
> Best regards,
>
> Charles
>


Re: [Dovecot] Public Namespace and INBOX

2014-03-06 Thread Charles Marcus

On 3/6/2014 5:49 AM, Dieter Knopf  wrote:

i added a existing MAILDIR as a Public Namespace and i can subscribe to
this Namespace without a problem.

I can access every folder except the INBOX. Thunderbird just shows a GREY
"INBOX".

Is there any way to access the INBOX of a maildir?


I'm really confused at the number of people who ask questions like this 
without providing their configuration.


Do you people think everyone here has a crystal ball?

--

Best regards,

Charles


Re: [Dovecot] Still no emails since Feb. 6

2014-03-06 Thread Reindl Harald

Am 06.03.2014 13:30, schrieb Steve Campbell:
> On 3/6/2014 6:03 AM, Reindl Harald wrote:
>> Am 05.03.2014 21:37, schrieb Eugene R:
>>> Got access denied for direct mail:
>>> : host mailserver2.cnpapers.net[216.12.119.162] said:
>>> 550 5.7.1 Access denied (in reply to MAIL FROM command)
>>>
>>> Well, this is now really off-topic for the list (local config error). Sorry 
>>> to bother people
>> and now the OP should seek his maillog for "Access denied" rejects
>> and asks himself why a public MX acts that wrong
>>
> Thanks all for the help. That IP was placed in my firewall, not sure when

uhm you don't comment day and reason as well as not "whois ip"
in case of set ip addresses blocked in your firewalls?



signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] Still no emails since Feb. 6

2014-03-06 Thread Steve Campbell


On 3/6/2014 6:03 AM, Reindl Harald wrote:

Am 05.03.2014 21:37, schrieb Eugene R:

Got access denied for direct mail:
: host mailserver2.cnpapers.net[216.12.119.162] said:
550 5.7.1 Access denied (in reply to MAIL FROM command)

Well, this is now really off-topic for the list (local config error). Sorry to 
bother people

and now the OP should seek his maillog for "Access denied" rejects
and asks himself why a public MX acts that wrong


Thanks all for the help. That IP was placed in my firewall, not sure when.

Public MX's don't necessarily guarantee that what's coming from them are OK.

My maillog is so full of rejects and without knowing what IP I should 
look for, it was difficult to find out what was going on.


Anyway, we'll see what happens now.


Re: [Dovecot] Pigeonhole Sieve Extprograms Plugin

2014-03-06 Thread dovecot
On 06/03/14 00:14, Jiří Bourek wrote:
> Hi,
> 
> I think you are missing something along these lines:
> 
> plugin {
>   sieve_plugins = sieve_extprograms
>   sieve_global_extensions = +vnd.dovecot.filter
>   sieve_extensions = +vnd.dovecot.filter
> }
> 
> Also, I'm not sure what wheezy-backports package does, but the same
> version of Dovecot for Jessie looks for sieve plugins libraries under
> /usr/lib/dovecot/modules/sieve directory, whereas the dovecot-sieve
> package puts them into /usr/lib/dovecot/modules, causing Dovecot to
> throw errors (as it's unable to find them.)
> 
> Made it work by creating a symlink /usr/lib/dovecot/modules/sieve
> pointing to ../modules. I suspect this can cause breakage during
> dovecot-sieve update (if they ever get to put those files to the right
> place), so better watch that.
> 
> J.

Hi,

You're right, after adding the plugin to sieve_plugins and symlinking
its .so file in the right place, it works fine.
Thank you for the hint.

The mismatch between the configured and actual plugin directories seems
like a bug with the Debian package to me...

Nils


Re: [Dovecot] Still no emails since Feb. 6

2014-03-06 Thread Reindl Harald

Am 05.03.2014 21:37, schrieb Eugene R:
> Got access denied for direct mail:
> : host mailserver2.cnpapers.net[216.12.119.162] said:
>550 5.7.1 Access denied (in reply to MAIL FROM command)
> 
> Well, this is now really off-topic for the list (local config error). Sorry 
> to bother people

and now the OP should seek his maillog for "Access denied" rejects
and asks himself why a public MX acts that wrong



signature.asc
Description: OpenPGP digital signature


Re: [Dovecot] Still no emails since Feb. 6

2014-03-06 Thread Nick Edwards
Hi Steve,

new server from last month -  87.106.245.223
has correct A/PTR records, not in any DNSBL I can test, so no idea why
your not getting anything.



On 3/6/14, Steve Campbell  wrote:
> I checked my settings on the dovecot mailman page, and although my
> account was set to "disable" email, after changing it and attempting to
> have the list resend my password, I'm still not seeing emails.
>
> The last time I received emails, the outgoing server for the list was
> sent from the IP 193.210.130.67. Is that still correct?
>
> I've checked my logs to see if there's anything blocked, and I don't see
> anything. I've checked my access file and firewall, and nothing is
> blocked there.
>
> I'm not sure why my account settings showed "disabled", but it sounds
> like email was either bounced back to the list or my server is in some
> type of outgoing list to prevent sending to me.
>
> I'm at a loss. Is there any way an admin can check for me, please, to
> see if there's a problem they might spot?
>
> Thanks,
>
> steve
>


[Dovecot] Public Namespace and INBOX

2014-03-06 Thread Dieter Knopf
Hello,

i added a existing MAILDIR as a Public Namespace and i can subscribe to
this Namespace without a problem.

I can access every folder except the INBOX. Thunderbird just shows a GREY
"INBOX".

Is there any way to access the INBOX of a maildir?

Thanks
Dieter Knopf


[Dovecot] whole user mailbox read only

2014-03-06 Thread Francesco
Hello,
i was browsing the dovecot wiki for some documentation related to the
use of ACLs but i couldn't find an answer.

i'm in the need to prevent users from deleting emails, yet being able to
add new content via imap, what i mean is that a user should be able to
create an email in its mailbox (maildir actually is used), but once the
email is there the user shouldn't be able to delete it.

do you know if there is a way to accomplish this for each subfolder on a
Maildir environment?

Thanks in advance
Francesco


Re: [Dovecot] Bounce messages

2014-03-06 Thread Thanh Long DANG
Hi,

The problem is : when the mailbox is full and i'm trying to send a mail to it 
from another mailbox :
1- the server rejects the mail (OK)
2- need to notify the sender that the mailbox of recipient is full (Not OK)

(quota notifications is ok)

I think the link may help me. I will have a look today.

Kind regards,
Long


> Date: Thu, 6 Mar 2014 09:27:35 +0100
> From: skdove...@smail.inf.fh-brs.de
> To: long93...@hotmail.com
> CC: dovecot@dovecot.org
> Subject: Re: [Dovecot] Bounce messages
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Thu, 6 Mar 2014, Thanh Long DANG wrote:
>
>> I just set up my mail server using postfix / dovecot / mysql and it
>> works well. I just have a problem : I'm a trying to have a overquota
>> notification and the server sends nothing (mail server rejects incoming
>> mail).
>
> What do you mean with "the server sends nothing" Which server should send
> what? And should the mail _not_ reject incoming mail, if the user is over
> quota?
>
> If you mean: /usr/local/bin/quota-warning.sh is executed, but postfix does
> not deliver the warning, because the user is overquota; then you need to
> make the script deliver the message in alternate ways:
>
> a) use Dovecot deliver directly with quota disabled
> b) spool the message into Maildir directly
>
>> Could you tell me if there is a problem with dovecot or postfix 
>> configuration?
>
> postfix+quota config usually contain a quota-status section, like
> described here (German, but the code snippets are significant):
> http://sys4.de/de/blog/2013/04/05/dovecot-quota-mit-postfix-abfragen/
>
>> My conf :
>>
>> # 2.1.7: /etc/dovecot/dovecot.conf
>> # OS: Linux 2.6.32-26-pve x86_64 Debian 7.2 simfs
>> auth_mechanisms = plain login
>> debug_log_path = /var/log/dovecot-debug.log
>> dict {
>> quotadict = mysql:/etc/dovecot/dovecot-dict-sql.conf
>> }
>> disable_plaintext_auth = no
>> info_log_path = /var/log/dovecot-info.log
>> log_path = /var/log/dovecot.log
>> mail_location = maildir:/home/vmail/%d/%n:INDEX=/home/vmail/%d/%n/indexes
>> namespace inbox {
>> inbox = yes
>> location =
>> mailbox Drafts {
>> special_use = \Drafts
>> }
>> mailbox Junk {
>> special_use = \Junk
>> }
>> mailbox Sent {
>> special_use = \Sent
>> }
>> mailbox "Sent Messages" {
>> special_use = \Sent
>> }
>> mailbox Trash {
>> special_use = \Trash
>> }
>> prefix =
>> }
>> passdb {
>> args = /etc/dovecot/dovecot-mysql.conf.ext
>> driver = sql
>> }
>> plugin {
>> quota = maildir:User quota
>> quota_exceeded_message = Storage quota for this account has been exceeded, 
>> please try again later.
>> quota_rule = *:storage=1G
>> quota_rule2 = Trash:storage=+30%%
>> quota_rule3 = Sent:storage=+30%%
>> quota_warning = storage=90%% quota-warning 90 %u
>> quota_warning2 = storage=75%% quota-warning 75 %u
>> sieve = ~/.dovecot.sieve
>> sieve_dir = ~/sieve
>> }
>> postmaster_address = postmas...@multidist.eu
>> protocols = " imap lmtp pop3"
>> quota_full_tempfail = yes
>> rejection_subject = Rejet: %s
>> service auth {
>> unix_listener /var/spool/postfix/private/auth {
>> mode = 0666
>> }
>> }
>> service dict {
>> unix_listener dict {
>> mode = 0777
>> }
>> }
>> service lmtp {
>> unix_listener /var/spool/postfix/private/dovecot-lmtp {
>> group = postfix
>> mode = 0666
>> user = postfix
>> }
>> }
>> service quota-warning {
>> executable = script /usr/local/bin/quota-warning.sh
>> unix_listener quota-warning {
>> mode = 0777
>> }
>> }
>> ssl_cert = > ssl_key = > userdb {
>> args = /etc/dovecot/dovecot-mysql.conf.ext
>> driver = sql
>> }
>> verbose_proctitle = yes
>> protocol lmtp {
>> mail_plugins = " quota"
>> }
>> protocol lda {
>> info_log_path = /var/log/dovecot-lda.log
>> log_path = /var/log/dovecot-lda-errors.log
>> mail_plugins = " quota"
>> }
>> protocol imap {
>> mail_max_userip_connections = 10
>> mail_plugins = quota imap_quota
>> }
>> protocol pop3 {
>> mail_plugins = quota
>> pop3_uidl_format = %08Xu%08Xv
>> }
>
> - --
> Steffen Kaiser
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iQEVAwUBUxgxeHD1/YhP6VMHAQIDrAf/QDjhBzLodZDvQbuwZXwubJIf5y14IqVR
> rG6LEBMZtxUP8QmtYBK3dZayfG56+POWDg5fgMmqdqYpQgBStTaWhrKLEy1LSZ8E
> VLr8dArvRx4HsJrgr2ygHAJOQtoSM3YgoEjI8m0fRmdvzjaSZ+srbkZB911l5Gfi
> nWQm/8tsjaASAcGzbZ1OnltXxQef1K4qhrgZrxrOWW7xCWCAElNddY1lfekeahY6
> NfiTfKvkTyLfzzEi22RQTAMviUVraHJ69FyTpMWro5qiZIke5FWXlGP/XeK45xTh
> 0wcs/CK/OzxHu8lAVNoZWqTZUXRXCTaq0oll3N1QqaK8kIsnB8k/NQ==
> =QRsH
> -END PGP SIGNATURE- 

Re: [Dovecot] Bounce messages

2014-03-06 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 6 Mar 2014, Thanh Long DANG wrote:

I just set up my mail server using postfix / dovecot / mysql and it 
works well. I just have a problem : I'm a trying to have a overquota 
notification and the server sends nothing (mail server rejects incoming 
mail).


What do you mean with "the server sends nothing" Which server should send 
what? And should the mail _not_ reject incoming mail, if the user is over 
quota?


If you mean: /usr/local/bin/quota-warning.sh is executed, but postfix does 
not deliver the warning, because the user is overquota; then you need to 
make the script deliver the message in alternate ways:


a) use Dovecot deliver directly with quota disabled
b) spool the message into Maildir directly


Could you tell me if there is a problem with dovecot or postfix configuration?


postfix+quota config usually contain a quota-status section, like 
described here (German, but the code snippets are significant):

http://sys4.de/de/blog/2013/04/05/dovecot-quota-mit-postfix-abfragen/


My conf :

# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-26-pve x86_64 Debian 7.2 simfs
auth_mechanisms = plain login
debug_log_path = /var/log/dovecot-debug.log
dict {
  quotadict = mysql:/etc/dovecot/dovecot-dict-sql.conf
}
disable_plaintext_auth = no
info_log_path = /var/log/dovecot-info.log
log_path = /var/log/dovecot.log
mail_location = maildir:/home/vmail/%d/%n:INDEX=/home/vmail/%d/%n/indexes
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf.ext
  driver = sql
}
plugin {
  quota = maildir:User quota
  quota_exceeded_message = Storage quota for this account has been exceeded, 
please try again later.
  quota_rule = *:storage=1G
  quota_rule2 = Trash:storage=+30%%
  quota_rule3 = Sent:storage=+30%%
  quota_warning = storage=90%% quota-warning 90 %u
  quota_warning2 = storage=75%% quota-warning 75 %u
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmas...@multidist.eu
protocols = " imap lmtp pop3"
quota_full_tempfail = yes
rejection_subject = Rejet: %s
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
}
service dict {
  unix_listener dict {
    mode = 0777
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0666
    user = postfix
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    mode = 0777
  }
}
ssl_cert = 

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUxgxeHD1/YhP6VMHAQIDrAf/QDjhBzLodZDvQbuwZXwubJIf5y14IqVR
rG6LEBMZtxUP8QmtYBK3dZayfG56+POWDg5fgMmqdqYpQgBStTaWhrKLEy1LSZ8E
VLr8dArvRx4HsJrgr2ygHAJOQtoSM3YgoEjI8m0fRmdvzjaSZ+srbkZB911l5Gfi
nWQm/8tsjaASAcGzbZ1OnltXxQef1K4qhrgZrxrOWW7xCWCAElNddY1lfekeahY6
NfiTfKvkTyLfzzEi22RQTAMviUVraHJ69FyTpMWro5qiZIke5FWXlGP/XeK45xTh
0wcs/CK/OzxHu8lAVNoZWqTZUXRXCTaq0oll3N1QqaK8kIsnB8k/NQ==
=QRsH
-END PGP SIGNATURE-


Re: [Dovecot] Bounce messages

2014-03-06 Thread Thanh Long DANG
Hi,

Please find enclose to this mail the configuration.

Thank you :-)

Best regards,
Long



From: thanhlong.d...@multidist.com
To: dovecot@dovecot.org
Subject: Bounce messages
Date: Wed, 5 Mar 2014 16:39:58 +

Hi,

I just set up my mail server using postfix / dovecot / mysql and it works well. 
I just have a problem : I'm a trying to have a overquota notification and the 
server sends nothing (mail server rejects incoming mail).

Could you tell me if there is a problem with dovecot or postfix configuration?

Kind regards,
Long

My conf :

# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-26-pve x86_64 Debian 7.2 simfs
auth_mechanisms = plain login
debug_log_path = /var/log/dovecot-debug.log
dict {
  quotadict = mysql:/etc/dovecot/dovecot-dict-sql.conf
}
disable_plaintext_auth = no
info_log_path = /var/log/dovecot-info.log
log_path = /var/log/dovecot.log
mail_location = maildir:/home/vmail/%d/%n:INDEX=/home/vmail/%d/%n/indexes
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf.ext
  driver = sql
}
plugin {
  quota = maildir:User quota
  quota_exceeded_message = Storage quota for this account has been exceeded, 
please try again later.
  quota_rule = *:storage=1G
  quota_rule2 = Trash:storage=+30%%
  quota_rule3 = Sent:storage=+30%%
  quota_warning = storage=90%% quota-warning 90 %u
  quota_warning2 = storage=75%% quota-warning 75 %u
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmas...@multidist.eu
protocols = " imap lmtp pop3"
quota_full_tempfail = yes
rejection_subject = Rejet: %s
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
}
service dict {
  unix_listener dict {
    mode = 0777
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0666
    user = postfix
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    mode = 0777
  }
}
ssl_cert = # 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-26-pve x86_64 Debian 7.2 simfs
auth_mechanisms = plain login
debug_log_path = /var/log/dovecot-debug.log
dict {
  quotadict = mysql:/etc/dovecot/dovecot-dict-sql.conf
}
disable_plaintext_auth = no
info_log_path = /var/log/dovecot-info.log
log_path = /var/log/dovecot.log
mail_location = maildir:/home/vmail/%d/%n:INDEX=/home/vmail/%d/%n/indexes
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf.ext
  driver = sql
}
plugin {
  quota = maildir:User quota
  quota_exceeded_message = Storage quota for this account has been exceeded, 
please try again later.
  quota_rule = *:storage=1G
  quota_rule2 = Trash:storage=+30%%
  quota_rule3 = Sent:storage=+30%%
  quota_warning = storage=90%% quota-warning 90 %u
  quota_warning2 = storage=75%% quota-warning 75 %u
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmas...@multidist.eu
protocols = " imap lmtp pop3"
quota_full_tempfail = yes
rejection_subject = Rejet: %s
service auth {
  unix_listener /var/spool/postfix/private/auth {
mode = 0666
  }
}
service dict {
  unix_listener dict {
mode = 0777
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0666
user = postfix
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
mode = 0777
  }
}
ssl_cert = 

Re: [Dovecot] Struggling with antispam

2014-03-06 Thread Alan Chandler

On 06/03/14 07:48, Alan Chandler wrote:


However, when I try to make this work with anitspam, I keep getting 
failure, and I can't work out what is causing it.  Maybe its again 
because I am running with uid 10001 when calling sendmail but I don't 
know.


antispam config is

plugin {
...



   antispam_pipe_program=/usr/bin/sendmail



Arrg:

I have been struggling with this all yesterday evening.  Two minutes 
after posting this I realise it is /usr/sbin/sendmail, not /usr/bin/sendmail


Sorry for the noise  (Although I would prefer to use the dspam backend 
if I could).


It is not working yet - postfix has rejected the mail because it came 
from an unknown sender (ds...@chandlerfamily.org.uk) I could use %u on 
the sender address - but then my sieve script to save outgoing mail 
would have to change to ignore mail aimed at the spam addresses.