Issues with getting the public body response emails into Alavetely

32 views
Skip to first unread message

Andrei Petcu

unread,
Mar 16, 2013, 6:30:31 AM3/16/13
to alavet...@googlegroups.com

Hello I have a Alaveteli instance in beta testing but I am having some issues with the mailing system.

http://alaveteli.nuvasuparati.info


I replaced all the public body's mails with a mail that I own so I can act as the public bodies and test the system before importing the real public bodies. Now the mail of “Ministry of Silly Walks“ points to institutie...@gmail.com which is my testing mail.


When I add a new request it gets sent by mail as for example http://alaveteli.nuvasuparati.info/en/request/why_walk_funny

But when institutie...@gmail.com responds to the mail, it does not get pulled into the system.


The email doesn't get written to a file in “files/raw_emails”. Everybody has write permission to files/raw_emails. Not very secure but I wanted to troubleshoot the issue.

ls -la /var/www/alaveteli/files/raw_emails

drwxr-xrwx


I tried to run the mailin script from my local environment like it is described in DOC/INSTALL.md.

./script/console

InfoRequest.find_by_url_title("why_walk_funny").incoming_email

"foi+request-...@alaveteli.nuvasuparati.info"

cp spec/fixtures/files/incoming-request-plain.email /tmp/

# this command replaces To: FOI Person <EMAIL_TO> with To: <foi+request-...@alaveteli.nuvasuparati.info> in a fixture mail

perl -pi -e 's/^To:.*/To: <foi+request-115-ed276d97\@alaveteli.nuvasuparati.info>/' /tmp/incoming-request-plain.email

./script/mailin < /tmp/incoming-request-plain.email

echo $?

75

The result should be 0 from what I understand. After I run the above script I get a mail with the following attatchment “mailimporterrorforalaveteli_nuvasuparati_info.zip”.

It seems that the email gets pulled into the Alaveteli system when I get a reply simulated reply by running the “mailin” script. http://alaveteli.nuvasuparati.info/en/request/why_walk_funny


I get a record in incoming_messages table that looks valid.

select * from incoming_messages where id = (select max(id) from incoming_messages);

The mail in the raw_emails gets written with the correct content when I run just the script.


I'm running the Alaveteli platform on Apache with mod passenger. The database that I use is the one form foi_development with the added fixtures but the rest of the environment runs on production with the line “ENV['RAILS_ENV'] ||= 'production' ” uncomented in config/environment.rb. In database.yaml the production section looks like this

production:

adapter: postgresql

database: foi_development

I get some strange error messages from gmail that it cannot connect to my mail server. If I telnet to my smtp server I see the port 25 opened (telnet alaveteli.nuvasuparati.info 25). I added a file with a similar error message from gmail but not for the foi request that I am troubleshooting right now. This might be a different issue (see attatchment “gmail mail error.odt”).


Sorry for the long email, I wanted to give you as much information as I can about my issue. Can you help me? Can I give you more information about this problem?


Thank you,
Andrei Cristian Petcu
gmail mail error.odt
mailimporterrorforalaveteli_nuvasuparati_info.zip

Louise Crow

unread,
Mar 21, 2013, 12:38:29 PM3/21/13
to alavet...@googlegroups.com
Hi Andrei,

So at the moment it looks like incoming mail for alaveteli.nuvasuparati.info is handled by mail.alaveteli.nuvasuparati.info:


$ host -t mx alaveteli.nuvasuparati.info
alaveteli.nuvasuparati.info mail is handled by 5 mail.alaveteli.nuvasuparati.info.

which isn't responding to telnet on port 25..

$ telnet mail.alaveteli.nuvasuparati.info 25
Trying 78.47.122.119...
telnet: connect to address 78.47.122.119: Operation timed out

That specific issue seems to be what gmail is complaining about, and is presumably why incoming mails are not being received when sent via email - they are never accepted by your mailserver. The error you get when you import a mail manually is an SMTP error - the incoming mail is imported into the application OK, but when alaveteli tries to make an SMTP connection to send the requester a notification email that there's been a new response to their request, it can't connect to the SMTP server to send the outgoing mail.

/usr/lib/ruby/1.8/net/smtp.rb:551:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)

Is that useful?

Cheers

Louise

Andrei Petcu

unread,
Mar 22, 2013, 5:09:14 AM3/22/13
to alavet...@googlegroups.com
Thank you Louise

I am at work right now, I will test what you are saying probably this weekend. I ran a telnet on port 25 on localhost and I get a reply from exim so I think you are right.

Andrei Cristian Petcu
Reply all
Reply to author
Forward
0 new messages