Re: Pigeonhome Sieve: check existence of a folder?
Hello, Thank you for your answer. That's what I tried at first, but got error message from the editor (tb60+sieve) Seems to be ok now. Thanks for the help, I tried*mailboxexists("xxx")* instead of*mailboxexists "xxx"* which I did not find as such n the doc. Cheers On 2/28/19 11:37 AM, Martin Johannes Dauser via dovecot wrote: What about extension "mailbox"? https://wiki.dovecot.org/Pigeonhole/Sieve https://tools.ietf.org/html/rfc5490#section-3 A simple example (not tested, but should work): note: + I use '/' instead of '.' as hierarchical separator + stop; stops the whole script, but you could use elsif instead. require ["fileinto", "mailbox"]; if header :contains "header's name" "aaa" { if mailboxexists "INBOX/aaa" { fileinto "INBOX/aaa"; stop; } } if header :contains "header's name" "def" { if mailboxexists "INBOX/def" { fileinto "INBOX/def"; stop; } } Greetings Martin On Thu, 2019-02-28 at 10:42 +0100, AvV via dovecot wrote: Dear All, Thanks ofr the great job so far. I have crawled the doc & web, and did not find oh to check for the presence of a folder ina a mailbox? I know about "fileinto :create" of course, but the purpose is slightly different: I want to automate the move into a folder based on some rules but *only if* an associated folder is present (which name is based on the rule), otherwise I will do a form of catch-all. Example: - INBOX +- abc +- def - Rule detects "aaa" in someheader field: folder "aaa" not present" -> continue; - Rule detect "def" in some header field: "def exists" -> fileinto "def" ; stop; Any help appreciated. Cheers, A/
Re: migrating/cloning 2.2 > 2.3?
On Sun, 3 Mar 2019 at 08:29, Voytek Eymont via dovecot wrote: > > > 11:30:12 auth-worker(32307): Warning: sqlpool(mysql): Query failed, > > retrying: Unknown column 'mailbox.enableimaptls' in 'where clause' > > Mar 03 11:30:12 auth-worker(32307): Error: > > sql(voy...@sbt.net.au,110.175.246.167,): User query > > failed: Unknown column 'mailbox.enableimaptls' in 'where clause' > > I've found a page with SQL table mods that seems to have fixed some of my > issues, after modifying SQL, I can log in > > Mar 03 16:23:34 master: Info: Dovecot v2.3.4.1 (3c0b8769e) starting up for > pop3, > imap, sieve (core dumps disabled) > Mar 03 16:23:56 config: Warning: please set ssl_dh= Mar 03 16:23:56 config: Warning: You can generate it with: dd > if=/var/lib/doveco > t/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > > /etc/dovecot/d > h.pem > Mar 03 16:23:57 imap-login: Info: Login: user=, > method=PLAIN, > rip=110.175.246.167, lip=103.106.168.106, mpid=2757, TLS, > session=<283B2CmDccdu > r/an> > > I'll do the dh.pem next > > //these are SQL mods I've done > > ALTER TABLE mailbox ADD COLUMN enableimaptls TINYINT(1) NOT NULL DEFAULT 1; > ALTER TABLE mailbox ADD INDEX (enableimaptls); > ALTER TABLE mailbox ADD COLUMN enablepop3tls TINYINT(1) NOT NULL DEFAULT 1; > ALTER TABLE mailbox ADD INDEX (enablepop3tls); > ALTER TABLE mailbox ADD COLUMN enablesievetls TINYINT(1) NOT NULL DEFAULT > 1; > ALTER TABLE mailbox ADD INDEX (enablesievetls);// > > -- > Voytek > > What you did is quite practical. All you have to do is: 1. Make sure the static files named in the configs are moved to the destination server 2. All account names used in Dovecot config are adjusted or created in the destination server and the permissions/access levels are right 3. Dump mysql database and import the dump in the destination server I have done the same before, and just made sure that I went through all the files in /etc/dovecot/ with a toothcomb. I've missed one or two things depending on the level of distraction/concentration (which is normal), but it always ends up working, especially if the migration is about the same domain names. That is how it's supposed to work with virtual users I suppose. Regarding your MySQL issues, you'll notice that we all have different MySQL schemas out here, Unless the one you refer to is the standard one for CentOS, every man to their own when it comes to virtual users :) -- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", grep ^[^#] :-)
Re: Unexpected behavior with sieve_vacation_to_header_ignore_envelope = yes
Hello Stephan, Am 03.03.2019 um 00:50 schrieb Stephan Bosch via dovecot:> > > Op 27/02/2019 om 13:30 schreef Matthias Petermann via dovecot: >> Hello, >> >> we face an issue with the vacation extension of pigeonhole. Our >> upstream mail server (from which we pull our E-Mails with POP3) uses >> SPF and performs a SRS re-write of the Return Path. Once the mail is >> processed via our local postfix, it is delivered via dovecot deliver >> (using the lda). When the recipient has a vacation rule enabled in >> sieve, the out-of-office note cannot be sent, as pigeonhole tries to >> use the Return-Path (which is not accepted as sender by the mail server). >> >> We are using the following dovecot / pigeonhole versions: >> >> dovecot-2.3.2.1 >> dovecot-pigeonhole-0.5.2 >> >> As of my understanding, the problem was addressed in pigeonhole >> version v0.4.21 by introducing the >> sieve_vacation_to_header_ignore_envelope setting. Anyway - even when >> this is set to "yes" pigeonhole still uses the Return-Path instead of >> the "From:" header which I had expected: >> >> Feb 27 13:22:26 mail dovecot: >> lda(customer)<48383><3o+yOQGBdlz/vAAAZU03Dg>: Error: sieve: >> msgid=: failed >> to send vacation response to >> SRS0=gwGXg6ad=RC=petermann-it.de=matth...@example.com: > program returned error> (temporary error) >> >> Are my expectations wrong or did I miss some precondition? > > That setting is only about the composition of the "To:" header for the > outgoing vacation message (it's in the name). It has nothing to do with > the RCPT TO envelope address used for that message. Why exactly do the > mail servers reject the vacation message (I am not too familiar with SRS). Thanks for the clarification. In the postfix log, it states the following reason for rejection: Mar 3 08:34:34 mail postfix/smtpd[28049]: NOQUEUE: reject: RCPT from unknown[10.0.0.2]: 550 5.1.1 : Recipient address rejected: User unknown; from=<> to= proto=ESMTP helo= So it seems that the RCPT TO is rejected because the server (relay) doesn't accept the SRS adress as recipient. Is there any way to manipulate the RCPT TO from pigeonhole to match the To header? Seems like I have to look into postfix if there is a way to decode the RCTP TO. Unfortunately, I am still not too knowledgeable about SRS, but will try to find out more. Best regards, Matthias -- Matthias Petermann