Page 2 of 6

Posted: Thu May 25, 2006 6:39 pm
by akreider
My host seems to limit the number of emails sent by sendmail to 10. When I tried sending 20, they only sent the first 10. Very strange. So I need to create a new connection every 10 emails. I imagine this isn't the most efficient solution.


I think sendmail is taking 0.3 seconds to send an email. It's hard to say because it varies a lot (between 0.1 and 1.5 seconds). My host is using exim and spamassassin - could that be slowing it down?

Posted: Thu May 25, 2006 7:55 pm
by RobertGonzalez
Sendmail limits are an enormous challenge faced by shared hosting accounts and the hosts that do not want to be associated with spam. Kinda sucks that their limit is 10, although I have seen some that limit emails per day to 50. That is weak.

Posted: Thu May 25, 2006 10:21 pm
by akreider
I can open multiple connections. So I send 10, close the connection and then another 10.

Posted: Fri May 26, 2006 2:26 am
by Chris Corbyn
akreider wrote:My host seems to limit the number of emails sent by sendmail to 10. When I tried sending 20, they only sent the first 10. Very strange. So I need to create a new connection every 10 emails. I imagine this isn't the most efficient solution.


I think sendmail is taking 0.3 seconds to send an email. It's hard to say because it varies a lot (between 0.1 and 1.5 seconds). My host is using exim and spamassassin - could that be slowing it down?
The exim MTA has an option to do this too. It was another feature that was supposed to be in 1.0 before it's release (an option to ask Swift re-connect every X emails). I'm not sure how I'm going to version the next release because the number of additional features will be fairly significant but it seems silly to go 1.0 --> 2.0 so quickly 8O.

Spamassassin would add a small amount of overhead yes, even moreso if they have RBL checks enabled and Bayes auto-learn.

Posted: Fri May 26, 2006 2:17 pm
by Roja
d11wtq wrote:Spamassassin would add a small amount of overhead yes, even moreso if they have RBL checks enabled and Bayes auto-learn.
Generally, spamassassin works on INCOMING mail, not outgoing, so no, it shouldn't add overhead.

Posted: Fri May 26, 2006 2:50 pm
by Chris Corbyn
Roja wrote:
d11wtq wrote:Spamassassin would add a small amount of overhead yes, even moreso if they have RBL checks enabled and Bayes auto-learn.
Generally, spamassassin works on INCOMING mail, not outgoing, so no, it shouldn't add overhead.
lmao :lol: I can't believe I just typed that without even thinking what I was saying. I even run spamassassin myself and it never crossed my mind when I wrote it. But yes, you're quite right. It's possible to use the exim system filter to scan with exim though, and this may be a good idea on shared hosts, although I doubt many would.

Posted: Sat May 27, 2006 3:07 pm
by anthony88guy
First off, Very Nice. I've been looking for something like this and didn’t want to use phpMailer.

The first time I ran it I was able to send emails to yahoo, gmail, and optonline (my ISP). Now I cant. Here are the logs trying to send to gmail.
Log: Array ( [0] => Array ( [command] => [time] => 0.49302400 1148759881 [response] => 220 df12.dot5hosting.com ESMTP ) [1] => Array ( [command] => EHLO members.theeliteforces.com [time] => 0.70961700 1148759882 [response] => 250-df12.dot5hosting.com 250-PIPELINING 250 8BITMIME ) [2] => Array ( [command] => MAIL FROM: admin@theeliteforces.com [time] => 0.71221000 1148759882 [response] => 250 ok ) [3] => Array ( [command] => RCPT TO: brosta@gmail.com [time] => 0.71234400 1148759882 [response] => 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) ) )
I think it is a problem with my hosting. Any help would be greatly appreciated.

Posted: Sat May 27, 2006 3:15 pm
by Chris Corbyn
anthony88guy wrote:First off, Very Nice. I've been looking for something like this and didn’t want to use phpMailer.

The first time I ran it I was able to send emails to yahoo, gmail, and optonline (my ISP). Now I cant. Here are the logs trying to send to gmail.
Log: Array ( [0] => Array ( [command] => [time] => 0.49302400 1148759881 [response] => 220 df12.dot5hosting.com ESMTP ) [1] => Array ( [command] => EHLO members.theeliteforces.com [time] => 0.70961700 1148759882 [response] => 250-df12.dot5hosting.com 250-PIPELINING 250 8BITMIME ) [2] => Array ( [command] => MAIL FROM: admin@theeliteforces.com [time] => 0.71221000 1148759882 [response] => 250 ok ) [3] => Array ( [command] => RCPT TO: brosta@gmail.com [time] => 0.71234400 1148759882 [response] => 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) ) )
I think it is a problem with my hosting. Any help would be greatly appreciated.
Yes it's an issue with the host itself.

The key line is:
sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
It means you're trying to relay mail through a server that you weren't granted access to. Maybe you have a username/password for it? In that case you can call authenticate() to allow you to relay mail.

http://www.swiftmailer.org/?p=documenta ... ct=21#view

Posted: Mon May 29, 2006 10:25 pm
by anthony88guy
I'm trying to use my ISP's SMTP mail server to send email through my host since I am having problems with them.

Code: Select all

<?php
require('includes/swift_mailer/Swift.php');  //correct paths
require('includes/swift_mailer/Swift_SMTP_Connection.php');  //correct paths
require('includes/swift_mailer/Swift_LOGIN_Authenticator.php');  //correct paths

//This sets up our connection object
$connection = new Swift_SMTP_Connection('mail.optonline.net'); //my ISP mail server

//The mailer will now establish a connection with the server
$mailer = new Swift($connection, $_SERVER['SERVER_NAME']);

//Load in an authenticator to use (this will hopefully be done automagically in future)
$mailer->loadAuthenticator(new Swift_LOGIN_Authenticator);

$recipients = array(
	'blah@gmail.com',
	'blah@hotmail.com',
	'blah@yahoo.com',
	'blah@optonline.net'
);  //test email addresses

//If anything goes wrong you can see what happened in the logs
if (!$mailer->hasFailed()) //Optional
{
	//You can call authenticate() anywhere before calling send()
	if ($mailer->authenticate('username', 'password'))
	{
		$mailer->addPart('testing testing testing testing testing tesing tseitng', 'text/html');
		//Sends a simple email
		$mailer->send(
			$recipients,
			'"my name" <admin@blah.com>',
			'test'
			);
	}else{
		
		echo "Didn't authenticate to server";
	
	}
	
	//Closes cleanly... works without this but it's not as polite.
	$mailer->close();
}
else
{
	 echo "The mailer failed to connect. Errors: ".print_r($mailer->errors, 1);
}

echo "Log: " . print_r($mailer->transactions, 1);
?>
The mailer failed to connect. Errors: Array ( [0] => Array ( [num] => 0 [time] => 0.86760300 1148958727 [message] => Connection to the given MTA failed ) ) Log: Array ( )
I don't understand where I am going wrong. Thank you for your support.

Posted: Tue May 30, 2006 5:07 am
by Chris Corbyn
Which version of Swift is this? Can you telnet to the server on port 25 from your host?

Posted: Tue May 30, 2006 5:14 am
by Chris Corbyn
I'm trying this myself (from telnet) and that server doesn't seem to respond on port 25:

Code: Select all

[d11wtq@pc-cac ~]$ telnet mail.optonline.net 25
Trying 167.206.5.250...
It just sat there for 5 mins like that :?

Tried an nmap:

Code: Select all

[d11wtq@pc-cac ~]$ nmap mail.optonline.net

Starting Nmap 4.01 ( http://www.insecure.org/nmap/ ) at 2006-05-30 11:21 GMT
Interesting ports on webmail.optonline.net (167.206.5.250):
(The 1668 ports scanned but not shown below are in state: filtered)
PORT    STATE SERVICE
80/tcp  open  http
110/tcp open  pop3
443/tcp open  https
587/tcp open  submission

Nmap finished: 1 IP address (1 host up) scanned in 48.816 seconds
[d11wtq@pc-cac ~]$
There's no SMTP service advertised on this host. I guess that's for reading mail only. SMTP.optonline.net doesn't exist neither. You need to find an SMTP server that works :)

Posted: Tue May 30, 2006 4:45 pm
by akreider
The Swift package could be better organized. For instance, there is a directory called 9b403dd7242f414c1050f3c77f13a0a9

And there is the use of tildas after extensions which baffles me. For instance you will have index.html and index.html~

Then there is the picture (durham.jpg) and the Linux From Scratch book =)

It'd be nice to have it as small as possible, and easier for people like me to include it in my existing software package. Currently it's about twice the size of my own package.

I appreciate the speedy recent release - just giving you some feedback that others might appreciate too.


...

Does anyone know how to set out the timeout values for the NuSOAP package? I'm trying to send out emails using Swift by calling a webservice and need more than 30 seconds to do it... I posted on the NuSOAP list, but it tends to be quiet.

Posted: Tue May 30, 2006 5:07 pm
by Chris Corbyn
akreider wrote:The Swift package could be better organized. For instance, there is a directory called 9b403dd7242f414c1050f3c77f13a0a9

And there is the use of tildas after extensions which baffles me. For instance you will have index.html and index.html~

Then there is the picture (durham.jpg) and the Linux From Scratch book =)

It'd be nice to have it as small as possible, and easier for people like me to include it in my existing software package. Currently it's about twice the size of my own package.

I appreciate the speedy recent release - just giving you some feedback that others might appreciate too.


...

Does anyone know how to set out the timeout values for the NuSOAP package? I'm trying to send out emails using Swift by calling a webservice and need more than 30 seconds to do it... I posted on the NuSOAP list, but it tends to be quiet.
The files are for the example attachments (actually only one file now). The files you're talking about are PHPDocumentor output files - can't really change that I'm afraid. Would you prefer just the online documentation mentioned in the README ?

Sorry about the tildes - must have forgotten to strip them when I packaged it up. They're backup files - quite harmless :)

I'm working on 1.1 at the moment - TLS support is now included for anybody with a Gmail account you're set to go :) Inline images are coming up too.

Not sure about your NuSOAP question sorry ;)

Posted: Tue May 30, 2006 5:11 pm
by Chris Corbyn
Got a quick user preference question cos I'm easy either way.

For inline images is it easier to do:

Code: Select all

$html_part = '
Here is an inline image! <img src="beach.png" alt="beach" />

Do you like it?
';

$mailer->addInlineImage('/path/to/beach.png');
or:

Code: Select all

$html_part = '
Here is an inline image! '.$mailer->addImage('/path/to/beach.png').'

do you like it?
';
EDIT | I'm starting to think the second way is better since there's less room for error.

Posted: Tue May 30, 2006 5:45 pm
by jayshields
Option 2.