Virtualmin configuring the default mailbox for mail() in php?

0 like 0 dislike
3 views
Server is LAMP and Virtualmin. How to configure a mailbox to send the mail with mail() in php on a virtual server. If there is in Virtualmin, it is advisable how to do it, if not then tell me in the direction of any configs or fields to dig.
by | 3 views

2 Answers

0 like 0 dislike
I'm afraid the connection between "box" for mail() and Virtualmin-Ohm no no. When you call mail(), php is not stupid calls /usr/sbin/sendmail and passes it the headers and the message. Max knows that sendmail is the UID of the process of its caller (so the address is obtained @).
\r
Another thing is that with headers, you can specify the return address and the From: field of outgoing emails and it is very simple approximately it call mail():
\r
\rmail('Someone ', 'Subject', 'Message', "From: From whom \Reply-To: Who is responsible ");
\r

\r
Or you can even specify additional parameters to sendmail via the fifth parameter to mail():
\r
\rmail('nobody@example.com', 'the subject', 'the message', null, '-fwebmaster@example.com');
\r

\r
but it's not that flexible for my taste.
\r
In Google there are tips to change the sendmail_from parameter in php.ini, but they are wrong — this setting only works in Windows.
by
0 like 0 dislike
As written dmiceman, when sending mail with a script - no sender, but you can specify the FROM field.
To do this in the php file.ini specify:
sendmail_path = "/usr/sbin/sendmail -t-i-f mail@domain.tld"
Replacing mail@domain.tld desired address.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 3, 2019 by Anton_volkov
110,608 questions
257,186 answers
0 comments
1,107 users