New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forward not working for me #26
Comments
First thank you for the SES idea, i just opened #27 for this purpose. Regarding your forwarding issue, I remember we had an issue with the forwarding sieve script a month ago, did you pull the latest IMAP image? If you did, could you please grab the logs from both your SMTP and IMAP container around the time you send the test email that does not seem to be forwarded? Forwarding is actually handled by the IMAP container using sieve scripts, then the SMTP container takes care of sending the outgoing message (as opposed to aliases, that are handled directly by the SMTP server). In you IMAP log, you should see something in the lines of:
The message is first forwarded by the sieve script then delivered locally by the LDA (the forwarding feature forwards a copy of the email, if you prefer emails not to be delivered locally, you should use an alias instead of a user). Then on the SMTP container:
First the message is delivered locally (forwarded to Dovecot using LMTP), then the forwarded message queued by the IMAP container is sent to Gmail. |
I have noticed now that sometimes, with normal emails (without forwarding), I get this error with the relayhost, then the email isn't sent:
I think that this is due to IPv6 problem in DNS (AAAA registry), but some time later I get this log in postfix:
The email is sent correctly throught Amazon SES relayhost. In my main.cnf file in postfix containter, I have:
On the another hand, I get correct imap/dovecot logs when I send email for forward (forwarding emails with copy in the server, i.e. user, not alias):
But I encounter the same error in postifix logs:
In this case I never received the forward email. If I run nslookup from postfix container I get:
If I run it from server:
I tried install drill (a dig-like for Alpine) but I get this error:
Ok, if we can solve this problem, I could help you to implement it in the project and complete the #27 feature, if you want ;) Thanks for all. |
Sorry about the delay. What you are describing is very similar to an issue that I have recently been experiencing on some Docker 1.11 servers with containers performing a lot of DNS queries (including my Postfix servers). It is not related to Freeposte but to Docker itself on containers that tend to perform many DNS queries. Docker 1.11 introduced per-container UDP socket caching for DNS queries. There is a bug in the initial implementation, where a late reply is not flushed from the DNS socket, but then forwarded as a reply to the next request, and subsequent replies are shifted. When the wrong reply is forwarded, it is ignored by the container DNS stack because the reply id does not match, leading to a timeout. More details on the issue thread: moby/moby#22185 . The issue was fixed two days ago and the patch is available in a Docker RC. Until the patch is introduced into stable, the suggested workaround consists in enabling the
Then restart your containers. |
Thank you for your response. I added Now I understand better the issue. There are two different problems. These problems only happen with Amazon relayhost configured. (I configured this way) First problem. When I send an email from a verified SES domain, this has a "random" behavior of DNS resolve, sometimes through this error:
Sometimes this another error:
Sometimes it works fine (smtp response code 250):
I was trying to resolve this error with this topic of serverfault, changing the protocol to IPv4 with
I was trying with another postfix server in a docker container and this error don't happen. Therefor I don't know if this problem is due to a docker bug or a another issue related a DNS configuration. Second problem (initial problem). I want to send and receive emails with my Gmail client. I can send through Postfix smtp container, but I want receive through Postfix forward feature or IMAP (Gmail don't let to act itself how a IMAP client). Postfix forward email if sender account is from my domain, i.e. it is verified, but I can't forward emails from external accounts with SES (either keeping copy of email in server, alias or virtual), this happens when I try:
These days I was reading and It is due to Amazon SES restrictions. Only verified domains can send emails through SES, and when I use a relay feature, really I am send from external domain (e.g. gmail.com). I have the same problem that there in serverfault here and here I don´t know which is the best solution to implement:
Do you think about this? |
Ok, I solved the second problem. I was reading about transport maps and I saw that transport maps only can relay to others hosts based in recipient destination addresses or domains... so that wasn't what I wanted. Then I found the next entry for main.cf: sender_dependent_relayhost_maps, this entry is how transport_maps but based on sender. That is the solution. I tested it and it works. |
Very nice about the second problem. I will think about embedding common settings or the ability to set specific postfix options from the main Regarding the first problem, I set up a lab server talking to SES and I am unable to reproduce for now. Could you share your Docker version ( Finally, I still cannot understand your use case exactly. You are trying to send emails with your |
Yes, the ability to set specific postfix options from the main freeposte.env file I think that is a great idea, even including a config folder with dovecot config files, postfix config files (main.cf and eventual lookup tables file for some entries) , etc. and when recreating the containers, this entries of these config files override the entries of main configuration. If this files are empty then we do nothing. My docker server and client are in the same host (ubuntu 14.04) and they have the same version:
But, I have good news, I rebuilt the containers and this problem disappeared. It may to be that I changed some configuration in postfix (searching a forward solution) but now it works perfectly. Ok, I explain better my case. I am trying to send emails with my web gmail client as a MUA through Postfix (configured to relay to Amazon SES - I want to use web Gmail client as MUA also for retrieve my mails through IMAP (I don't want to use another MUA, as Roundcube webmail) but this is not possible because Gmail only lets to check mail from other accounts using POP3 (as I think to have understood). Then the solution is forwarding all inbound mail to my @gmail.com account. Amazon SES has a restrictions, only verified domains are allowed to relay mail. So when arriving a email from a external domain (e.g. @yahoo.com) to @mydomain.com, Postfix delivery the message to the LDA (dovecot) and It message is saved to inbox. Until then everything right. Next the forwarded message queued by the LDA container is sent through MTA Postfix to my @gmail.com account (relayed through Amazon SES). And here is the problem. SES don't let delivery mails from unverified domains as @yahoo.com, so reject this message with
I solved this problem with I hope I explained better. |
Okay, thank you very much for the details. I do understand the use case now. Indeed I see no other solution than forwarding to your GMail account (the mobile application has an embedded IMAP client but I don't think the Web client does). Regarding the custom configuration files and/or environment variables, I'll paste your ideas to the other issue. Thank you. |
Thank you very much for all @kaiyou, I will follow this project very close and I will help if I can. |
I think I found the solution to my first problem, I think that it was due to a bad configuration of main.cf in |
Could you elaborate on the problem? I thought forwarding was working fine again? Regarding the CAfile, you should be using the system CA, but I think that the default value is fine on Alpine, so you should not need to override it if you plan on using standard CA certificates. |
Yes, forwarding works fine. No problem with this. I just wanted to know what happened with the first problem and why, to finally close the issue, because I wanted to be sure that this problem doesn't occur anymore. I tested and I noticed that the problem was that I had followed step by step Amazon instructions to configure integration Postfix with SES:
How I didn't understand if the CAfile override was necessary, then I overrided this. That was the problem, now I understand this and I think like you, that the default value on Alpine is perfect and it works fine. So all good. |
First, great job with this project!
I configured SES in the postfix container. Then, in my freeposte.db I see with SQLite that I have forward_enabled = 1 and forward_destination filled with my gmail account, but not working. When I send an email, it not forwarded... can you help me?
The text was updated successfully, but these errors were encountered: