[PHP] PHP sendmail proxy (using xinetd)

2006-11-26 Thread Kelly Jones

I'm trying to write a sendmail proxy in PHP: people would connect to
my proxy running on port 25 (via xinetd), and the proxy would connect
to sendmail (tweaked to run on port 26).

Currently, the proxy is 100% transparent, but I plan to tweak it to
intercept sendmail's replies and substitute its own. My ultimate goal
is to implement sender-recipient-based greylisting (not IP-based
greylisting, which can be done without a proxy).

My problem: the proxy works fine when I test it, but seems to cutoff
some clients. I send the clients a message accepted for delivery
message and close the connection, but the client thinks it's been
cutoff and tries to deliver the mail again a little later (ironically,
this is the behavior I'll want when I start greylisting, but not
now!). This happens w/ legitimate ISP SMTP clients, not just spammers.

I suspect I'm doing something wrong with buffering or flushing. I made
both STDIN and the socket connection (to port 26, where sendmail's
running for real) nonblocking, since it's hardish to tell which one's
going to speak next.

Is there any generic proxy code I could use? An existing PHP sendmail
proxy would be even better.

Note: I realize that using a proxy means that *all* sendmail
connections appear to come from localhost, which is dangerous. Once in
production, my proxy will handle this situation by using xinetd's
REMOTE_HOST environment variable.

--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php/sendmail/apache/linux...

2003-01-24 Thread Bruce Douglas
hey...

I'm sure the question has been answered a 1000 times!!! I'm trying to create
a simple app to send email via PHP, using the mail function.

I'm using RedHat(Linux 8.0 , Sendmail), PHP(4.2.2), Apache (2.0.40).

I'm using the following piece of code:

===
//test mail
$to = [EMAIL PROTECTED];
$subject = savannah registration;
$message =  testing mail;
$reply = From: [EMAIL PROTECTED]\r\n
.Reply-To: [EMAIL PROTECTED]\r\n;

echo
 to =  . $to . br;

echo
 subject =  . $subject . br;

echo
 msg =  . $message . br;

echo
 reply =  . $reply . br;

 $q1 = mail($to, $subject, $message, $reply);
echo
 return val  =  . $q1 . br;


===

Pretty simple eh... The problem that I have is that the mail doesn't appear
to get sent. When I look in the /var/spool/clientmqueue directory, I see a
great deal of what look to be error msgs They appear to be telling me
that the mail couldn't be delivered, but I can't tell why

I was able to successfully send a test msg via Sendmail from the command
line by telnet. So I know the Sendmail engine/daemon seems to be
performing... The PHP.ini file appears to be setup correctly, with the
sendmail_path pointing to sendamil.

Any ideas as to what I need to do, or should be checking

Any pointers/assistance would be greatly appreciated.


Thanks

-Bruce
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP sendmail configuration

2003-01-07 Thread Petre Agenbag
The problem you are having took me a while to grasp. Basically, what
happens is that sendmail sends the mail as the user php/apache was
installed as (usually nobody@ or apache@ yourdomain.com).
Setting the Return-Path does not work, as you cannot override the
Return-Path set by the server in this way, that's why messages bounce to
your root account when sent with a php mail() function. If you only host
one domain on a server, you can fix this by editing the sendmail.cf file
and setting the Return-Path: to something more meaningful: However, most
people don't have the luxury of having a one domain hosting solution.

Your only other option is to invoke sendmail with the -f switch:
sendmail -f sender@address recipient@address file_containing_message

This forces a from: address, but it also produces a warning to the
recipient that the message headers might be forged, but return mails and
replies are directed to the address specified.

Only problem with all this is that you need to do one of 2 things:
a) use of PHP's system commands eg.
$mail = `echo -e Subject: Subject here\n\n Message here |
/usr/sbin/sendmail -f $your_address $recipient_address`;

OR

b) use a PERL script to do it.

I am currently looking at both, and it seems at this stage that the PERL
script will be the better option, specially if you need to mail to alot
of people. You need to issue the sendmail in a loop, and for load
balancing, it's best to put a sleep() inside the loop; even if you only
make this a sleep(1) (sleep for 1 sec), PHP will timeout after only 30
recipients unless you override the default timeout setting for php
scripts.

On Tue, 2003-01-07 at 03:09, Peter Houchin wrote:
 richard check your php.ini  the mail stuff in there .. it's most likely
 using the address either there or ur web server config file
 
  -Original Message-
  From: Richard Baskett [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, 7 January 2003 10:49 AM
  To: PHP General
  Subject: [PHP] PHP sendmail configuration
 
 
  Ok I know it's off topic, but I've been working on this for over
  5 hours now
  and I almost have it configured, but something is definitely wrong!
  Basically I can send email using sendmail by this command:
 
  echo Just a test | mail -s test [EMAIL PROTECTED]
 
  Now [EMAIL PROTECTED] receives the email, but the From address is
  [EMAIL PROTECTED] and I have no idea where it is getting that
  address from!  Does anyone know how I can change that from address?
 
  And what would stop the above command from delivering to certain
  valid email
  addresses?
 
  This is definitely causing problems with my php server also when trying to
  send emails...
 
  Rick
 
  Only a life lived for others is worth living. - Albert Einstein
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP sendmail configuration

2003-01-06 Thread Richard Baskett
Ok I know it's off topic, but I've been working on this for over 5 hours now
and I almost have it configured, but something is definitely wrong!
Basically I can send email using sendmail by this command:

echo Just a test | mail -s test [EMAIL PROTECTED]

Now [EMAIL PROTECTED] receives the email, but the From address is
[EMAIL PROTECTED] and I have no idea where it is getting that
address from!  Does anyone know how I can change that from address?

And what would stop the above command from delivering to certain valid email
addresses?

This is definitely causing problems with my php server also when trying to
send emails...

Rick

Only a life lived for others is worth living. - Albert Einstein


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP sendmail configuration

2003-01-06 Thread Peter Houchin
richard check your php.ini  the mail stuff in there .. it's most likely
using the address either there or ur web server config file

 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, 7 January 2003 10:49 AM
 To: PHP General
 Subject: [PHP] PHP sendmail configuration


 Ok I know it's off topic, but I've been working on this for over
 5 hours now
 and I almost have it configured, but something is definitely wrong!
 Basically I can send email using sendmail by this command:

 echo Just a test | mail -s test [EMAIL PROTECTED]

 Now [EMAIL PROTECTED] receives the email, but the From address is
 [EMAIL PROTECTED] and I have no idea where it is getting that
 address from!  Does anyone know how I can change that from address?

 And what would stop the above command from delivering to certain
 valid email
 addresses?

 This is definitely causing problems with my php server also when trying to
 send emails...

 Rick

 Only a life lived for others is worth living. - Albert Einstein


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP/Sendmail interaction : how to get rid of wrong emails

2001-08-28 Thread Sebastian Stadtlich

Hi all
 
I'm facing the Problem that lots of my users are too stupid to write
their email correct.
When i mail them with php a return email is send to me by their
mailserver, which
results in LOTS of mail for the root account.
Can i get sendmail to put the returned emails in a file? so that i can
check that file with php
and delete those mails from my DB ?
or is there a way to check the email when they enter it in a form
(online versus their mailserver)?
i already check for wrong email syntax, but that does not solve the
problem...
 
Sebastian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails

2001-08-28 Thread Jon Farmer

Well on submission of the email you could try contacting their mail server
and pretend to a have a mail for them using SMTP.

If you get a recipient ok or similar message.. ,thre is a code for it,
then at least the server accepts mail for that address. You might be better
off croning this rather than have the user wait on a http request.
Alternatively there is a perl mod that does this as well.

Secondly you could write a script that downloads the mail from root and
deletes out the database anything that bounces. You could even delete these
messages from the root account once done

HTH

Regards

Jon


--
Jon Farmer  տլ
Systems Programmer, Entanet www.enta.net
Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
PGP Key available, send blank email to [EMAIL PROTECTED]

-Original Message-
From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 15:08
To: 'Php-General (E-Mail)
Subject: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails


Hi all

I'm facing the Problem that lots of my users are too stupid to write
their email correct.
When i mail them with php a return email is send to me by their
mailserver, which
results in LOTS of mail for the root account.
Can i get sendmail to put the returned emails in a file? so that i can
check that file with php
and delete those mails from my DB ?
or is there a way to check the email when they enter it in a form
(online versus their mailserver)?
i already check for wrong email syntax, but that does not solve the
problem...

Sebastian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




AW: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails

2001-08-28 Thread Sebastian Stadtlich

any hint where to find the perl mod or some php-code that
contacts mailservers like you described?

 -Ursprüngliche Nachricht-
 Von: Jon Farmer [mailto:[EMAIL PROTECTED]]
 Gesendet: Dienstag, 28. August 2001 16:14
 An: Sebastian Stadtlich; 'Php-General (E-Mail)
 Betreff: RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong
 emails
 
 
 Well on submission of the email you could try contacting 
 their mail server
 and pretend to a have a mail for them using SMTP.
 
 If you get a recipient ok or similar message.. ,thre is a 
 code for it,
 then at least the server accepts mail for that address. You 
 might be better
 off croning this rather than have the user wait on a http request.
 Alternatively there is a perl mod that does this as well.
 
 Secondly you could write a script that downloads the mail 
 from root and
 deletes out the database anything that bounces. You could 
 even delete these
 messages from the root account once done
 
 HTH
 
 Regards
 
 Jon
 
 
 --
 Jon Farmer  Õ¿Õ¬
 Systems Programmer, Entanet www.enta.net
 Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
 PGP Key available, send blank email to [EMAIL PROTECTED]
 
 -Original Message-
 From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]]
 Sent: 28 August 2001 15:08
 To: 'Php-General (E-Mail)
 Subject: [PHP] PHP/Sendmail interaction : how to get rid of 
 wrong emails
 
 
 Hi all
 
 I'm facing the Problem that lots of my users are too stupid to write
 their email correct.
 When i mail them with php a return email is send to me by their
 mailserver, which
 results in LOTS of mail for the root account.
 Can i get sendmail to put the returned emails in a file? so that i can
 check that file with php
 and delete those mails from my DB ?
 or is there a way to check the email when they enter it in a form
 (online versus their mailserver)?
 i already check for wrong email syntax, but that does not solve the
 problem...
 
 Sebastian
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails

2001-08-28 Thread Jon Farmer

For perl look at

http://www.cpan.org/modules/by-category/19_Mail_and_Usenet_News/Mail/Mail-Ch
eckUser-1.02.readme

As for php you would need to open a socket connection.. My advice would be
to use the perl module and call a perl script from php.

Regards

Jon

--
Jon Farmer  Õ¿Õ¬
Systems Programmer, Entanet www.enta.net
Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
PGP Key available, send blank email to [EMAIL PROTECTED]

-Original Message-
From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 15:26
To: 'Php-General (E-Mail)
Subject: AW: [PHP] PHP/Sendmail interaction : how to get rid of wrong
emails


any hint where to find the perl mod or some php-code that
contacts mailservers like you described?

 -Ursprüngliche Nachricht-
 Von: Jon Farmer [mailto:[EMAIL PROTECTED]]
 Gesendet: Dienstag, 28. August 2001 16:14
 An: Sebastian Stadtlich; 'Php-General (E-Mail)
 Betreff: RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong
 emails


 Well on submission of the email you could try contacting
 their mail server
 and pretend to a have a mail for them using SMTP.

 If you get a recipient ok or similar message.. ,thre is a
 code for it,
 then at least the server accepts mail for that address. You
 might be better
 off croning this rather than have the user wait on a http request.
 Alternatively there is a perl mod that does this as well.

 Secondly you could write a script that downloads the mail
 from root and
 deletes out the database anything that bounces. You could
 even delete these
 messages from the root account once done

 HTH

 Regards

 Jon


 --
 Jon Farmer  Õ¿Õ¬
 Systems Programmer, Entanet www.enta.net
 Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
 PGP Key available, send blank email to [EMAIL PROTECTED]

 -Original Message-
 From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]]
 Sent: 28 August 2001 15:08
 To: 'Php-General (E-Mail)
 Subject: [PHP] PHP/Sendmail interaction : how to get rid of
 wrong emails


 Hi all

 I'm facing the Problem that lots of my users are too stupid to write
 their email correct.
 When i mail them with php a return email is send to me by their
 mailserver, which
 results in LOTS of mail for the root account.
 Can i get sendmail to put the returned emails in a file? so that i can
 check that file with php
 and delete those mails from my DB ?
 or is there a way to check the email when they enter it in a form
 (online versus their mailserver)?
 i already check for wrong email syntax, but that does not solve the
 problem...

 Sebastian

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP sendmail

2001-08-24 Thread Juraj Hasko

Hi,

I would like to know if PHP on *nix system can use another SMTP mailer than sendmail. 
On WinNT is PHP indipendent on concrete mail-server. In our company we use Symantec's 
Mail-Gear on Linux (Slackware) and I'd like to setup PHP use it. Is it posible ?
Thanks in advance,

Juraj Hako
System Administrator

CAC LEASING Slovakia, a.s.



RE: [PHP] PHP sendmail

2001-08-24 Thread Jon Haworth

Yup, try qmail: www.qmail.org

You need to adjust the setting in your php.ini as well.

HTH
Jon


-Original Message-
From: Juraj Hasko [mailto:[EMAIL PROTECTED]]
Sent: 24 August 2001 14:19
To: [EMAIL PROTECTED]
Subject: [PHP] PHP  sendmail


Hi,

I would like to know if PHP on *nix system can use another SMTP mailer than
sendmail. On WinNT is PHP indipendent on concrete mail-server. In our
company we use Symantec's Mail-Gear on Linux (Slackware) and I'd like to
setup PHP use it. Is it posible ?
Thanks in advance,

Juraj Hako
System Administrator

CAC LEASING Slovakia, a.s.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP sendmail

2001-08-24 Thread Pavel Jartsev

Juraj Hasko wrote:
 
 Hi,
 
 I would like to know if PHP on *nix system can use another SMTP mailer than 
sendmail. On WinNT is PHP indipendent on concrete mail-server. In our company we
 use Symantec's Mail-Gear on Linux (Slackware) and I'd like to setup PHP use it. Is 
it posible ?

http://www.php.net/manual/en/configuration.php#ini.sendmail-path

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP sendmail

2001-08-24 Thread Juraj Hasko

Mail-Gear hasn't sendmail wrapper.

Juraj

Juraj Hasko wrote:
 
 Hi,
 
 I would like to know if PHP on *nix system can use another 
SMTP mailer than sendmail. On WinNT is PHP indipendent on 
concrete mail-server. In our company we
 use Symantec's Mail-Gear on Linux (Slackware) and I'd like 
to setup PHP use it. Is it posible ?

http://www.php.net/manual/en/configuration.php#ini.sendmail-path

-- 
Pavel a.k.a. Papi


Re: [PHP] PHP sendmail

2001-08-24 Thread Yasuo Ohgaki

Juraj Hasko [EMAIL PROTECTED] wrote in message
007c01c12ca3$c2ae51a0$ec01db0a@HASKO">news:007c01c12ca3$c2ae51a0$ec01db0a@HASKO...
 Mail-Gear hasn't sendmail wrapper.



How about nullmailer?
It has sendmail wrapper and could send message to any smtp or qmqp
servers.

http://untroubled.org/nullmailer/

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]