Mail for email loops back to myself
Mail for email loops back to myself
Mail loops back to my self
I know there is a bunch of questions like that. But no one has the same scenario as described here. Here is the scenario.
I have a static IP. I am setting my postfix mail server in a virtual machine. My static IP is defined in one interface of my server. My server is my host for virtual machine also. I have a MASQUERADE jump in my iptables for traffic between the 2 interfaces of my server. To sum up, my server has 2 interfaces. One of them with the static public IP and the other with a static internal IP(192.168.1.0/24).
My postfix mail server is identified by the IP 192.168.1.4. I am able to receive emails from outside and send emails internally. But, all my emails send to external mail providers(yahoo, hotmal,gmail..) are returning back as undelivered. It seems the email is going out. It is not been refused(I think). It is been bounced after have been sent.
What is making me thinking like that is the mail log. as you can see in the log below, the line with ** is indicating the email was sent.
After get the status sent and the removed line in the log, the system start to get the loop back email.
Here is my main.cf
The domains are configured in mysql database. For domains I have the following lines:
I have a internal DNS also. The DNS server is other virtual machine hosted by my server. The ip for my dns server is 192.168.1.3. It is responsible to translate internal names. If do not able to translate, it forward to my ISP DNS.
Here is the message I am getting back from gmail as example
These are my iptables rules:
I believe it is all details I have. I am sure you will try to help me. But, please, I am sure it is not a mydestination issue. Please, do not answer me telling I have to work with mydestination values. The problem is not that. I am sure. When the error is with mydestination values, the postfix Diagnostic code shows an internal domain. Beside, this is not a backup email. It is not a relay server. It is a master mail server. The same configuration was working fine when I had a dynamic IP. It stop working when I migrate it to a static solution.
My question is, why external emails are been sent, but the providers is refusing it and looping back to my mail server?
Report on non-delivery to another (non-Yandex) address
If you have sent a message from your Yandex mailbox but it has been rejected by the recipient’s mail server, you will get an automatic report from “Mailer-Daemon” with reasons for non-delivery and the name of the server which rejected passing the message to its destination.
The reason for why the email was not received will be indicated in the automatic report. How to find and interpret the error:
Bad destination mailbox address
Bad destination system address
Bad destination mailbox address syntax
DNS: no such domain
Host or domain name not found
No such user here
The email account that you tried to reach does not exist
The email was sent to a non-existing address.
Make sure the recipient’s address does not include extra punctuation marks, spaces, or quotation marks. Confirm the recipient’s email address and resend the message.
Message rejected as spam by Content Filtering
Message rejected under suspicion of SPAM
Message rejected. See http://mail.google.com/support/bin/answer.py?answer=69585 for more information
Sorry, message looks like SPAM to me
The recipient’s email server considers these messages spam.
Try contacting the recipient or their mail service administration by another method and report the problem.
If you are sending legitimate messages to your website users or subscribers, please read Yandex requirements for honest mailing lists.
Аccount is full
Error writing message: Disk quota exceeded
Recipient’s mailbox is full
User has exhausted allowed storage space
The recipient’s mailbox is full. This usually happens because the recipient does not use their mailbox often and their mailbox is full.
Try contacting the recipient by another method and report the problem.
Policy rejection on the target address
This account has been disabled or discontinued
User account disabled for being inactive
Your emails has been returned because the intented recipient’s email account has been suspended.
The recipient’s address is blocked by their email service.
Try contacting the recipient by another method and report the problem.
Message size exceeds fixed limit
Message size exceeds fixed maximum message size
The recipient’s email server can’t handle large messages. The recipient’s email service can’t accept your email due to restrictions regarding your attached files.
Upload your attachment to a file storage service (such as Yandex.Disk) and include a link to it in your message.
Client host [ IP_host ] blocked using bl.spamcannibal.org; blocked, See: http://www.spamcannibal.org/cannibal.cgi?page=lookup&lookup= IP_host
Client host [ IP_host ] blocked using dnsbl-1.uceprotect.net; IP IP_host is UCEPROTECT-Level 1 listed. See http://www.uceprotect.net/rblcheck.php?ipr= IP_host
Email blocked by SPAMCANNIBAL — to unblock see.
Email from IP_host is currently blocked by Verizon Online’s anti-spam system
Recipient address rejected: Blocked by external RBL
Your host [ IP_host ] is blacklisted by dnsbl.sorbs.net. Currently Sending Spam See: http://www.sorbs.net/lookup.shtml? IP_host
Your server IP address is in the bl.spamcannibal.org database
The Yandex mail server was blacklisted. You can try deleting the Yandex mail server address from the blacklist manually by clicking on the link in the report. You can also contact us by forwarding the full text of the error report using the form below.
Also, try contacting the recipient or his/her mail service administration by another method and report the problem.
Loop detected! Message rejected
Mail for email loops back to myself
Our servers have detected a mail loop
A loop was detected in sent messages. Check forwarding filters and importers for all of your mailboxes. They may be configured incorrectly. If you are sure the problem is not on your end, contact the recipient by an alternate means of communication to report the problem.
Relay not permitted
Sorry, relaying denied from your location
Forwarding prohibited (the recipient’s mail server can’t identify Yandex.Mail servers because the MX records are not configured properly).
Try contacting the recipient or their mail service administration by another method and report the problem.
Postfix «loops back to myself» only when trying to send to fallback relay
I have read the many answers to many similar questions, but have not found exactly this question or any answer that helped.
I have a Postfix 2.11 server ( mail-server.example.com ) that is strictly for outgoing email. It works fine if it is able to send the email on the first try. However, for performance reasons, if it cannot send the email on the first try and instead wants to defer it, I have configured smtp_fallback_relay so that it forwards the email to another server ( deferred-mail.example.com ) that handles only deferred emails.
So both servers are configured to accept mail and relay it to Gmail if the client is trusted, and the deferred-mail trusts mail-server (I can send to a Gmail address when directly connecting to deferred-mail from `mail-server), so how is Postfix coming up with this «loop» and why is it bouncing the email instead of relaying it?
Update and clarification about the logs below.
This setup was copied from a working email cluster. I am confident that it is theoretically sound, and suspect it is just a matter of some setting not being correctly replaced or translated. It is just that with this odd behavior and seemingly incorrect error message, I cannot figure out what to change, and that is why I am asking for help.
When sending emails via SMTP, the sender begins by identifying itself by host name. Big mail processors like Gmail and Yahoo take several steps to assess the reputation of the sender. With IPv4, two of the first things they did were
If the IP address has a bad reputation or the reverse DNS does not match the sender host name, the receiver would be much more likely to mark the email as Spam regardless of anything else.
For both these reasons, both mail-server.example.com and deferred-mail.example.com are behind the same NAT Gateway that
Our server stack does not currently have IPv6 enabled. Because we are using a new domain name, we have zero domain reputation, so we want to stick to IP reputation until we have a solid domain reputation established. (Because IPv6 addresses are disposable, they will never be an adequate basis for reputation.)
Не могу получать почту для root на внешний ящик
Ребят, я видимо старый стал. Никогда не сталкивался, но не могу решить казалось бы простейшую задачу.
Добавил задачку в cron, но никак не могу заставить перенаправлять выхлоп из cron на свой ящик.
Что делаю не так?!
Какой-то запор именно в root и его алиасе похоже? Как слать всё то, что идет root на внешнюю почту используя postfix + ubuntu 20.04
Путем не ясного гуглинга, сделал не очень понимаю чего, но заработало:
То есть, нужно было fqdn поставить в mydestination. Почему так, не знаю. Кто знает отпишитесь. 🙂
потому что postfix должен считать домен своим и тогда гн не пытается отправить письмо в миряэ, а кладет себе и если у него нет других механизмов, то кладет он локальным юзерам. а считать домен своим он может либо если он прописан в mydistanations, либо в виртуальных доменах.
to=root@rdiff.company.ru, relay=none, delay=0, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for rdiff.company.ru loops back to myself
да, так как домен типа не его,то он хотел отправить наружу, стучится на mx rdiff.company.ru и видит сам себя. вот и loop.
У меня нет MX записи для этой машинки 🙂 Я просто хочу посмотреть на самом деле как rdiff-backup будет работать с миллионами мелких файлов. И за одно решил настроить уведомления, так-как у меня весьма не малый набор данных. Что бы хоть постучало «ок или не ок» 🙂 по окончании. Я хотел было tcpdump уже смотреть куда это чудо лезет в попытке отправить email фиг пойми куда. В общем, сенкс, сенкс, сенкс!
У меня нет MX записи для этой машинки 🙂
Common Problems
Here we list common problems and possible solutions:
Mail loops back to myself¶
Please check in your mailcow UI if you made the domain a backup MX:
I can receive but not send mails¶
There are a lot of things that could prevent you from sending mail:
My mails are identified as Spam¶
Please read our guide on DNS configuration.
docker-compose throws weird errors¶
When you encounter one or similar messages while trying to run mailcow: dockerized please check if you have the latest version of Docker and docker-compose
Container XY is unhealthy¶
This error tries to tell you that one of the (health) conditions for a certain container are not met. Therefore it can’t be started. This can have several reasons, the most common one is an updated git clone but old docker image or vice versa.
A wrong configured firewall could also cause such a failure. The containers need to be able to talk to each other over the network 172.22.1.1/24.
It might also be wrongly linked file (i.e. SSL certificate) that prevents a crucial container (nginx) from starting, so always check your logs to get an idea where your problem is coming from.
Address already in use¶
If you get an error message like:
while trying to start / install mailcow: dockerized, make sure you’ve followed our section on the prerequisites.
Please check your local firewall! Docker and iptables-based firewalls sometimes create conflicting rules, so disable the firewall on your host to determine whether your connection issues are caused by such conflicts. If they are, you need to manually create appropriate rules in your host firewall to permit the necessary connections.
If you experience connection problems from home, please check your ISP router’s firewall too, some of them block mail traffic on the SMTP (587) or SMTPS (465) ports. It could also be, that your ISP is blocking the ports for SUBMISSION (25).
To enable telnet on a Windows after Vista please check this guide or enter the following command in an terminal with administrator privileges:
Inotify instance limit for user 5000 (UID vmail) exceeded (see #453)¶
Docker containers use the Docker hosts inotify limits. Setting them on your Docker host will pass them to the container.
Dovecot keeps restarting (see #2672)¶
Check that you have at least the following files in data/assets/ssl :
Источники информации:
- Magic tree and i let myself go перевод
- Make a change kill yourself