The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sending Mail As user@domain.com

Discussion in 'E-mail Discussions' started by SonServers, Oct 23, 2007.

  1. SonServers

    SonServers Well-Known Member

    Joined:
    Oct 24, 2001
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I just set up an additional Cpanel server on Centos5.

    I configured the server to run with phpsuexec.

    Mail being sent from user's crons and scripts is being sent from:
    user@hostname.server.com

    rather than
    user@userdomain.com

    Can anyone point me in the right direction on how to make mail send from the user's domain rather than server's hostname?


    Thanks!
     
  2. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    That's normal. If it is cron scripts sending mail, it does not matter that the FROM address is user@hostname.server.com - nobody is going to reply to cron emails.

    Mail being sent from user scripts is usually only snet as user@hostname.server.com if the scripts themselves do not specify a specific sender address in their configuration.

    Mike
     
  3. SonServers

    SonServers Well-Known Member

    Joined:
    Oct 24, 2001
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Mike,

    My problem is not in a need to reply to cron's mail, but when mailing to a remote server that has sender verify. When sending to another server that is verifying senders, the email fails because user@hostname.server.com does not exist on the sending server.
     
  4. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    I don't have an answer for that one. The user account email shoudl be created with each account creation.

    For instance, if I add the domain mikelikeshisnew22inchlcdmonitor.com to the machine cpanel.mikesmediocrewebhosting.com and the account login associated with that is 'mike22', I can then send an email to mike22@@cpanel.mikesmediocrewebhosting.com and the email will end up in /home/mike22/mail/new

    Mike
     
  5. SonServers

    SonServers Well-Known Member

    Joined:
    Oct 24, 2001
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Oh, ok . . . I have Radio Head's Deluxe ASSP running. It automatically adds the allow for user@domain but not user@hostname.

    I asked him about it and got a reply, that user@domain is added, but I don't think he understood I was sending from user@hostname. The longer I thought about it I began to think that maybe sending as user@domain is the way it "should" be sending and that sending as user@hostname is a config issue on the server.
     
  6. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    I'm not sure of why it is like it is - however, one guess is that there would be no way for PHP to know to send from user@domain.com unless the script actually has that coded in it - whereby, it knows to send out emails that don't have a specific sender address supplied by using simply 'user' as the FROM address. And the server hostname gets tacked on to the end of those addresses that don't contain a fully qualified hostname/domain name at the end.

    So it's not a flaw of PHP or of Cpanel - Cpanel accounts for this by having a default account set up. Whether that changes with the use of ASSP is something ASSP needs to account for, or something you need to account for in ASSP's config :)

    Mike
     
  7. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    If you want allow user@server.hostname.com

    pico /usr/local/assp/deluxe/assp_catch_all
    and add a line with
    @server.hostname.com

    When the update_email.php will be executed (each 3 minutes by default) , @server.hostname.com will be added to assp_local_email and
    user@server.hostname.com will be allowed by assp.

    Negative point : you may receive email dictionary attacks to your @server.hostname.com .

    so , other simple solution , if you are having this problem because your user is not receiving cronjob email notification ,
    simply edit the client cron with

    crontab -e -u username

    and at the top of client cron add this line
    MAILTO="clientemail@domain.com"

    The cronjob will be sent to MAILTO="clientemail@domain.com" instead of default
    user@hostname

    If the problem is not only cron but also scripts , then allow @server.hostname.com as explained above.


    Bye
     
    #7 Radio_Head, Oct 24, 2007
    Last edited: Oct 24, 2007
  8. SonServers

    SonServers Well-Known Member

    Joined:
    Oct 24, 2001
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Radio_Head . . . adding the server hostname to the catch all file worked. The outgoing emails now pass the receiving server's sender verify.

    That really was the only problem, getting them to pass sender verification on the other side.

    Thanks again to both of you who responded.

    :)
     
Loading...

Share This Page