-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using Exim "sendmail" #70
Comments
I ran into the same problem with my host (site5). They were able to tweak their exim config to make this work. It would be good if the mail gem's default behaviour was compatible with exim (or if it detected exim and adjusted). |
Have You an issue ? Exim log :2010-11-24 14:34:44 1PLFUi-0002H2-PQ <= <> R=1PLFUi-0002H0-OI U=mail P=local S=16076 T="Mail failure - no recipient addresses" from <> for user@NOSPAM app log :Sent mail to contact@NOSPAM (160ms) |
You can insert this line into Exim configuration file: |
it's ok, i read exim man for more specifics. Thks |
have the same problem, can it be solved soon? |
with |
No, I meant how can this bug be solved in mail function. I tried PHP's mail function and it works perfectly. |
The ssmtp wrapper (ftp://ftp.debian.org/debian/pool/main/s/ssmtp/) issues a similar warning. Given that all the information is already in the generated mail and -t is used I'm not sure why the default should be to also provide them on the command line. My preference solution would be to just remove the recipient addresses from the sendmail command line, but if that's not possible there should be an option to control this behaviour. |
I was having same problem on cpanel server with exim. I added extract_addresses_remove_arguments = false |
Monkey patch for this very unfortunate issue. Could easily be fixed upstream by providing an alternate sendmail class (like below) or by removing the list of recipients from the command line. Thx !
|
For Rails users who experience this: Add current/config/initializers/xxx_fix_sendmail.rb with these contents: module Mail
Sendmail.class_eval do
def deliver!(mail)
envelope_from = mail.return_path || mail.sender || mail.from_addrs.first
return_path = "-f \"#{envelope_from.to_s.shellescape}\"" if envelope_from
arguments = [settings[:arguments], return_path].compact.join(" ")
Sendmail.call(settings[:location], arguments, mail)
end
def self.call(path, arguments, mail)
IO.popen("#{path} #{arguments}", "w+") do |io|
io.puts mail.encoded.to_lf
io.flush
end
end
end
end And watch this bug so you'll know when to remove the monkey-patch or when it breaks. |
Please fix this upstream, the fix provided by demotera is correct. |
Oh man I just spent 2-3 hours debugging this issue.
@mikel any idea if these fixes will go into the core gem? Thanks! |
Hi, just thought I'd add my 2c. From the exim man page:
The easiest way to fix this in rails is simply to config.action_mailer.sendmail_settings = {
:arguments => "-i"
} However in the long run, mail should either remove the -t option, or not specify the recipients on the command line. I think removing them from the command line is the better choice as we don't want them added, nor removed. |
add pull request #296 |
Thank you, timsjoberg. This is really a difficult-to-track bug. You don't know what to suspect when there are several possible culprits. Just to confirm, both extract_addresses_remove_arguments = false in exim's configuration and arguments => "-i" is what is needed for it to work. I really was nuts on this one. |
Hi all, I have added an Exim deliver manager in commit 632c05e This is currently in master. Please let me know if this handles your issues as I don't use Exim. |
I was hit by this yesterday and spent hours figuring out the problem; pretty daunting if you just want to install some random RoR app and emails don't work because of this (even more so if you have no clue about developing with RoR ...). I know #70 (comment) suggest a new driver, but I'd like to point out timsjoberg excellent analysis at #70 (comment) , a conclusion to which I ultimately came to, too. Maybe there's a easier way to have a Sendmail transport configuration which is more compatible out there? thanks for considering |
@mfn did you see my comment immediately above yours? I have added a separate Exim driver in the latest Mail gem. |
@mikel : yes I did; I wasn't ignorant, sorry if that sounded so. My stance is: I'm wondering if it really needs it's own "driver" when it's just about, maybe (needs thorough investigation), the order or about the parameter which could be changed to work with exim and still be compatible with sendmail and others (I was under the assumption that exims' sendmail link is meant to be compatible). Because whether it's a configuration like timsjoberg suggested or a new driver: the user will be surprised it doesn't work out of the box. Why the surprise? Usually the application on the system "just work" with the local MTA without special handling. Just wanted to better describe my point, I'm not arguing against your fix. thanks |
@mfn Oh OK, that makes sense. What would actually be cool is an update to the README describing how to set up with Exim. Would you be able to craft this? |
👍 |
Note that #477 eliminates reliance on |
I get the following error:
A message that you sent using the -t command line option contained no
addresses that were not also on the command line, and were therefore
suppressed. This left no recipient addresses, and so no delivery could
be attempted.
------ This is a copy of your message, including all the headers. ------
Date: Wed, 09 Jun 2010 00:22:26 +1200
From: samuel.williams@NOSPAM
To: samuel@NOSPAM
Message-ID: 4c0e360234e31_3554241c2728745db@NOSPAM
Subject: Website Contact: Moo
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Testing
The text was updated successfully, but these errors were encountered: