From / Reply / bounce email issue


(Louis Rossouw) #1

I’m not sure where this issue arises but I think this commit is causing me some hassles:

What my site config has is an smtp account with noreply@mysite.com
My reply address in settings is forum@mysite.com

This was working correctly and people were able to reply to emails.

When I upgraded I get errors on mail being rejected as the from address is not being found in aliases, presumably because email is being sent by user noreply@mysite.com but with envelope from forum+verp{key}@mysite.com.

May 11 01:45:32 mail postfix/submission/smtpd[621]: NOQUEUE: reject: RCPT from unknown[x.x.x.x]: 451 4.3.0 <forum+verp-2b5431831091aec1bc4e1ba25b4c26cc@mysite.com>: Temporary lookup failure; from=<forum+verp-2b5431831091aec1bc4e1ba25b4c26cc@mysite.com> to=<some_user@gmail.com> proto=ESMTP helo=<localhost.localdomain>```

How do I resolve this?


(Jeff Atwood) #2

Sure @zogstrip can have a look


(Louis Rossouw) #3

Thanks this is the bit of code:


I had not configured email bounce settings before.

I can confirm deactivating reply by email feature (by tick box and removing the relevant email) allows emails to be sent again.


(Louis Rossouw) #4

This is what I think is happening. Discourse authenticates against the mail server using user and pass for noreply@mysite.com but then tries to send mail from forum+verp{key}@mysite.com.

I think my mail server is correctly blocking this as it should not allow people to send emails from addresses they don’t own.

I could change the sending user to forum@mysite.com but I’m not sure that my postfix mail server is clever enough to recognise forum+something@mysite.com as a valid mail from for forum@mysite.com. It certainly delivers emails like this but not sure if allows messing with the from address in this way. I can test this.

Assuming this works then the new bounce functionality will only work if:
the smtp account in the site config = notification email in site settings = reply by email address in site settings.

Or am I missing something?


(Régis Hanol) #5

I would :heart: if you could test it.


(Louis Rossouw) #6

Well I would test it first directly against the mail server by connecting to mail server port and trying to submit an email like that “per hand”. I will try to get to it tonight but may only get to it tomorrow night.


(Louis Rossouw) #7

I tested it now.

postfix can figure out if you login with user forum@example on smtpd you are allowed to send mail from forum+something@example.com. This works. You have to have the “recipient_delimiter = +” setting in your postifx conf (which I had).

I then changed my site email smtp config to user to forum@mysite.com with the relevant pass.
I changed the notification email to forum@mysite.com (under required setting).
I changed the reply email to forum+%{reply_key}@mysite.com.

All seems to be working again.

Basically exactly as I thought. You kind to have all these now be the same for email to work properly otherwise you end in trouble.

Probably should add that to the checking for these settings so it will work.


(Louis Rossouw) #8

Just a follow up from this because:
smtp account = notification email = reply email I see the following:

All the bounced replies are going to the rejected queue for forum replies. This is a blessing and a curse. A blessing because I can see the bounce reasons to diagnose email issues. A curse because the rejected queue is supposed to be for rejected attempts at reply.

It also results in a :ghost: user being created:

I prefer if the bounced email list also contains a box to view the bounces. These should be separate from the failed reply by email emails where the bounced emails are now also landing.


(Jeff Atwood) #9

Perhaps @zogstrip can advise here.


(Régis Hanol) #10

I agree, here’s a fix :wink:

As for the :ghost: user (we call them “staged users”), that’s standard procedure for all incoming emails.