Receiving emails from unregistered users via Postfix alias

Added by Paul Crane over 12 years ago

Hello everyone,

I've been having a problem setting up email to create issues in Redmine 0.9.3(stable). I've managed to get it working for registered users, but those that aren't receive bounce emails.

The line I have in /etc/aliases file is thus:

support: "|/etc/postfix/rdm-mailhandler.rb --verbose --url=<URL> --key=<KEY> --project=support 
--no-permission-check --unknown-user=accept --category=bug --allow-override=project" 

This is what I see in the maillogs:

Jun 21 21:24:32 example postfix/local[8139]: 767361F70062: to=<support@example.com>, relay=local, delay=0.9, 
delays=0.77/0.01/0/0.12, dsn=5.7.0, status=bounced (permission denied. Command output: Request was denied by your
Redmine server. Possible reasons: email is sent from an invalid email address or is missing some information.
Posting to <URL>/mail_handler... Response received: 422 )

And this is what I see in the redmine logs:

Processing MailHandlerController#index (for 202.20.97.242 at 2010-06-21 21:56:09) [POST]
  Parameters: {"no_permission_check"=>"1", "unknown_user"=>"accept", "allow_override"=>"project", "issue"=>
{"category"=>"bug", "project"=>"support"}, "key"=>"<KEY>", "email"=>"<EMAIL MESSAGE>"}
  User Load (0.3ms)   SELECT * FROM `users` WHERE (LOWER(mail) = '<SOURCE EMAIL>') AND ( (`users`.`type` = 'User'
OR `users`.`type` = 'AnonymousUser' ) ) LIMIT 1
Completed in 2ms (View: 0, DB: 0) | 422 Unprocessable Entity [<URL>/mail_handler]

What this tells me is that the options are being passed to the server, they're just not being used. Is this a bug, or something that I've missed?

Replies (5)

RE: Receiving emails from unregistered users via Postfix alias - Added by Paul Crane over 12 years ago

Ok, so further testing and it seems like emails from gmail addresses (either via the web or via thunderbird) only have this problem.

I'll do more digging.

RE: Receiving emails from unregistered users via Postfix alias - Added by Felix Schäfer over 12 years ago

Have a look around the headers then, I think there has been some work done on the mail_handler in trunk in the last few days.

RE: Receiving emails from unregistered users via Postfix alias - Added by Paul Crane over 12 years ago

So I create a pair of minimal emails, one which worked and one from gmail that doesn't. No matter what headers are present the gmail email refuses to come through.

I see the following in the logs:

MailHandler: ignoring email from non-active user [Test]

The weird thing about this is that nowhere in the email is the word Test (in any shape or form).

RE: Receiving emails from unregistered users via Postfix alias - Added by Paul Crane over 12 years ago

Ok, so what's happening is this.

There was a user created once upon a time, that used the gmail account I was testing with. Since it was created it was inactivated. This means that redmine was looking up the user account, seeing that it was locked, and disallowing the receiving of the email.

So, if there's anyone else that has this problem you should check your user list carefully, both active and inactive users. :D

RE: Receiving emails from unregistered users via Postfix alias - Added by Ahammad Fekri over 10 years ago

I am so happy ... This reference is worked for ........ Thanx ...... :)

(1-5/5)