Page 1 of 1
[SOLVED] Question regarding NativeMailer (mail() Error)
Posted: Thu May 31, 2007 6:26 am
by wurzel
Hi!
I tried using the NativeMailer, but it always says my mail() function returned an error. After some tests I found out that its related to the additional parameter given to the mail function (my server doesn't use safe_mode) -> "
-oi -f
mail@domain.tld", in special the -oi parameter. If the code is modified to not include the "-oi" its working.
I'm not that much into sendmail&co and have no clue whatsoever what exactly this parameter does, so I just wanted to know if its safe to leave it out or if I have to configure something else so the error doesn't happen even with this on...
Thanks in advance for your interest
wurzel
Posted: Thu May 31, 2007 7:13 am
by feyd
If you're looking for a better, more simple to work with solution, check out Swiftmailer.
Posted: Thu May 31, 2007 7:15 am
by Chris Corbyn
He's using SwiftMailer

I suspect an old verion though since that is a bug when safe_mode is turned on, the 5th parameter is not available. This was fixed a month or two ago (or at least, I was informed it now works as it should).
What version are you running?
Posted: Thu May 31, 2007 7:22 am
by Chris Corbyn
EDIT | I see you're not running safe mode. In that case the issue must lie somewhere with your PHP install. Have you got sendmail installed (is it sendmail or a symlink to something else?). Does anything show in your logs?
It is safe to remove those params, but you might not have much luck gettting your name/address to appear correctly without them.
Posted: Thu May 31, 2007 7:22 am
by wurzel
I am using the (latest?) swiftmailer 3.2.4 for php4 hence my post in the swiftmailer forum *giggle*.
I don't think its a bug because my server has safe_mode
disabled -> so it (supposedly) correctly passes the $param variable to the function. The question why -oi is troublesome or if it can be safely left out remains
Thanks for the fast replies...
Greetings
wurzel
Posted: Thu May 31, 2007 7:34 am
by wurzel

didn't see your edit before my previous post...
So far I had no problems with the to/replyto Address being in Swift_Address format, all test-emails arrived correctly.
My Server runs on Suse Linux 9.3 and uses qmail.
Could there be problems for other mail-recipients using mail() function in swiftmailer without "-oi" in the ¶m var or do my test-emails prove them to be sent correctly to all recipients?
Posted: Thu May 31, 2007 7:43 am
by Chris Corbyn
wurzel wrote:Could there be problems for other mail-recipients using mail() function in swiftmailer without "-oi" in the ¶m var or do my test-emails prove them to be sent correctly to all recipients?
Is it only the -oi, not the -f which is the problem? If the -f is in there then there's a good chance it will just works as it should. Nothing will stop the mail from sending, it would only change what's in the headers of the email.
Maybe I should make this settable as a sprintf() format string or something?
Code: Select all
$mail_conn->setParams("-oi -f %s");
Just thinking out loud.
Posted: Thu May 31, 2007 7:51 am
by wurzel
Yes, only the -oi causes problems. Everything else doesn't.
And making this configurable would be nice, this way I wouldn't have to change the code in your script directly which would have to be done (at least for my current server/config) in future updates as well.
Anyways: thanks for this great script

Posted: Thu May 31, 2007 7:55 am
by Chris Corbyn
wurzel wrote:Yes, only the -oi causes problems. Everything else doesn't.
And making this configurable would be nice, this way I wouldn't have to change the code in your script directly which would have to be done (at least for my current server/config) in future updates as well.
Anyways: thanks for this great script

No worries

I'll update this in svn now since it's a trivial change.
Posted: Thu May 31, 2007 8:04 am
by wurzel
Nice! I'm happy to hear that. Guess this closes my whole problem
Well, not sure if this is the right place to do so, but I wish you a very nice trip to australia in september. I know its not much, but maybe you can get a nice australian beer or something with the 5 bucks I donated

Posted: Thu May 31, 2007 8:09 am
by Chris Corbyn
wurzel wrote:Nice! I'm happy to hear that. Guess this closes my whole problem
Well, not sure if this is the right place to do so, but I wish you a very nice trip to australia in september. I know its not much, but maybe you can get a nice australian beer or something with the 5 bucks I donated

Got your donation thanks

Very kind of you. Later this year I shall be sat on the whitest beach in the world (Hervey Bay), sipping from an ice cold beer (let's not forget the mouthwatering image of condensation rolling down the edge of bottle in the baking sun) and wondering if I'll ever decide to go back to work again!
Cheers bud!
Posted: Sat Jun 02, 2007 10:30 am
by Chris Corbyn
Posted: Sat Jun 02, 2007 10:40 am
by wurzel
Wow, very fast implementation
You got a little error in your description:
[...]By default this is “-oi -f %” where %s is[...]
I'm sure you meant
[...]By default this is “-oi -f %s” where %s is[...]
Not that it's not clear anyways, but just thought I'd point that out

Posted: Sat Jun 02, 2007 10:43 am
by Chris Corbyn
wurzel wrote:You got a little error in your description:
[...]By default this is “-oi -f %” where %s is[...]
Corrected
I'm off out for the rest of the weekend now. I'm a bit tipsy so forgive the typo

Have a great weekend!