dict SQL : HA / RR load-balancing ?

2014-08-25 Thread Florent Bautista

Hi everyone,

I am using Dovecot 2.2 with dict SQL.

My config is using :

connect = host=10.111.5.1X host=10.111.5.1Y host=10.111.5.1Z dbname=mail 
user=quota_updater password=


But when an SQL server is down, I have these messages in logs :

dict: Error: mysql(10.111.5.1Y): Connect failed to database (mail): 
Can't connect to MySQL server on '10.111.5.1Y' (111) - waiting for 125 
seconds before retry


Does Dovecot support HA / RR load-balancing in dict SQL, as in 
passdb/userdb ?


Thank you.


Re: dict SQL : HA / RR load-balancing ?

2014-08-25 Thread Reindl Harald

Am 25.08.2014 um 11:48 schrieb Florent Bautista:
 I am using Dovecot 2.2 with dict SQL.
 
 My config is using :
 
 connect = host=10.111.5.1X host=10.111.5.1Y host=10.111.5.1Z dbname=mail 
 user=quota_updater password=
 
 But when an SQL server is down, I have these messages in logs :
 
 dict: Error: mysql(10.111.5.1Y): Connect failed to database (mail): Can't 
 connect to MySQL server on '10.111.5.1Y'
 (111) - waiting for 125 seconds before retry
 
 Does Dovecot support HA / RR load-balancing in dict SQL, as in passdb/userdb ?

sadly no

postfix does and in case of all-inet it spreads even the usage
while a localhost source is preferred and only if that is not
available a fallback to a inet sql server happens

in case of postfix hosts = inet:10.111.5.1X inet:10.111.5.1Y
would work as expected, no idea why you can configure different
sql host in dovecot when no failover happens



signature.asc
Description: OpenPGP digital signature


IMAP Proxying to an Exchange Server

2014-08-25 Thread Ralf Hildebrandt
We're proxying IMAP to an Exchange server. One of my colleagues is
getting this when trying to save a message as Draft OR as Sent
items:

Aug 25 13:45:41 mproxy dovecot: imap(froemmel): Error: 
imapc(exchange-imap.charite.de:993): Command '7 APPEND EntwAPw-rfe (\Draft) 
{232572}' timed out, disconnecting
Aug 25 13:45:41 mproxy dovecot: imap(froemmel): Debug: 
imapc(exchange-imap.charite.de:993): Disconnected
Aug 25 13:45:42 mproxy dovecot: imap(froemmel): Error: imapc: COPY failed: 
Disconnected from server
Aug 25 13:45:42 mproxy dovecot: imap(froemmel): Disconnected: IMAP session 
state is inconsistent, please relogin. in=232719 out=826
Aug 25 13:46:07 mproxy dovecot: imap(froemmel): Error: 
imapc(exchange-imap.charite.de:993): Command '7 APPEND EntwAPw-rfe (\Draft) 
{232572}' timed out, disconnecting
Aug 25 13:46:07 mproxy dovecot: imap(froemmel): Debug: 
imapc(exchange-imap.charite.de:993): Disconnected
Aug 25 13:46:07 mproxy dovecot: imap(froemmel): Error: imapc: COPY failed: 
Disconnected from server
Aug 25 13:46:07 mproxy dovecot: imap(froemmel): Disconnected: IMAP session 
state is inconsistent, please relogin. in=232719 out=826

How can I debug this further? I cannot see which commands are sent by
Thunderbird...

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein


centos 6.x/7.x repos ?

2014-08-25 Thread Spyros Tsiolis
Hello all,

I believe someone has rpms for centos v6.x/7.x ?
I remember a link to a site somewhere ?
Are packages available for both i386 and 64-bit os's ??

tia,

s.



  

Re: OS X 10.6 Server - Dovecot Issue

2014-08-25 Thread Jeroen Scheerder

Quoth Ian Baker (23 Aug 2014, 18:17):

I've just taken over support for an OS X Server (v10.6.8) box, and am 
a bit new at Postfix  Dovecot.


[...]


And here is what a bounce looks like

Aug 22 07:29:28 mail postfix/local[93916]: error: od[getpwnam_ext]: No 
record for user sblondin
Aug 22 07:29:28 mail postfix/pipe[93944]: 852C43AE7ACC: 
to=sblon...@eem.ca, relay=dovecot, delay=15, delays=0.14/0.05/0/15, 
dsn=5.1.1, status=bounced (user unknown)


This looks familiar to me.

I've seen this happen when running Snow Leopard server as well, and 
recall tracing this back to Time Machine.


IIRC, Time Machine suspends directory services briefly while running.  
My wild guess is that this is probably by design, in order to create 
consistent database snapshots.  And since Time Machine runs quite often 
(in its default configuration), that doesn't do much good to services 
relying on permanent availability of AAA services.


If you're running Time Machine, try disabling it.  You can alter its 
schedule by hand, or you can use utilities like 
http://www.klieme.com/TimeMachineScheduler.html to coax it into a a 
more suitable (less disruptive) schedule.


Regards, Jeroen.
--
Jeroen Scheerder
ON2IT B.V.
Regterweistraat 7
4181 CE WAARDENBURG
T: +31 88 22 66 200 | F: +31 88 22 66 299
W: www.on2it.net| E: jeroen.scheer...@on2it.net


Re: Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Jochen Bern
On -10.01.-28163 20:59, Rick Thomas wrote:
 But a laptop that’s sometimes inside, sometimes outside doesn’t have
 a fixed port to connect to.  For those cases, I’d like the dovecot
 server to recognize the outside ports on the inside.

Well, if offering the *exact same* functionality on a second port is all
that needs to be done, having the server's host firewall (iptables?)
duplicate the NAT on your border firewall for internal accesses should
do just fine; no need to majick it into the dovecot config (which opens
the possibility of functional differences being introduced unintentionally).

Assuming Red Hat or similar with no conflicting iptables rules (yet),

# iptables -t nat -A PREROUTING -p tcp --dport 30xxx -j DNAT --to :143
# iptables -t nat -A PREROUTING -p tcp --dport 30yyy -j DNAT --to :993
# service iptables save

Regards,
J. Bern
-- 
*NEU* - NEC IT-Infrastruktur-Produkte im http://www.linworks-shop.de/:
Server--Storage--Virtualisierung--Management SW--Passion for Performance
Jochen Bern, Systemingenieur --- LINworks GmbH http://www.LINworks.de/
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel


Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Gedalya

On 08/24/2014 05:26 PM, Rick Thomas wrote:

Can I have multiple “service” clauses for the same service?  Each with a 
different port?
Or multiple “inet_listener imap”/“inet_listener imaps” clauses?
Or should I have something like this?
 port = 143,30143


This works:

service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imap2 {
port = 144
  }
  #inet_listener imaps {
  #  port = 993
  #  ssl = yes
  #}
}


Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Gedalya

On 08/25/2014 08:26 AM, Jochen Bern wrote:

Well, if offering the*exact same*  functionality on a second port is all
that needs to be done, having the server's host firewall (iptables?)
duplicate the NAT on your border firewall for internal accesses should
do just fine; no need to majick it into the dovecot config (which opens
the possibility of functional differences being introduced unintentionally).

Assuming Red Hat or similar with no conflicting iptables rules (yet),

# iptables -t nat -A PREROUTING -p tcp --dport 30xxx -j DNAT --to :143
# iptables -t nat -A PREROUTING -p tcp --dport 30yyy -j DNAT --to :993
# service iptables save

Regards,
Since you're redirecting to a port on the same host, the following is 
perhaps more correct:


iptables -t nat -A PREROUTING -p tcp --dport 30143 -j REDIRECT --to-port 143


Re: [Dovecot] Dovecot FTS using ElasticSearch

2014-08-25 Thread James Devine
Tim,

Had you made any progress on this?  We've been using elasticsearch to index
our mail backup for a while now and I am interested in possibly using it to
index our live mail as well.


On Wed, Jun 26, 2013 at 11:14 PM, Tim Groeneveld t...@timgws.com.au wrote:


 - Original Message -
  I would like to know if is possible to use ElasticSearch instead of
  Solr for FTS.

 I have started work on an ElasticSearch implementation based on fts-solr.

 There is still around 20-30 hours more work for me to do until it is
 complete
 (and I need to hunt down the reason for a random crash that happens every
 now and then) but I would be more then happy to share the code with you
 when I am done if you are interested?

 Regards,
 Tim



Special-Use Mailboxes ?

2014-08-25 Thread Per Jessen
Lots of people must have had this issue before me - users using
different devicessoftware (pc, smartphone, tablet, thunderbird,
outlook, webmail) and languages (e.g. English on the PC, German on the
iPhone), some folders end of with different names - e.g. Sent
and Gesendete Elemente - meaning the same thing, namely sent mails.

How do you map these to just one folder such that it shows up correctly
independently of what the user happens to be using? 

It sounds like something for the

mailbox Sent {
   special_use = \Drafts
}

config directive?  Is that what it might be used for?

mailbox Sent {
   special_use = \Sent
}
mailbox Gesendete Elemente {
   special_use = \Sent
}


-- 
Per Jessen, Zürich (12.9°C)
http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.


Re: centos 6.x/7.x repos ?

2014-08-25 Thread Pascal Volk
On 08/25/2014 12:00 PM, Spyros Tsiolis wrote:
 Hello all,
 
 I believe someone has rpms for centos v6.x/7.x ?
 I remember a link to a site somewhere ?
 Are packages available for both i386 and 64-bit os's ??

As mentioned at http://wiki2.dovecot.org/PrebuiltBinaries ATrpms exits
and can be used. They are providing
http://packages.atrpms.net/name/dovecot/ x86_64 RPMs and SRCRPMs (so
you can build your own i686 RPMs).


Regards,
Pascal
-- 
The trapper recommends today: cafebabe.1423...@localdomain.org


Re: Special-Use Mailboxes ?

2014-08-25 Thread Mihai Badici
On Monday 25 August 2014 21:03:26 Per Jessen wrote:
 Lots of people must have had this issue before me - users using
 different devicessoftware (pc, smartphone, tablet, thunderbird,
 outlook, webmail) and languages (e.g. English on the PC, German on the
 iPhone), some folders end of with different names - e.g. Sent
 and Gesendete Elemente - meaning the same thing, namely sent mails.
 
 How do you map these to just one folder such that it shows up correctly
 independently of what the user happens to be using?
 
 It sounds like something for the
 
 mailbox Sent {
special_use = \Drafts
 }
 
 config directive?  Is that what it might be used for?
 
 mailbox Sent {
special_use = \Sent
 }
 mailbox Gesendete Elemente {
special_use = \Sent
 }

I think metadata support can do the job (and more) . See Kolab project
-- 
Mihai Bădici
http://mihai.badici.ro


Re: Special-Use Mailboxes ?

2014-08-25 Thread Michael M Slusarz

Quoting Per Jessen p...@computer.org:


Lots of people must have had this issue before me - users using
different devicessoftware (pc, smartphone, tablet, thunderbird,
outlook, webmail) and languages (e.g. English on the PC, German on the
iPhone), some folders end of with different names - e.g. Sent
and Gesendete Elemente - meaning the same thing, namely sent mails.

How do you map these to just one folder such that it shows up correctly
independently of what the user happens to be using?

It sounds like something for the

mailbox Sent {
   special_use = \Drafts
}

config directive?  Is that what it might be used for?

mailbox Sent {
   special_use = \Sent
}
mailbox Gesendete Elemente {
   special_use = \Sent
}


Remember that SPECIAL-USE flags are informational.  A MUA remains free  
to do anything they want regarding where they save sent messages.


An option is to use virtual mailboxes to map to a single master Sent  
mailbox.  But you then have to define all possible combinations of  
Sent mailbox labels, so it's not foolproof either.


michael


Re: Special-Use Mailboxes ?

2014-08-25 Thread Per Jessen
Mihai Badici wrote:

 On Monday 25 August 2014 21:03:26 Per Jessen wrote:
 Lots of people must have had this issue before me - users using
 different devicessoftware (pc, smartphone, tablet, thunderbird,
 outlook, webmail) and languages (e.g. English on the PC, German on
 the iPhone), some folders end of with different names - e.g. Sent
 and Gesendete Elemente - meaning the same thing, namely sent
 mails.
 
 How do you map these to just one folder such that it shows up
 correctly independently of what the user happens to be using?
 
 It sounds like something for the
 
 mailbox Sent {
special_use = \Drafts
 }
 
 config directive?  Is that what it might be used for?
 
 mailbox Sent {
special_use = \Sent
 }
 mailbox Gesendete Elemente {
special_use = \Sent
 }
 
 I think metadata support can do the job (and more) . See Kolab project

Well, let's stick to dovecot for now - how do people deal with this
issue in dovecot?



-- 
Per Jessen, Zürich (12.9°C)
http://www.hostsuisse.com/ - dedicated server rental in Switzerland.


Re: Special-Use Mailboxes ?

2014-08-25 Thread Mihai Badici
On Monday 25 August 2014 21:23:57 Per Jessen wrote:
 Mihai Badici wrote:
  On Monday 25 August 2014 21:03:26 Per Jessen wrote:
  Lots of people must have had this issue before me - users using
  different devicessoftware (pc, smartphone, tablet, thunderbird,
  outlook, webmail) and languages (e.g. English on the PC, German on
  the iPhone), some folders end of with different names - e.g. Sent
  and Gesendete Elemente - meaning the same thing, namely sent
  mails.
  
  How do you map these to just one folder such that it shows up
  correctly independently of what the user happens to be using?
  
  It sounds like something for the
  
  mailbox Sent {
  
 special_use = \Drafts
  
  }
  
  config directive?  Is that what it might be used for?
  
  mailbox Sent {
  
 special_use = \Sent
  
  }
  mailbox Gesendete Elemente {
  
 special_use = \Sent
  
  }
  
  I think metadata support can do the job (and more) . See Kolab project
 
 Well, let's stick to dovecot for now - how do people deal with this
 issue in dovecot?

You mean not people, but mail clients. There are plugins for roundcube, 
thunderbird ( ugly) kontact.  Folders are annotated as: mail, contacts, 
calendar etc. You can associate each folder with an annotation, as, let say, a 
label. But your client need to read that annotation.

In fact as I know Roundcube can do a translation of folder names ( you can 
asign Sent Mails as Gesendete Elemente in it's config) but if you want a 
more complex solution I think metadata is the right (and heavy) way.

-- 
Mihai Bădici
http://mihai.badici.ro


Re: Special-Use Mailboxes ?

2014-08-25 Thread Mihai Badici

  
  I think metadata support can do the job (and more) . See Kolab project
 
 Well, let's stick to dovecot for now - how do people deal with this
 issue in dovecot?

What i missed is that the metadata support is available in dovecot starting 
from 2.2.9 if i remember exactly.
-- 
Mihai Bădici
http://mihai.badici.ro


Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Rick Thomas

Thanks! Gedalya and Jochen!

I hadn’t realized I could do that with iptables.  I’ll read-up on the 
documentation.

Rick

On Aug 25, 2014, at 5:38 AM, Gedalya geda...@gedalya.net wrote:

 On 08/25/2014 08:26 AM, Jochen Bern wrote:
 Well, if offering the*exact same*  functionality on a second port is all
 that needs to be done, having the server's host firewall (iptables?)
 duplicate the NAT on your border firewall for internal accesses should
 do just fine; no need to majick it into the dovecot config (which opens
 the possibility of functional differences being introduced unintentionally).
 
 Assuming Red Hat or similar with no conflicting iptables rules (yet),
 
 # iptables -t nat -A PREROUTING -p tcp --dport 30xxx -j DNAT --to :143
 # iptables -t nat -A PREROUTING -p tcp --dport 30yyy -j DNAT --to :993
 # service iptables save
 
 Regards,
 Since you're redirecting to a port on the same host, the following is perhaps 
 more correct:
 
 iptables -t nat -A PREROUTING -p tcp --dport 30143 -j REDIRECT --to-port 143
 


Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Rick Thomas

OK, project for today: Give this a try…

Rick

On Aug 25, 2014, at 5:34 AM, Gedalya geda...@gedalya.net wrote:

 On 08/24/2014 05:26 PM, Rick Thomas wrote:
 Can I have multiple “service” clauses for the same service?  Each with a 
 different port?
 Or multiple “inet_listener imap”/“inet_listener imaps” clauses?
 Or should I have something like this?
 port = 143,30143
 
 This works:
 
 service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imap2 {
port = 144
  }
  #inet_listener imaps {
  #  port = 993
  #  ssl = yes
  #}
 }
 


Re: Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Jochen Bern
On -10.01.-28163 20:59, Gedalya wrote:
 On 08/25/2014 08:26 AM, Jochen Bern wrote:
 Assuming Red Hat or similar with no conflicting iptables rules (yet),
 # iptables -t nat -A PREROUTING -p tcp --dport 30xxx -j DNAT --to :143
 
 Since you're redirecting to a port on the same host, the following is
 perhaps more correct:
 iptables -t nat -A PREROUTING -p tcp --dport 30143 -j REDIRECT --to-port 143

The operational word being perhaps. My approach will break if the
server does any forwarding, yours will break if dovecot listens only on
a secondary IP address, or at least that's what the manpage I grabbed
off a CentOS 6 says:

 REDIRECT
 [...] It redirects the packet to the machine itself by changing the
 
 destination IP to the primary address of the incoming interface
  ^^###
 (locally-generated packets are mapped to the 127.0.0.1 address).

Regards,
J. Bern
-- 
*NEU* - NEC IT-Infrastruktur-Produkte im http://www.linworks-shop.de/:
Server--Storage--Virtualisierung--Management SW--Passion for Performance
Jochen Bern, Systemingenieur --- LINworks GmbH http://www.LINworks.de/
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel


Re: How to configure dovecot imap to listen on multiple ports?

2014-08-25 Thread Gedalya

On 08/25/2014 05:17 PM, Jochen Bern wrote:

On -10.01.-28163 20:59, Gedalya wrote:

On 08/25/2014 08:26 AM, Jochen Bern wrote:

Assuming Red Hat or similar with no conflicting iptables rules (yet),
# iptables -t nat -A PREROUTING -p tcp --dport 30xxx -j DNAT --to :143

Since you're redirecting to a port on the same host, the following is
perhaps more correct:
iptables -t nat -A PREROUTING -p tcp --dport 30143 -j REDIRECT --to-port 143

The operational word being perhaps. My approach will break if the
server does any forwarding, yours will break if dovecot listens only on
a secondary IP address, or at least that's what the manpage I grabbed
off a CentOS 6 says:
That REDIRECT rule can definitely not be used in that exact form if the 
machine does forwarding. It will make anyone trying to reach port x 
on any destination arrive at this IMAP server, unless you add a 
condition such as -d 192.168.x.x
Indeed, if the machine is also a router and dovecot only listens on a 
specific IP address then you would have to use DNAT to specify the 
destination IP address and port.
Perhaps the use of the word correct was wrong, REDIRECT is just 
typically used in such cases where the machine is anyway not a router so 
it's kind of a more readable way to say redirect this traffic from this 
machine itself to this machine itself, although REDIRECT is generally 
intended to be used on a router to force traffic _not_ destined for this 
machine to go to this machine, e.g. setting up a transparent proxy.


So you can say:
iptables -t nat -A PREROUTING -p tcp -d 192.168.1.11 --dport 30143 -j 
REDIRECT --to-port 143

Or:
iptables -t nat -A PREROUTING -p tcp -d 192.168.1.11 --dport 30143 -j 
DNAT --to-destination xx.xx.xx.xx:143


The latter redirects traffic destined to a specific IP address and port, 
192.168.1.11:30143, to a specific IP address and port (presumably on the 
same host, or not..).






REDIRECT
[...] It redirects the packet to the machine itself by changing the

  

destination IP to the primary address of the incoming interface

   ^^###

(locally-generated packets are mapped to the 127.0.0.1 address).

Regards,
J. Bern


Re: Special-Use Mailboxes ?

2014-08-25 Thread Per Jessen
Mihai Badici wrote:

 
  
  I think metadata support can do the job (and more) . See Kolab
  project
 
 Well, let's stick to dovecot for now - how do people deal with this
 issue in dovecot?
 
 What i missed is that the metadata support is available in dovecot
 starting from 2.2.9 if i remember exactly.

Okay, I'll have a closer look, thanks. 



-- 
Per Jessen, Zürich (12.9°C)
http://www.dns24.ch/ - your free DNS host, made in Switzerland.


Re: Special-Use Mailboxes ?

2014-08-25 Thread Mihai Badici
On Tuesday 26 August 2014 07:44:04 Per Jessen wrote:
 Mihai Badici wrote:
   I think metadata support can do the job (and more) . See Kolab
   project
  
  Well, let's stick to dovecot for now - how do people deal with this
  issue in dovecot?
  
  What i missed is that the metadata support is available in dovecot
  starting from 2.2.9 if i remember exactly.
 
 Okay, I'll have a closer look, thanks.

You can use the config from here  to enable metadata ( only as an example): 
http://mihai.badici.ro/linux/machinet/debian/machinet-debian.tgz

But the client implementation... is on you :)

-- 
Mihai Bădici