View previous topic :: View next topic |
Author |
Message |
freedomadvocate n00b
Joined: 13 Dec 2002 Posts: 5
|
Posted: Fri Jan 03, 2003 9:40 pm Post subject: What is stopping me from sending mail as another user? |
|
|
I have not emerge'd sendmail, yet I have /usr/sbin/sendmail available to me. My problem is that I cannot figure out why PHP will not work with the -f switch. sendmail -f anybody@all.com works fine from a shell from any account on the system. Whenever I run a PHP script however, the email will not go anywhere unless I use the correct account name that the script is running as. I have added the path to sendmail and added the -f -t and -i options and all combinations of those. What can I do to fix this? |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Sun Jan 05, 2003 1:34 pm Post subject: |
|
|
Well, what MTA are you running if it's not sendmail? The answer to your question depends on the particular MTA you're using. With exim, you have to properly set and configure the trusted_users option in your /etc/exim/exim.conf file. Other MTAs have different settings.
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sun Jan 05, 2003 7:02 pm Post subject: |
|
|
Assuming you're using ssmtp, the ssmtp man page suggests that -f only works if there is no From header in the mail. Could this be the problem? _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
jukka Apprentice
Joined: 06 Jun 2002 Posts: 249 Location: Zurich, Switzerland
|
Posted: Sun Jan 05, 2003 8:11 pm Post subject: |
|
|
rac wrote: | Assuming you're using ssmtp, the ssmtp man page suggests that -f only works if there is no From header in the mail. Could this be the problem? |
it works even if a From: header is present, but its value gets overwritten in that case. |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sun Jan 05, 2003 8:33 pm Post subject: |
|
|
jukka wrote: | it works even if a From: header is present, but its value gets overwritten in that case. | Really? I just took a quick look at ssmtp.c, and it looks to me like the man page is correct. It looks to me like specifiedFrom is only used if hasFrom is false. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
jukka Apprentice
Joined: 06 Jun 2002 Posts: 249 Location: Zurich, Switzerland
|
Posted: Mon Jan 06, 2003 12:06 am Post subject: |
|
|
rac wrote: | Really? I just took a quick look at ssmtp.c, and it looks to me like the man page is correct. It looks to me like specifiedFrom is only used if hasFrom is false. |
all three of us (you, the man page and me ) were right, but maybe i was not very precise. i tried to say that if you supply a '-f <address>' option AND a 'From: <address>' header, the mail is sent anyhow. the values of the From: header and the envelope depend on the value of the FromLineOverride setting in /etc/ssmtp/ssmtp.conf. a short summary: Code: | SETTINGS | RESULTS
FLO -f From: | envelope From: header
------------------------------------------------------------
NO yes yes | -f generated
NO yes no | -f -f
NO no yes | generated generated
NO no no | generated generated
YES yes yes | From: From:
YES yes no | -f -f
YES no yes | From: From:
YES no no | generated generated
------------------------------------------------------------
* FLO = FromLineOverride |
greetings, jukka |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Mon Jan 06, 2003 4:26 am Post subject: |
|
|
jukka,
Thanks for taking the time to make such a detailed investigation. Do you think this FromLineOverride directive might help freedomadvocate spoof with ssmtp? _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
freedomadvocate n00b
Joined: 13 Dec 2002 Posts: 5
|
Posted: Mon Jan 06, 2003 1:18 pm Post subject: |
|
|
As far as I know, I am not running an MTA on this box. Maybe I am confused though. Maybe you are on to something though, could there be a problem with me sending this faked mail on my mailserver which is on another machine? I'm going to look for errors in it's logs now. |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Mon Jan 06, 2003 1:21 pm Post subject: Re: What is stopping me from sending mail as another user? |
|
|
freedomadvocate wrote: | As far as I know, I am not running an MTA on this box. |
Well, if the following statement is true:
freedomadvocate wrote: | I have not emerge'd sendmail, yet I have /usr/sbin/sendmail available to me. |
Then yes you are. Chances are, /usr/sbin/sendmail is a symlink -- what's it symlinked to?
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
freedomadvocate n00b
Joined: 13 Dec 2002 Posts: 5
|
Posted: Mon Jan 06, 2003 1:40 pm Post subject: |
|
|
lrwxrwxrwx 1 root root 15 Dec 12 05:50 /usr/sbin/sendmail -> /usr/sbin/ssmtp |
|
Back to top |
|
|
freedomadvocate n00b
Joined: 13 Dec 2002 Posts: 5
|
Posted: Mon Jan 06, 2003 1:55 pm Post subject: |
|
|
I think I fixed my problem. Here is the offending file and the line that I uncommented.
From /etc/ssmtp/ssmtp.conf
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES
Thanks to all who helped!!! |
|
Back to top |
|
|
jukka Apprentice
Joined: 06 Jun 2002 Posts: 249 Location: Zurich, Switzerland
|
Posted: Mon Jan 06, 2003 2:10 pm Post subject: |
|
|
rac wrote: | Do you think this FromLineOverride directive might help freedomadvocate spoof with ssmtp? |
yes. |
|
Back to top |
|
|
|