ListMailPRO Email Marketing Software Forums

ListMailPRO Email Marketing Software Forums => Server Optimization, Tweaks => Topic started by: r.helfenberger on February 22, 2007, 10:04:49 am

Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: r.helfenberger on February 22, 2007, 10:04:49 am
Hi I'v got an "Sending error. Check your mail settings." during sending a mailing. I increased the log level of sendmail to see what happens. This is what I found in the maillog
Quote

Feb 22 18:22:37 cl-1041 sendmail[21103]: NOQUEUE: connect from localhost [127.0.0.1]
Feb 22 18:22:37 cl-1041 sendmail[21103]: AUTH: available mech=PLAIN CRAM-MD5 LOGIN DIGEST-MD5 ANONYMOUS, allowed mech=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: Milter: no active filter
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 220 myserver.mydomain.ch ESMTP Sendmail 8.13.7/8.13.4; Thu, 22 Feb 2007 18:22:37 +0100
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: <-- EHLO localhost
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-myserver.mydomain.ch Hello localhost [127.0.0.1], pleased to meet you
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-ENHANCEDSTATUSCODES
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-PIPELINING
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-8BITMIME
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-SIZE
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-DSN
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-ETRN
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-AUTH DIGEST-MD5 CRAM-MD5
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250-DELIVERBY
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250 HELP
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: <-- NOOP
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250 2.0.0 OK
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: <-- MAIL FROM: <list>
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250 2.1.0 <list>... Sender ok
Feb 22 18:22:37 cl-1041 sendmail[21103]: l1MHMb4r021103: <-- RCPT TO: <info>
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 451 hrc-telecom.ch: Name server timeout
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 050 <info>... Transient parse error -- message queued for future delivery
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 451 hrc-telecom.ch: Name server timeout
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 250 2.1.5 <info>... Recipient ok (will queue)
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: --- 421 4.4.1 myserver.mydomain.ch Lost input channel from localhost [127.0.0.1]
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: lost input channel from localhost [127.0.0.1] to MTA after rcpt
Feb 22 18:23:51 cl-1041 sendmail[21103]: l1MHMb4r021103: from=<list>, size=0, class=0, nrcpts=1, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]

After that the mailing stops. My interpretation: This is due to the error 451 or 421 4.4.1. I already read in this forum that I have to remove the first line in lm_sendq to make it possible to resume my mailing.
What I'm asking me: Is it really a good idea that one single E-Mail-address with a timeout error can stop the whole mailing? Shouldn't there be a fallback to automatically disable "corrupt" adresses and to continue the mailing automatically?

Best regards

Ralph
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: DW on February 22, 2007, 06:10:48 pm
Hi Ralph,

This seems to only happen on sendmail systems and, I believe, has to do with the fact that the mailer does a DNS lookup on the domain.

If you can figure out a way to turn off that feature you should be ok.

I don't recommend deleting a line from the send queue, although that can work.

What I would try is to set the line $smtp_timeout = 9; in config.php.  That should cause ListMail to only wait 9 seconds before issuing a "RSET" command to the SMTP server, which should allow it to move on the next email address.

Regards
Title: Reply Notification - Sending error. Check your mail settings
Post by: r.helfenberger on February 22, 2007, 11:22:54 pm
Hi Dean
Quote

What I would try is to set the line $smtp_timeout = 9; in config.php. That should cause ListMail to only wait 9 seconds before issuing a "RSET" command to the SMTP server, which should allow it to move on the next email address.


This is exactly the problem in this case: The mailing doesn't continue but is interrupted. Changing the $smtp_timeout to a different value doesn't change this behaviour. I also can't resume the mailing because it always stopped again with the first line from lm_sendq. If the mailing would continue this would be fine.

Are you suggesting me that using php mail instead of sendmail is the more robust solution?

Ralph
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: DW on February 23, 2007, 01:16:27 am
Ralph,

In my experience with this problem I have found increasing the SMTP timeout to 30, 45 or even 60 can help.  I am actually considering raising the default value due to this same issue on another installation.

You might try removing the offending user(s) from future mailing with a custom SQL query you can run through PhpMyAdmin:

delete from lm_users where id = '$USERID';

or

update lm_users set cnf = '2' where id = '$USERID';

Replace $USERID with the users' ID from lm_sendq (uid field)

I don't suggest sending your list email through PHP mail.

Regards
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: mike2 on February 23, 2007, 06:42:46 am
I use sendmail and never have this problem... because it's configured properly ( well mostly ).

What you want to do is make sure sendmail is in queue mode, so it queues the messages first, then when it runs the queue it delivers them ( or attempts to).

Here's some code for the sendmail.mc file, the first one puts it in queue mode, the last few make sure no dns lookup is done on the initial pass from LMP to sendmail:

Code: [Select]

define(`confDELIVERY_MODE', `q')

define(`confDONT_PROBE_INTERFACES', `true')
define(`confDIRECT_SUBMISSION_MODIFIERS', `C')
define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')
FEATURE(`nocanonify', `canonify_hosts')


Let me know if that helps.  If you are familiar with sendmail this will make sense, if not it will be crazy...   rebuild your .cf file and restart sendmail.
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: DW on February 23, 2007, 04:52:42 pm
There must be a config setting somewhere for this.  What about what's mentioned here (http://www.uwsg.iu.edu/hypermail/linux/net/9903.1/0140.html)?
Quote
Use FEATURE(accept_unresolvable_domains) when building sendmail.cf.
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: mike2 on February 25, 2007, 10:38:19 am
I think that's a bit dangerous, the features I listed above do exactly what is needed...  They delay the DNS check until the queue runner comes to pick up the job.  They don't hinder the initial submission, it works like this:

LMP sends the message to Sendmail, There are NO checks performed on the recipient at this time.  It sits in the queue for 1 minute ( adjustable ) then a completely seperate process ( queue runner ) comes along to work on the message and does it's job seperately in the background from there.  NO MAILING TIMEOUTS, ETC...  EVEN WITH A LIST OF 150K.
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: DW on February 25, 2007, 04:24:05 pm
Mike, you're the sendmail expert :D  The single-most relevant line must be as you suggest:
Code: [Select]
define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')
I should pay more attention.

I've been lost in qmail-patch hell with Plesk for about 2 days now but got it figured out and learned some stuff in the process.  Time to work on the LMP update again. ;)
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: r.helfenberger on March 16, 2007, 12:42:02 am
Hello Mike2
Thanks for your suggestion. I implemented it as you suggested and it works fine. I think the separation of the process queueing the mails and sending the mails is a good idea.

Ralph
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: mike2 on March 16, 2007, 03:44:02 am
Quote
Mike, you're the sendmail expert


Not quite an expert per se, but enough to make me dangerous and sometimes helpful...  :lol:

Quote from: "r.helfenberger"
Hello Mike2
Thanks for your suggestion. I implemented it as you suggested and it works fine. I think the separation of the process queueing the mails and sending the mails is a good idea.

Ralph


Glad to hear it helped you.  Yes I 100% believe the two processes should be separate honestly.
Title: How to Modify SendMail?
Post by: andrew on July 12, 2007, 11:26:06 am
Hi Mike,

Per DW, this seems like the solution that would greatly assist us as our SMTP sending continues to timeout with a Server 250 error after sending only 50-1000 emails. Our lists are several thousand so we weren't sure what to do.

Only thing is, how/where do you modify the sendmail.mc file?

We're working on our own dedicated server - so we've got access to do as required.

Thank you!!
Andrew Golden


Quote from: "mike2"
I use sendmail and never have this problem... because it's configured properly ( well mostly ).

What you want to do is make sure sendmail is in queue mode, so it queues the messages first, then when it runs the queue it delivers them ( or attempts to).

Here's some code for the sendmail.mc file, the first one puts it in queue mode, the last few make sure no dns lookup is done on the initial pass from LMP to sendmail:

Code: [Select]

define(`confDELIVERY_MODE', `q')

define(`confDONT_PROBE_INTERFACES', `true')
define(`confDIRECT_SUBMISSION_MODIFIERS', `C')
define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')
FEATURE(`nocanonify', `canonify_hosts')


Let me know if that helps.  If you are familiar with sendmail this will make sense, if not it will be crazy...   rebuild your .cf file and restart sendmail.
Title: Re: How to Modify SendMail?
Post by: mike2 on July 12, 2007, 11:55:46 am
Quote from: "andrew"
Only thing is, how/where do you modify the sendmail.mc file?


Normally it's in:  "/etc/mail"

But I use Redhat ( errr well now it's Fedora )... so I'm sure the location may vary with your server.  Simply do a "locate sendmail.mc" to find it.  You may need to do a "updatedb" first if needed.

-----

As for the "how" part, well that can be a bit more complicated and I highly suggest reading up on it, maybe the documentation at sendmail.org.

But basically you simply edit "sendmail.mc" in your favorite editor, adding the above where appropriate ( this is important ), then depending on your sendmail.mc/cf location, run "m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf" then restart sendmail, "service sendmail restart".

Hope that helps.
Title: Re: How to Modify SendMail?
Post by: andrew on July 12, 2007, 09:33:19 pm
Quote from: "mike2"


As for the "how" part, well that can be a bit more complicated and I highly suggest reading up on it, maybe the documentation at sendmail.org. Hope that helps.


Mike - Thank you!

I'll tell you, I know enough to know that this whole thing is over my head and I need to get some help.

But thank you for the post.

Andrew
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: mike2 on July 13, 2007, 11:39:13 am
Quote
I'll tell you, I know enough to know that this whole thing is over my head and I need to get some help.


I may consider helping you out with this sendmail part if you wish, maybe for a small fee ( Dean I hope you don't mind me doing this here, if so erase this and let me know ).

I'm guessing if your system is pretty normal I could do it for say $50.  If you wish to discuss it further PM me on here and I will give you my email address and we can talk further, thanks.

EDIT - Just noticed PM was disabled so email me:  <edited>
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: andrew on July 13, 2007, 11:56:55 am
DEAL!!

Emailing now and THANK YOU!

Andrew


Quote from: "mike2"
Quote
I'll tell you, I know enough to know that this whole thing is over my head and I need to get some help.


I may consider helping you out with this sendmail part if you wish, maybe for a small fee ( Dean I hope you don't mind me doing this here, if so erase this and let me know ).

I'm guessing if your system is pretty normal I could do it for say $50.  If you wish to discuss it further PM me on here and I will give you my email address and we can talk further, thanks.

EDIT - Just noticed PM was disabled so email me:  <edited>
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: DW on July 13, 2007, 03:25:48 pm
I don't mind -- I was late in responding and it's such a nice day [read: too hot to work hard :(]  I am still kicking my own butt to finish the update.  Maintaining a compact and aesthetic layout still seems to be the biggest challenge, but this thread is about Sendmail. :)

Best to both,
Title: Sendmail Fix -- Sending error. Check your mail settings.
Post by: mike2 on July 13, 2007, 04:57:47 pm
Thats cool Dean, thanks and it's pretty hot here also.

I got Andrews Listmail running good, even though his server wasn't even  running sendmail... when I logged on to it I found it was running exim.

This may help some folks here as to how I got this working good:

1 - I made sure the exim tweaks suggested here on this forum were in place and they were already done.

2 - I set up the resume.php in a cron job so even if his mailings stalled they would auto resume - but this alone didn't fix the real problem he was having, it was something much bigger.

3 - I noticed while examining his exim logs that the stall was basically a DNS delay error ( which is the basis of this thread anyway, just as it relates to sendmail ).  But this error was being caused by the server itself being somewhat mis-configured ( or at least not optimized ).  It was searching several unknown ( I'm guessing they may be the server companies ) nameservers for an answer to each query.

Since the server itself was running Named ( A DNS Server ) I simply told it to look to its own self to get the DNS answer.   This seemed to completely fix the stalling.

I also set his Listmail to reconnect to the SMTP server every 50 emails.

Bottom line is that the mail server SHOULD be running its own local DNS server or there should be one right on the line next to it that is fast.
Title: Confirmation
Post by: andrew on July 13, 2007, 05:05:26 pm
Well, what fun is it to talk about my server and not jump in the thread?!

Here's a completely unbiased, neutral, testimonial:

You both are great. Seriously. Between Dean helping us get things set up and Mike coming in to make the handful of changes that needed tweaking, our lists now run on their own!!

Now I know that likely sounds odd, especially to all of the LMP pros out there...but up until working with both Dean and Mike, I used to have to babysit my LMP through entire campaigns....of 300-400K! That translates into a lot of sleepless nights.

Trust me, LMP now runs with the Auto Resume script and the campaign, once started will finish even without the browser being open! No more staying up to click resume.

Dean- I don't know if it's possible, but it may be a good idea to add what Mike did for our server to the list of recommended tweaks for others to be able to benefit from it as well.

Thank you both for your help in optimizing one of the single best marketing tools developed.

Sincerely,

Andrew