[actionmailer, postfix] problem z wyslaniem maila przez localhosta

postfix z konsoli ladnie wysyla mi maile, wiec mysle, ze cos nie tak mam skonfigurowane w railsach. najgorsze, ze nie wywala mi zadnego bledu;/

w konsoli mam

[code]Sent mail to janusz@gmail.com

Date: Sat, 4 Apr 2009 15:31:44 +0200
From: mail@abdul.pl
To: janusz@gmail.com
Subject: abdulProsze aktywuj swoje konto
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8

Konto zostało stworzone.

Login:: tester

Odwiedz stornę w celu aktywacji konta.

http://localhost:3000/activate/fa1a157c08ab68f4d510849face2665db5f2c803
^[[4;36;1mPermission Columns (0.001575)^[[0m ^[[0;1mSHOW FIELDS FROM permissions^[[0m
^[[4;35;1mPermission Create (0.000731)^[[0m ^[[0mINSERT INTO permissions (created_at, updated_at, role_id, $
^[[4;36;1mSQL (0.043278)^[[0m ^[[0;1mCOMMIT^[[0m
Redirected to http://localhost:3000/login
Completed in 0.11645 (8 reqs/sec) | DB: 0.05086 (43%) | 302 Found [http://localhost/users][/code]
w config/initializers/mail.rb mam tak

[code]

Email settings

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => “localhost”,
:port => 25,
:domain => “ubuntu-desktop”,
:authentication => :login,
:user_name => “imie”,
:password => “haslo”
}[/code]
w config/enviroment/developement.rb

[code]config.action_mailer.raise_delivery_errors = false

config.action_mailer.perform_deliveries = true

config.action_mailer.smtp_settings = :smtp[/code]
probowalem tez wrzucic to do conf/enviroment.rb, ale to nic nie zmienia.

jakies podpowiedzi,sugestie?

Przejrzeć /var/log/mail.log

Ustaw

config.action_mailer.raise_delivery_errors = true

to będzie wywalał błędy… Popatrz też w logach postfixa/railsów.

Możliwe że wcale nie potrzebujesz autoryzacji i wystarczy wywalić wszystko co jej dotyczy czyli authentication, username, password i zadziała ale musisz sam sprawdzić.

ustawilem na true i wysypalo mi cos takiego

[code]Net::SMTPAuthenticationError in UsersController#create
503 5.5.1 Error: authentication not enabled

RAILS_ROOT: /home/bialy/workspace/abdul
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/1.8/net/smtp.rb:942:in check_auth_response' /usr/lib/ruby/1.8/net/smtp.rb:733:inauth_plain’
/usr/lib/ruby/1.8/net/smtp.rb:725:in send' /usr/lib/ruby/1.8/net/smtp.rb:725:inauthenticate’
/usr/lib/ruby/1.8/net/smtp.rb:566:in do_start' /usr/lib/ruby/1.8/net/smtp.rb:525:instart’
/usr/lib/ruby/1.8/net/smtp.rb:463:in start' vendor/rails/actionmailer/lib/action_mailer/base.rb:627:inperform_delivery_smtp’
vendor/rails/actionmailer/lib/action_mailer/base.rb:508:in __send__' vendor/rails/actionmailer/lib/action_mailer/base.rb:508:indeliver!’
vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in method_missing' app/models/user_observer.rb:3:inafter_create’
app/controllers/users_controller.rb:25:in create' -e:2:inload’
-e:2[/code]
akcja create tego kontrolera wyglada nastepujaco

[code] def create
cookies.delete :auth_token
@user = User.new(params[:user])
@role = Role.find_by_rolename(‘uzytkownik’)
@user.roles << @role

@user.save!

#Uncomment to have the user logged in after creating an account - Not Recommended
#self.current_user = @user

flash[:notice] = “Dziekuję za rejestrację! Proszę sprawdż swój e-mail w celu aktywacji swojego konta.”
redirect_to login_path
rescue ActiveRecord::RecordInvalid
flash[:error] = “Problem z rejstracją Twojego konta, proszę kontaktować się z administratorem.”
render :action => ‘new’
end[/code]
cos robie nie tak?
czy cos z konfiguracja postfixa zle?

logi z /var/log/mail.log

Apr 4 19:50:05 ubuntu-desktop postfix/master[5361]: daemon started -- version 2.5.5, configuration /etc/postfix Apr 4 19:50:16 ubuntu-desktop postfix/master[5361]: reload configuration /etc/postfix Apr 4 19:53:22 ubuntu-desktop postfix/smtpd[6531]: connect from localhost[127.0.0.1] Apr 4 19:53:22 ubuntu-desktop postfix/smtpd[6531]: 3A83861DC2: client=localhost[127.0.0.1] Apr 4 19:53:22 ubuntu-desktop postfix/cleanup[6535]: 3A83861DC2: message-id=<49d79e91f0942_1974..fdb4fc2ba1d5@ubuntu-d$ Apr 4 19:53:22 ubuntu-desktop postfix/qmgr[5937]: 3A83861DC2: from=<mail@abdul.pl>, size=603, nrcpt=1 (queue active) Apr 4 19:53:22 ubuntu-desktop postfix/smtpd[6531]: disconnect from localhost[127.0.0.1] Apr 4 19:53:53 ubuntu-desktop postfix/smtp[6536]: 3A83861DC2: to=<janusz@gmail.com>, relay=gmail-smtp-in.l.google.c$ Apr 4 19:53:53 ubuntu-desktop postfix/cleanup[6535]: C008A61DC7: message-id=<20090404175353.C008A61DC7@ubuntu-desktop> Apr 4 19:53:53 ubuntu-desktop postfix/qmgr[5937]: C008A61DC7: from=<>, size=3043, nrcpt=1 (queue active) Apr 4 19:53:53 ubuntu-desktop postfix/bounce[6553]: 3A83861DC2: sender non-delivery notification: C008A61DC7 Apr 4 19:53:53 ubuntu-desktop postfix/qmgr[5937]: 3A83861DC2: removed Apr 4 19:53:54 ubuntu-desktop postfix/smtp[6536]: C008A61DC7: to=<mail@abdul.pl>, relay=mail.abdul.pl[91.203.133.69]:2$ Apr 4 19:53:54 ubuntu-desktop postfix/qmgr[5937]: C008A61DC7: removed Apr 4 19:55:17 ubuntu-desktop postfix/smtpd[6599]: connect from localhost[127.0.0.1] Apr 4 19:55:17 ubuntu-desktop postfix/smtpd[6599]: lost connection after AUTH from localhost[127.0.0.1] Apr 4 19:55:17 ubuntu-desktop postfix/smtpd[6599]: disconnect from localhost[127.0.0.1] Apr 4 19:57:02 ubuntu-desktop postfix/smtpd[6648]: connect from localhost[127.0.0.1] Apr 4 19:57:02 ubuntu-desktop postfix/smtpd[6648]: lost connection after AUTH from localhost[127.0.0.1] Apr 4 19:57:02 ubuntu-desktop postfix/smtpd[6648]: disconnect from localhost[127.0.0.1]

Dokładnie. Wywal linijki:

:authentication => :login,
:user_name => “imie”,
:password => “haslo”

Twój serwer widać nie wymaga autentyfikacji, a jak ją ustawisz to się wywala właśnie jak powyżej.

Już się kiedyś z tym spotkałem wywalenie autentyfikacji z konfiguracji pomogło.

juz wywalalem wczesniej te linijki jak mi napisales, ale maile dalej nie dochodza. Nie mam juz tego bledu 503 …
a w logach mail.log

Apr 4 23:03:16 ubuntu-desktop postfix/master[5363]: daemon started -- version 2.5.5, configuration /etc/postfix Apr 4 23:03:27 ubuntu-desktop postfix/master[5363]: reload configuration /etc/postfix Apr 4 23:06:28 ubuntu-desktop postfix/smtpd[6566]: connect from localhost[127.0.0.1] Apr 4 23:06:29 ubuntu-desktop postfix/smtpd[6566]: 036E061DC2: client=localhost[127.0.0.1] Apr 4 23:06:29 ubuntu-desktop postfix/cleanup[6570]: 036E061DC2: message-id=<49d7cbd4ae150_1980..fdb52f9581a5@ubuntu-d$ Apr 4 23:06:29 ubuntu-desktop postfix/qmgr[5939]: 036E061DC2: from=<mail@abdul.pl>, size=605, nrcpt=1 (queue active) Apr 4 23:06:29 ubuntu-desktop postfix/smtpd[6566]: disconnect from localhost[127.0.0.1] Apr 4 23:07:00 ubuntu-desktop postfix/smtp[6571]: 036E061DC2: to=<janusz@gmail.com>, relay=gmail-smtp-in.l.google.c$ Apr 4 23:07:00 ubuntu-desktop postfix/cleanup[6570]: 588CF61DC7: message-id=<20090404210700.588CF61DC7@ubuntu-desktop> Apr 4 23:07:00 ubuntu-desktop postfix/qmgr[5939]: 588CF61DC7: from=<>, size=3041, nrcpt=1 (queue active) Apr 4 23:07:00 ubuntu-desktop postfix/bounce[6591]: 036E061DC2: sender non-delivery notification: 588CF61DC7 Apr 4 23:07:00 ubuntu-desktop postfix/qmgr[5939]: 036E061DC2: removed Apr 4 23:07:01 ubuntu-desktop postfix/smtp[6571]: 588CF61DC7: to=<mail@abdul.pl>, relay=mail.abdul.pl[91.203.133.69]:2$ Apr 4 23:07:01 ubuntu-desktop postfix/qmgr[5939]: 588CF61DC7: removed
ps. mowisz moj serwer nie wymaga autentyfikacji, tzn ktory serwer - mongrel, czy ten na localu?

moze kolega @tomash cos podpowie:)

tutaj widac cale te logi

http://pastie.org/437090

  1. postfix na desktopie nie wymaga autoryzacji
  2. “The IP you’re using to send mail is not authorized to send email directly to our servers. Please use the SMTP relay at your service provider instead.” - starałeś się zrozumieć co ten komunikat oznacza?
  3. http://mail.google.com/support/bin/answer.py?answer=10336

I chyba wszystko jasne?

tak staralem sie zrozumiec i zrobilem, tak
nazwe domeny podalem localhosta -> zamiast abul.pl,
jesli chodzi o autoryzacje to te linijki juz dawno usuniete.
czy w configu postfixa jest jakas autoryzacja ustawiona, ktora mam wylaczyc?

ps. i dalej to samo

“Gmail refuses mail when the sending IP address does not match the sending domain.”

Co chcesz osiągnąć przez zmianę domeny na localhost?

Mail, żeby dotrzeć do adresata musi być poprawnie zaadresowany i poprawnie wysłany. Niektórzy providerzy ograniczają przyjmowanie maili, tak żeby odsiać spam.
Jeśli wysyłasz maila z ip, który nic wspólnego nie ma z domeną w adresie nadawcy, to masz duże szanse, że zostanie odrzucony.

Problem jest o tyle dziwny, ze dzis u kolegi mi ladnie wszystko dzialalo. Tylko u mnie w domu nie dochodza te wiadomosci;/ Nie wiem mam cos poblokowane? Zbanowali mnie (IP, gmail) ?
Ktos ma jakis pomysl, postfix i rails’y skonfigurowane ok.

No oczywiście - te maile nie będą dochodzić jak wyślesz ze swojego domowego komputera - to Ci próbowali wytłumaczyć forumowicze kilka postów wyżej i o tym mówi wiadomość błędu ;).

lol tos mi napisal…
jakbym mial inny internet, albo nie wiem…
wiem, co znaczyl komunikat i tego mi nie trzeba tlumaczc! pytanie bylo czemu ode mnie jak wysylam to nie dochodza, a od kogo innego jest wszystko ok. ale spoko…