Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What is stopping me from sending mail as another user?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
freedomadvocate
n00b
n00b


Joined: 13 Dec 2002
Posts: 5

PostPosted: Fri Jan 03, 2003 9:40 pm    Post subject: What is stopping me from sending mail as another user? Reply with quote

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
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sun Jan 05, 2003 1:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Jan 05, 2003 7:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
jukka
Apprentice
Apprentice


Joined: 06 Jun 2002
Posts: 249
Location: Zurich, Switzerland

PostPosted: Sun Jan 05, 2003 8:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Jan 05, 2003 8:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
jukka
Apprentice
Apprentice


Joined: 06 Jun 2002
Posts: 249
Location: Zurich, Switzerland

PostPosted: Mon Jan 06, 2003 12:06 am    Post subject: Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Mon Jan 06, 2003 4:26 am    Post subject: Reply with quote

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
View user's profile Send private message
freedomadvocate
n00b
n00b


Joined: 13 Dec 2002
Posts: 5

PostPosted: Mon Jan 06, 2003 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jan 06, 2003 1:21 pm    Post subject: Re: What is stopping me from sending mail as another user? Reply with quote

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
View user's profile Send private message
freedomadvocate
n00b
n00b


Joined: 13 Dec 2002
Posts: 5

PostPosted: Mon Jan 06, 2003 1:40 pm    Post subject: Reply with quote

lrwxrwxrwx 1 root root 15 Dec 12 05:50 /usr/sbin/sendmail -> /usr/sbin/ssmtp
Back to top
View user's profile Send private message
freedomadvocate
n00b
n00b


Joined: 13 Dec 2002
Posts: 5

PostPosted: Mon Jan 06, 2003 1:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
jukka
Apprentice
Apprentice


Joined: 06 Jun 2002
Posts: 249
Location: Zurich, Switzerland

PostPosted: Mon Jan 06, 2003 2:10 pm    Post subject: Reply with quote

rac wrote:
Do you think this FromLineOverride directive might help freedomadvocate spoof with ssmtp?

yes. ;-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum