Skip to main content

Email sent as "username@hostname"

Comments

16 comments

  • rpvw
    You can add the -f user@domain.tld[/EMAIL] to the php mail() line in the wp code **OR** Configure the form to use an authenticated SMTP session **OR** Google for ways of achieving this that will return suggestions like Changing the WordPress email "from" address without a plugin - ButlerBlog **OR** Ask in the wp forums, where I am sure they will have lots of advice and recommendations for plug-ins for you. Good luck :)
    0
  • DennisMidjord
    Thanks for your reply. The client was recently on a DirectAdmin server, and he had no issues there. Is there no setting that we can change in WHM that fixes this?
    0
  • rpvw
    If your users refuse to configure their wp forms to use authenticated SMTP, as I indicated, you can add the -f user@domain.tld to a mail.force_extra_parameters line in your php.ini for that domain. This is a run-time configuration and can be set per directory since PHP 5.0.0 Please see PHP: Runtime Configuration - Manual for more information.
    0
  • cPanelMichael
    Hello, You'd need to setup WordPress to send email via SMTP to avoid the mail coming from the username@hostname address. You may find a plugin like this helpful: Configure SMTP Thank you.
    0
  • DennisMidjord
    you can add the -f user@domain.tld[/EMAIL] to a mail.force_extra_parameters line in your php.ini

    This actually helped - thanks! The customer doesn't want to use a plugin for SMTP. He's sure that it will make his WordPress installation run slower, and to avoid a longer argument I searched for another solution. I tried to convince him that SMTP would be a much more reliable solution but he didn't agree :)
    0
  • cPanelMichael
    Hello, I'm glad to see the "-f" parameter in the PHP configuration file helped. Thank you for updating us with the outcome.
    0
  • zylstra
    The point here is that DirectAdmin allows users to send email via WordPress without, as in cPanel's case, spending hours figuring out why their emails are not delivered. Why does cPanel not set -f user@domain.tld by default?
    0
  • cPanelMichael
    Hello @zylstra, You can enable Set SMTP Sender: headers under the Mail tab in WHM >> Exim Configuration Manager >> Basic Editor if you want to turn this on globally without modifying the PHP configuration. Here's the description of this option: (-f flag passed to sendmail) This will create "On behalf of" notices in Microsoft" Outlook, but it may also help track abuse of the mail system since recipients will see the SMTP login used to send each message.
    You can also verify the following options are enabled: 1. Trust X-PHP-Script headers to determine the sender of email sent from processes running as nobody If the MailHeaders patch is installed in EasyApache, cPanel will use the X-PHP-Script to determine the sender of a message for Email Archiving and Limits. 2. Query Apache server status to determine the sender of email sent from processes running as nobody If X-PHP-Script headers are not available (MailHeaders patch is not installed in EasyApache) or not trusted, cPanel will query the webserver in order to determine the sender. This requires more resources then simply trusting the X-PHP-Script headers. 3. EXPERIMENTAL: Rewrite From: header to match actual sender If you enabled this option, the From: header will be rewritten to be the email address of the actual message sender. If you choose the "remote" option, only messages that are being sent to remote destinations will be affected. Note the MailHeaders patch is compiled with PHP by default with EasyApache 4. Thank you.
    0
  • 000
    just I have the same error. many messages sended to user@hostname how I can config ANY MAIL to hostname go to MYADRESS@HOTMAIL.COM ??
    0
  • cPRex Jurassic Moderator
    @000 - are you seeing these messages come from WordPress directly? If so, did the previous workarounds mentioned not work well for you?
    0
  • 000
    @000 - are you seeing these messages come from WordPress directly? If so, did the previous workarounds mentioned not work well for you?

    thanks, no't is from WP, is from mail delivery, errors, etc...
    exigrep iF22Gudg8l9PFgAANvlYoQ /var/log/exim_mainlog 2021-01-03 19:27:19 1kwDiR-0001Je-7q => usercPanel R=localuser T=dovecot_delivery C="250 2.0.0 iF22Gudg8l9PFgAANvlYoQ Saved"
    saved WHERE?
    0
  • cPRex Jurassic Moderator
    For this issue it might be better to open a ticket so we can see the actual domain and user in question and provide you with accurate information on what is happening with those messages.
    0
  • 000
    For this issue it might be better to open a ticket so we can see the actual domain and user in question and provide you with accurate information on what is happening with those messages.

    thanks master, id #94100062
    0
  • cPRex Jurassic Moderator
    Thanks for getting that submitted :D
    0
  • 000
    Thanks for getting that submitted :D

    hello, your staff say:
    Unfortunately, there is not a method in cPanel or WHM to have all emails sent to your hostname forwarded to another location.
    :-| and also say:
    How to use email accounts on the server's hostname: https://support.cpanel.net/hc/en-us/articles/360054064033
    thanks.
    0
  • 000
    Ah!, finally I can see my IMPORTANT message sended to usercPanel@hostname: ################################################################## To check messages that have been sent to this account you may use the following steps: - Login to the cPanel - Click on the Email Accounts icon - Locate the account with the blue "Default" badge - Click "Check Email" ##################################################################
    0

Please sign in to leave a comment.