Hello. I have a discourse without a docker on my local server. Also installed iRedMail. First I tried to use an smtp-server from mail.ru. Test messages were sent, as well as invitations. But no email notifications came in, and the password was reset. I decided that I should install my local mail server and see the logs there why messages do not leave. I did. Local messages come between mailboxes. That’s what you need for testing. Thought it would be enough for local discourse and mail. Set your local smtp server. Sent a test email… and it got there! Winner(no). Looked at /var/log/mail.log of the mail server.
Okay. Now I’m sending an invitation to the same box… Looking at the mail server logs… …and nothing. It’s empty. I don’t know what the problem is.
All I’m asking is a “how-to” get discourse to speak to postfix.
Right now I have an active admin account by manually enabling it cause, you guessed it, I didn’t get the verification email. I’ll provide any files such as settings and logs upon request.
Normally when we have these kind of problem we run something like:
sendmail -vvv A_VALID_EMAIL_ADDRESS < email.txt
and this will give you a very verbose output of the handshake between you and the SMTP server; and normally that verbose logging will provide you the clues to solve your issue.
Hi! I don’t have much experience. Installed dicsourse and a mail server for the first time. Could you elaborate on what exactly I need to do? Thank you.
First, you need to temporarily “forget” about Discourse, and focus on getting your SMTP mail relay up and running, tested and to make sure it can relay mail.
I made 2 mailboxes in my local domain “@ugda.space”. And the messages are coming to each other. To gmail/mail/yandex boxes, the messages don’t reach each other. I didn’t set it up, because I thought I could have enough intra-local communication for the tests.
@Anv Let me be blunt: A good unwritten rule should be something like “don’t ask people to talk to you if you’re not willing to put the effort to listen to them”. By “listening”, I mean considering what they’re telling you. Participating to a forum counts as “asking people to talk to you”, I guess. Especially if you’re asking for help.
Keeping on repeating the same thing, and forcing your interlocutor to also repeat himself doesn’t lead anywhere. For anyone.
Now, why have you not run this command line already ?
I understand your frustration; and I’m sorry I don’t have more free time to debug all your SMTP relay problem every time you reply.
It seems like your SMTP mail host is receiving mail; but that does not necessarily mean it will work as an SMTP relay.
I recall, off the top of my head, there is a flag to use sendmail and other mail clients to check if the SMTP host is working properly as a relay. You might do some research on the sendmail -G option (or look for another way to test). Basically, you need to send the mail to a test email address different than the host you are working on, using your newly minted SMTP host as a relay.
Some History
In the old days, most SMTP hosts would relay mail out-of-the-box; but then all the SMTP hosts on the net became big SPAM boxes because spammers would just exploit the relay functionality (unknown to the owner of the box) and spam the world.
The bottom line is that you need to check to see if your newly minted SMTP host can relay the mail for you.
Did you look closely at your configuration tutorial and see if it mentioned setting up the SMTP host as a relay?
I’m just thinking out loud and hope this helps you in some small way get to the next step in your SMTP host project.
You mentioned you have Discourse installed without Docker. Would it possible for you to do a fresh new install the “classic” way (with docker) by entering the email you created during this new install ? Or you can’t run docker on the machine you’re using ?
I tried with the docker, but there was no mail at all. I couldn’t even create an administrator account. I decided to expel the docker because I was inexperienced.
I’m sure it is not helpful, but as “just another datapoint”, I have never had any problem setting up SMTP mail on Discourse in either a Docker-based production install or a desktop macOS “no Docker” dev setup; but I have always used a third-party SMTP service.
You guys are getting my attention; and so now I am very interested in this little puzzle and will try to find time in the next few weeks to set up an SMTP relay on a VPS Ubuntu Linux slice and see if I can get Discourse to play ball with an “old fashioned” SMTP relay versus depending on “third party solutions”.
My apology in advance if it takes me a few weeks to build this configuration. I am falling behind on a bunch of boring government paper work because I have been having too much fun with learning Discourse plugin dev and how Rails works with all the moving parts.
بعد بعض المحاولات والأخطاء، تمكنت من جعل Discourse يعمل مع Postfix. إليك الخطوات التي استخدمتها، آمل أن تكون مفيدة:
قم بإعداد سجل A يشير إلى خادمك الجديد، مثل forum.domain.com.
قم بتثبيت Postfix، واضبط forum.domain.com كقيمة لـ myhostname، وأضف 172.17.0.0/16 إلى mynetworks حتى يتمكن حاوية Discourse من الاتصال بـ Postfix دون الحاجة إلى مصادقة. 172.17.0.0/16 هي الشبكة الافتراضية المستخدمة بواسطة حاويات Docker.
تأكد من قدرة Postfix على إرسال البريد الإلكتروني. أنا أفضل استخدام swaks.
swaks -t your_name@gmail.com
يجب أن تستلم بريدًا إلكترونيًا بعنوان “This is a test mailing”.
في ملف containers/app.yml، تأكد من وضع تعليق على الأسطر الثلاثة الخاصة بـ DISCOURSE_SMTP_USER_NAME و DISCOURSE_SMTP_PASSWORD و DISCOURSE_SMTP_ENABLE_START_TLS.
ثم اضبط DISCOURSE_SMTP_DOMAIN على forum.domain.com (تأكد من استبدالها باسم نطاقك هنا).
للاختبار، يمكنك الاتصال بحاوية Discourse عبر الأمر docker exec -it app bash وتشغيل: