Hi all,
My linux distro (Raspbian) did not come with sendmail installed, so I've gone by without email notifications for some time. Finally got around to fixing it and now my blog generates outgoing emails which my ISP is happy to pass on. Yeay!
Only problem is I would like to customise the email's from address. Currently the apache user's name is appearing on the email headers:
Return-Path: <www-data@aupcgroup.com>
From: www-data <www-data@aupcgroup.com>
Note though I own the domain and have correctly set up MX record, the server is not configured to accept incoming smtp traffic. Instead I would rather set the return path / reply to address to my gmail account. I would also like to change the from address to something other than www-data (maybe admin@aupcgroup.com).
What's the easiest way to achieve this?
TIA
Email notifications - configure "from address"
Re: Email notifications - configure "from address"
In the php.ini file by
OR use mailto -f admin@example.org in the php mail function itself, eg
In your case I would try to play with the php.ini.
OR in its "sendmail_path" directive by adding the "-r" option, eg "-r admin@example.org"; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
OR use mailto -f admin@example.org in the php mail function itself, eg
Code: Select all
mail('to@example.org', 'subject', 'message', $headers, '-f admin@example.org');
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Email notifications - configure "from address"
Wow, thanks for the super quick response.
Actually I didn't realise I left the blog's email address blank in the config, hence the defaults.
Entering a value has set the From and Reply To headers appropriately.
Return path unchanged. I hate messing with things I don't understand, so I think I'm happy everything looks like it works (though I get warnings in Gmail about the authenticity of the sender).
Will definitely look into this *later*
Actually I didn't realise I left the blog's email address blank in the config, hence the defaults.
Entering a value has set the From and Reply To headers appropriately.
Return path unchanged. I hate messing with things I don't understand, so I think I'm happy everything looks like it works (though I get warnings in Gmail about the authenticity of the sender).
Will definitely look into this *later*
Re: Email notifications - configure "from address"
I supposed you had done that already...
Did you add it to configuration - general settings globally and also in your personal preferences?
Try that, if not.
Did you add it to configuration - general settings globally and also in your personal preferences?
Try that, if not.
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Email notifications - configure "from address"
LOL, I supposed I had already done that also... turns out I set an email address for the primary user / administrator but left the other one blank. My bad. To add to the confusion I found out my IP was on an email blacklist, so I could never tell if my config was bad or if smtp traffic was being rejected.Timbalu wrote:I supposed you had done that already...
Did you add it to configuration - general settings globally and also in your personal preferences?
Try that, if not.
Spent about 3 days figuring out how to get outgoing email to work. Even now I'm not sure about every single configuration option (I'm talking about Sendmail here). I've read countless articles about how to set up specific features, seems everyone has slightly different needs/way of doing things.
Not sure if this is the best place to ask but I will, Is there a good guide to configuring sendmail on Linux? Something that spells things out step by step? I relied on this http://www.linuxhomenetworking.com/wiki ... il_Servers - very in depth but parts skim over some details and it's probably more useful to someone who knows what they are doing.
Re: Email notifications - configure "from address"
So you say you are using Serendipity with a RasPi Server, with Sendmail and Apache, at home and behind a dynIP DDNS?
I can't help with Sendmail, but would recommend to go with Postfix instead. Its much more modern.... and a little easier to understand. On RasPi there would be even more slim alternatives for Server and MTA recommended, I assume.
You will still have these blacklist (or reject) things, since there are some server (ISP) admins (like me), who strictly disallow DynIP mail transfers. Its most probably Spam. I want my MTA to only except mail from verified senders, which is not possible with dynIP senders. And I can say to remember, I never had a valid sender with DynIP in the last decade ++.
I can't help with Sendmail, but would recommend to go with Postfix instead. Its much more modern.... and a little easier to understand. On RasPi there would be even more slim alternatives for Server and MTA recommended, I assume.
You will still have these blacklist (or reject) things, since there are some server (ISP) admins (like me), who strictly disallow DynIP mail transfers. Its most probably Spam. I want my MTA to only except mail from verified senders, which is not possible with dynIP senders. And I can say to remember, I never had a valid sender with DynIP in the last decade ++.
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Email notifications - configure "from address"
You're correct on points 1-5, my ISP has allocated me a static IP address. Now I did read somewhere that for things to work the ISP needs to set correct PTR / reverse dns lookup. dig shows PTR record set to myip.static.tpgi.com.au, which I'm not sure is correct.Timbalu wrote:So you say you are using Serendipity with a RasPi Server, with Sendmail and Apache, at home and behind a dynIP DDNS?
Thanks for the recommendation. Raspbian is a Debian/Ubuntu based distro that's tailored to work with the RasPi ARM cpu, I imagine most packages available to Debian are also available to Raspbian. I'll definitely keep Postfix in mind for future projects.Timbalu wrote:I can't help with Sendmail, but would recommend to go with Postfix instead. Its much more modern.... and a little easier to understand. On RasPi there would be even more slim alternatives for Server and MTA recommended, I assume.
The blacklist was the SORBS SPAM database. In any case I've setup Sendmail to use my ISP's smtp server as a smarthost. Outgoing connection is authenticated and my ISP will relay to destination. It's working for dest I've tested so far. This is similar to configuring Outlook email client to send mail through ISP. Is this setup ok? Maybe you could try subscribing to a comment at my blog to test if the mail gets through your server?Timbalu wrote:You will still have these blacklist (or reject) things, since there are some server (ISP) admins (like me), who strictly disallow DynIP mail transfers. Its most probably Spam. I want my MTA to only except mail from verified senders, which is not possible with dynIP senders. And I can say to remember, I never had a valid sender with DynIP in the last decade ++.
http://www.aupcgroup.com/blog/index.php ... sting.html
Ian, thanks again for your input. You know your stuff, and I think I'll have learn just a bit.
Re: Email notifications - configure "from address"
Well, in that case its not getting a dynIP and my concerns regarding that should not be your problem.s9yrookie wrote:In any case I've setup Sendmail to use my ISP's smtp server as a smarthost. Outgoing connection is authenticated and my ISP will relay to destination. It's working for dest I've tested so far.
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian