PHP mail()

software development

#1

I am using PHP to generate emails to be sent to members of a club for which I do admin work.

Everything seems to work fine, except that the emails being generated by the mail() call have a Return-path of somename@cerebus.dreamhost.com rather than someadmin@someotherdomain.org, and while I get a copy of the email I send out - so know it’s actually going out and it’s even properly formatted - some of my recipients are not getting the email.

Those same recipients get regular emails (return-path of someadmin@someotherdomain.org ) so their emails are valid.

Is there a way to override Return-path in a mail() call so that I can get the generated emails to their destination?

Nothing in the wiki, nothing I can find on the web. There’s got to be a way to do this, right?

Thanks

John


#2
  1. create an email account via the panel… i.e. somename@someotherdomain.org
  2. in the “mail” section of the panel click “message filters”
  3. click the “edit” button for somename@someotherdomain.org
  4. click the “add new filter” button
  5. add a filter to forward mail “To” contains "somename@someotherdomain.org" and select the destination "Forward to shell account ____"
    and select the correct shell user domain and shell use name.

#3

This is a filter for incoming mail - I need to treat outgoing mail to change the return-path to my own address, not somename@cerebus.dreamhost.com, which apparently triggers spam filters or something else undesirable.

Thanks


#4

Sorry about that, I read the wrong thing into your message, I thought you were trying to get returned mail back to the server for processing by a script.


#5

[quote=“johngriswold, post:1, topic:60328”]
Nothing in the wiki, nothing I can find on the web. There’s got to be a way to do this, right?[/quote]

Actually there is stuff on the web about this issue as it is frequently asked.

Google Search

Not to mention the documentation for mail() specifies how to set the envelope sender.


#6

Aha! Apparently the magic was to use Google instead of Bing for the search. Thanks.

Changing the header as suggested in the PHP mail() docs didn’t do the trick, but adding the "-femail@example.com" as the fifth argument to the mail() call did the trick.

Thank you, kind sir!

(It remains to be seen if this allows the email to get to its destination)