Костырев Александр Алексеевич
2013-May-08 01:24 UTC
[Dovecot] sieve redirect envelope address problem
Good day! I have a problem with mail redirection through sieve rules. I've configured sieve rule that redirects any mail coming to user to gmail mailbox (or whatever external mail system there is). But when sieve redirects any mail it puts vmail@%dovecot_hostname% into envelope address, gives it to my exim for delivery and gmail rejects my mail because user vmail@%dovecot_hostname% do not exist. Please, advice for what can be done about this behavior. my `doveconf -n` http://pastebin.com/0dyL9Jgs Thanks in advance! -- ? ?????????, ???????? ????????? ????????????? Linux-??????
Am 08.05.2013 03:24, schrieb ???????? ????????? ??????????:> Good day! > > I have a problem with mail redirection through sieve rules. > I've configured sieve rule that redirects any mail coming to user to gmail mailbox (or whatever external mail system there is). > But when sieve redirects any mail it puts vmail@%dovecot_hostname% into envelope address, gives it to my exim for delivery and gmail rejects my mail because user vmail@%dovecot_hostname% do not exist. > Please, advice for what can be done about this behaviorif you say "any mail coming to user" why do you implent the forwarding in dovecot/sieve instead directly on the MTA? i am using postfix, so no idea how to implement it in exim but i have on asverer 9000 forwarders which never touch the LDA at all and directly forwarded from the MTA -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20130508/3a9b2a65/attachment.bin>
At 12PM +1100 on 8/05/13 you (???????? ????????? ??????????) wrote:> > I have a problem with mail redirection through sieve rules. > I've configured sieve rule that redirects any mail coming to user to > gmail mailbox (or whatever external mail system there is). > But when sieve redirects any mail it puts vmail@%dovecot_hostname% > into envelope address, gives it to my exim for delivery and gmail > rejects my mail because user vmail@%dovecot_hostname% do not exist. > Please, advice for what can be done about this behavior.Sieve should be submitting the mail to the outbound SMTP with the same envelope address as it had coming in (that is, this is a true SMTP redirect, not an SPF-compatible resending-from-a-new-address). I think your SMTP server must be rewriting this based on the uid of the LDA process; this is not something Dovecot can do anything about. To test this you can run sendmail(8) with the -f switch as the vmail user: if the address you specify is rewritten, then the problem is not with Dovecot. You need to fix this in your SMTP configuration, somehow. Decide what your policy is about the envelope sender of outbound mail: are you going to rewrite to @your.domain, which is SPF-compatible but messes up bounces; or are you going to leave it alone, which is what a sieve redirect is supposed to do but which can cause problems if the original sender publishes an SPF policy and the final recipient checks it (neither of which you can control)? There are a number of other variously-unpleasant alternatives, like SRS (which attempts to preserve the original sender while still only sending mail from @your.domain), but basically none of this is specific to sieve or Dovecot. Find out what happens if mail is forwarded in the ordinary way by your MTA, and then work out how to get the MTA to do that for any mail submitted by the 'vmail' user. Ben