Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im using sendmail on my Ubuntu server.
When I send an email with command line on the server, it still works fine.
But when I use sendmail with php, default it takes root@mydomain for sender(not my sender's email which i typed in) and I cant receive mail.
This is the log file
Jan 27 18:11:51 vn-local sm-mta[6085]: o0RABp3N006085: from=<root@vn-local.com>, size=344, class=0, nrcpts=1, msgid=<201001271011.o0RABp1g006084@vn-local.com>, proto=ESMTP, daemon=MSP-v4, relay=localhost [127.0.0.1]
Jan 27 18:11:51 vn-local sendmail[6084]: o0RABp1g006084: to=kelly.do@abc.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30127, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o0RABp3N006085 Message accepted for delivery)
Although stat=Sent, but I can't received the email.
Im using sendmail on my Ubuntu server.
When I send an email with command line on the server, it still works fine.
But when I use sendmail with php, default it takes root@mydomain for sender(not my sender's email which i typed in) and I cant receive mail.
This is the log file
Jan 27 18:11:51 vn-local sm-mta[6085]: o0RABp3N006085: from=<root@vn-local.com>, size=344, class=0, nrcpts=1, msgid=<201001271011.o0RABp1g006084@vn-local.com>, proto=ESMTP, daemon=MSP-v4, relay=localhost [127.0.0.1]
Jan 27 18:11:51 vn-local sendmail[6084]: o0RABp1g006084: to=kelly.do@abc.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30127, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o0RABp3N006085 Message accepted for delivery)
Although stat=Sent, but I can't received the email.
Please help me!!!
Not to sound snotty, but you need to fix your program.
The PHP program running from a web page isn't running as a 'regular' user...it's running as root/wwwserver/whatever your web server is running as. So sendmail is picking up that UID when it's run. And you don't say how you're calling sendmail (via module? Perl script? shell_exec?), so it's hard to say what to do. But you'll have to explicitly specify the FROM address in your code, which sounds like isn't happening now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.