I am using mandril mailer, I have set up my mailers and everything was working fine, at some point the mailer stopped working, I am trying to send a message from the rails console
TaskCompletedMailer.client_created(email: 'mymail#gmail.com').deliver
I am getting a message in the console that the email has been delivered.
[{"email"=>"mymail#gmail.com", "status"=>"sent", "_id"=>"184e03d40a874fa892b5549173ccba80", "reject_reason"=>nil}]
but the mail is not been delivered into my account.
How can I debug that ?
Check in the logs what can you see there. Probalby the action_mailer config is not correct for your current enviroment.
You can try to use a protocol analyzer, such as Wireshark, to monitor the SMTP traffic on your network card and so check how realy the rails app sends to it.
Related
I will receive emails when I trigger using build now manually, but I don't receive emails when I tried to using it in batch mode. Below is the log I obtain when triggered in batch mode.
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: abc#example.com
Error sending to the following VALID addresses: abc#example.com
Note: There are no build logs attached while sending email.
You should set SMTP Server and Authentication in both E-mail Notification and Extended E-mail Notification sections.
Click Advanced button to see this Use SMTP Authentication section.
Error - Not sent to the following valid addresses: <valid_recipient_address> OR Error sending to the following VALID addresses: <valid_recipient_address>
Reason - Email address of sender is not correct.
How to troubleshoot - Enable the debug mode from Jenkins -> Manage Jenkins -> Configure System -> (Search for Extended E-mail Notification configuration -> Check Enable Debug Mode
Example of Working code
emailext attachLog: false,
attachmentsPattern: 'example_file.yaml',
from: '<valid_sender_address>',
body: 'Test Message',
subject: 'Test Subject',
to: '<valid_recipient_address>'
In your Jenkins configuration, make sure that you have entered correct email address for "System Admin e-mail address".
Notification e-mails from Jenkins will be sent with this address in the "from" header.
For me, file size was 5-7MB, I looked at my internet speed meters, saw it, using the full upload speed for around 1 minute, but couldn't complete and gave that error message.
Then I tried smaller file, like 10KB, it worked like charm.
So, for my case, my guess is, somehow file is not getting properly uploaded to email server.
If every thing fails, try restarting jenkins process. That solved for me. Somehow the Jenkins system was unable to load all of the configs? But give it a try.
I added a chat functionality in my existing RoR app with the websocket-rails (https://github.com/websocket-rails/websocket-rails) gem and I'm testing it in production mode on Heroku.
It works fine in localhost, but when I sent it to Heroku it is not receiving any further messages from the Server after the connection.
The connection works:
var WEBSOCKET_URL = 'myapponheroku.herokuapp.com/websocket'
var dispatcher = new WebSocketRails(WEBSOCKET_URL);
dispatcher.on_open = function(data) {
console.log('Connection has been established: ', data);
};
And I see the feedback message.
But the first task is to ask the server for active rooms in my chat. I noticed nothing is returning. I put some feedback messages in the server's action that should do the first tasks and none of them are reached. The feedback I implemented is a simple pair of functions that just returns a object and prints it to the console:
Javascript
dispatcher.bind('feedback',function(data){
console.log(data);
});
Ruby
def feedback data
send_message :feedback, {data: data}
end
It is never triggered. Any ideas? Is the a special configuration I must do on Heroku to allow it to work?
#update
Same error on my live server hosted on AWS.
Connection is established, but nothing is returned from server to client.
#update2
I wrote some code so the app would write some files when connection is established and when it asks for open rooms, right at the beginning, and the files were not created. The actions are not even being called.
I'm using sinch and I've gotten the client to work by registering a user, but I can't send a message. When I click my send button, nothing happens. The required methods that need to be implemented, such as messageFailed(), messageDelivered(), etc. are not being called either. Does anyone know why?
Have you registered the one more user? Can you enable logging and share the full log output.
See comment below, user tried to send message to self
I have a method in a model which processes an incoming bounced email. In cPanel, I have an email account forwarder called eblast-bounce#mydomain.com which is set to pipe to a program with the line
|/home/myaccount/my_rails_app/production/script/runner
'EBlast.receive(STDIN.read)' -e production`
The problem is that the entire contents of STDIN.read is dumped in the log. I don't want any of that. It gets dumped before the EBlast.receive method is even called because I put a custom log entry on the first line of that method and the email contents are logged before that is.
How do I stop STDIN.read from being logged? It's blowing up my log file.
EDIT: Maybe it isn't something that the script/runner is doing, but rather what mail server is doing somehow? I noticed that in my logs whenever I actually send AND receive the emails through the rails app, the email contents are logged. When the email is sent,
Sent mail to [email address]
appears before the email contents...when I receive an email through script/runner,
Received mail:
appears before the email contents.
Turns out it has to do with the logger function of action_mailer! I put ActionMailer::Base.logger = nil in environment.rb
Problem solved.
Is there a way to receive Facebook chat/messages through XMPP in Rails? I've checked with xmpp4r_facebook but so far I can only send messages with it. Thanks!
You should be able to set a message callback using add_message_callback. The echo example from xmpp4r should get you started: https://github.com/ln/xmpp4r/blob/master/data/doc/xmpp4r/examples/basic/echo.rb.