Database mail queue stays INACTIVE

Hello
I tried for hours to get my notifications working, without success, on SQL Server 2008R2 Web Edition 64b
I send mail with the test :
USE msdbGOEXEC sp_send_dbmail @profile_name='ARRIERE',@recipients='[email protected]',@subject='Bonjour ',@body='Congrates Database Mail Received By you Successfully.'
But this mail seems to be never sent.
With:
EXEC msdb.dbo.sysmail_help_queue_sp @queue_type = 'mail';
The queue state is always INACTIVE, and length is growing everytime I send a email.
I tried to restart the mail system some times :
EXEC msdb.dbo.sysmail_stop_sp;
EXEC msdb.dbo.sysmail_start_sp;
The states goes RECEIVE OCURRING, but after some seconds and without intervention, it goes back to INACTIVE.
I tried to rester SQL Agent, SQL Server, the server himself, but no luck.
The broker is activated (SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ;)
I disabled every firewall, antivirus and others (by the way, I can do "telnet smtp.domain.tld 25" and send a mail with telnet.
With
SELECT * FROM msdb.dbo.sysmail_allitems;
I see all my mails with state "unsent".
Nothing logged in Event Viewer, SQL Events, and in sysmail_event_log I only get "Activation successful".
I configured the local IIS SMTP as a relay as said here : http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/f9744284-a9b6-4bfb-81b9-c4833f282ad0 
I cleaned the mails with:
DECLARE @GETDATE datetime
SET @GETDATE = GETDATE()
EXECUTE msdb.dbo.sysmail_delete_mailitems_sp @sent_before = @GETDATE;
GO
=> Nothing more.
Can I do something more?
Thans for your help.
Regards

X.Perignon,
Please check these items:
1. Checked the SQL Server agent alert sytem configuraion to understand if the Database
mail is enable or not. Right click SQL Server agent -> properties -> Alert system.
2. Run sp_configure, check Database mail is enabled. Sample is: Database
Mail XPs 0 1 1 1
3. Checked the SQL Server MSDB database for service broker as below:
select is_broker_enabled,* from sys.databases
4. Checked the status of the database mail and it is started.
EXECUTE dbo.sysmail_help_status_sp
If all above is already configured, please try to:
1. Create a mail account (domain account) dedicated for DB Mail
2. Change the SQL service account to the mail account
Best Regards,
Iric
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Similar Messages

  • How To reduce Mail Queue Database File?

    Hello Team,
    I setup exchange server 2013,i check daily mail queue database file increase .
    So how to decrease database file?i
    Thanks,
    Jemin Prajapati

    Hi Jim,
    While moving old queue, we will loose some mail during this operation.
    Can we do this activity without any downtime or without loosing any mail.
    Please confirm we only need to move mail.que and rest of other file (log and temp) will remain the same.
    What I am thinking how new queue will sync with old logs and other files.
    Thanks
    Hi
    If the new queue work without any problem, we could refer to the following steps:
    Use “Net stop MSExchangeTransport” to stop Exchange transport service.
    Overwrite all the existing empty queue database files and transaction log files on the target Exchange transport server by using all the files from "C:\QueueRecovery". By default, the queue database and transaction logs exist in C:\Program Files\Microsoft\Exchange
    Server\TransportRoles\data\Queue.
    A new queue database is created when the Microsoft Exchange Transport service is restarted. This can occur at any time after we have finished copying the queue database files to the target transport server.
    Use “ Net pause MXExchangeTransport ” to pause message flow through Hub Server
    Use the Queue Viewer or the Get-Queue cmdlet in the Exchange Management Shell to monitor the delivery queues on the target Exchange transport server. Wait until no messages remain in any of delivery queues on the server as indicated by a message count of
    0.
    Then we use “Net stop MSExchangeTransport” to stop Exchange transport service.
    Overwrite all the existing empty queue database files and transaction log files on the target Exchange transport server by using all the files from "C:\QueueRecovery". By default, the queue database and transaction logs exist in C:\Program Files\Microsoft\Exchange
    Server\TransportRoles\data\Queue.
    Use “Net start MSExchangeTransport” to enable Exchange transport service.
    We could refer to the following link to learn more details:
    http://technet.microsoft.com/en-us/library/bb124343(v=exchg.80).aspx
    If there are any questions regarding this issue, please be free to let me know.
    Best Regard,
    Jim

  • Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?

    Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?
    This has been a very common question I have seen relatedt to Database mail and I thought will post here so if you run into this issue, it could be due to one of the following and also have mentioned below how to get around them. Bottom line is datbase mail works fine with SQL Agent jobs and maintenace plans in SP1 on all platforms.
    1. If you see this on 64 bit platform and on RTM build, this is a bug that is addressed in SP1.
    2. If you see the below error message, it is known issue and this is because of design that requires SQL Agent to restart, if SQL Agent was started before enabling databasemail and setting a new profile. We are evaluating to change this design of not requiring to restart agent for our future release.
    Re: 264] An attempt was made to send an email when no email session has been established
    This problem will go away after restarting SQL Server Agent in this case. Thanks,
    Gops Dwarak, MSFT

    This may be related to the fact that DBMail, by default, shuts itself down after 10 minutes of inactivty.  If the mail service isn't running, you won't be able to queue up any mail messages.
    There may be a built-in mechanism for addressing this problem, but I found that I can detect this situation and start the mail listener before sending db mail.  I use the following in stored procs that need to send email.
    You could increase the inactivity period for db mail shutdown from 600 seconds to some larger value.  It might not make sense to do so, since shutting it down releases its resources back to teh system; if your SQL server only sneds mail infrequently, it might be better to start the mail listener on demand.  Someone with more experience than I might want to add their two cents' worth.  :-)
    /* Check the mail engine. Start the service if is is stopped         */
    /* -- the DB Mail engine shuts down after 10 minutes (of inactivity) */
    /* -- this setting can be changed, but we probably don't need to.    */
    DECLARE @rc INT
    IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
                   WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
        EXEC @rc = msdb.dbo.sysmail_start_sp
        -- TODO: add handling and logging for any engine start issues

  • Database mail not sending no error messages

    SQL server 2008 R2
    Database mail was up and running until sometime last week.  It seemed to quit in the middle of a long list of emails.  We had network issues at this same time that might have contributed to the issue.
    Everything checks out ok today but I cannot send a test email.  I do not see any error messages or 'db mail starting up' messages in the log.
    I do see the Email in the sysmail_unsentitems view.  
    I do not receive any error messages.
    I tried setting up a secondary account and that did not make a differnce.
    I tried stopping the mail service with EXEC msdb.dbo.sysmail_start_sp  and the query never completes.  I canceled after > 5 minutes 
    I deleted many unsent and one retrying message from the queue.  I see those actions in the log. 
    Is there any thing else I can try?
    KD

    Have you worked through the troubleshooting steps in the following BOL Topic to validate that the external executable is activating, and the queue status is correctly returning RECEIVES_OCCURRING:
    http://msdn.microsoft.com/en-us/library/ms187540.aspx
    Also have you tried increasing your retry configuration parameters to handle the larger mail queue that you are sending through?
    Jonathan Kehayias | Senior Consultant,
    SQLSkills.com
    SQL Server MVP | Microsoft Certified Master: SQL Server 2008
    Feel free to contact me through
    My Blog or
    Twitter. Become a
    SQLskills Insider!
    Please click the Mark as Answer button if a post solves your problem!

  • How  to look at mail queue

    I have installed Collaboration Suite 9.0.3, and am curious to know how to look at the mail queue on the OCS server, and more specifically, how do I delete emails in the queue? Somebody apparently found us during the installation of this server before I could lock it down with spam rules, and I have a ton of junk emails stuck in the queue that won't go anywhere. How do I get rid of those messages? They are literally using up the server resources after about 5 hours of the server trying to send them.
    Thanks,
    Michael

    Well, I guess that's part of the problem too. I'm not sure I have emails in the queue. I have the OCS server set up with the relay host set to another server on the network running sendmail. If I stop the smtp_out service on the OCS server, and then start it again, I see a bunch of messages being sent to the relay server to be delivered, most of them spam as far as I can tell. The sendmail server is set to reject those messages, so it does not try to deliver them and therefore does not put them in the queue on that server. However, regardless of restarting smtp_out, restarting Unified Messaging, restarting OCS, or restarting the entire server, those messages continue to remain in what I'm assuming is the queue on the OCS server. Does that make any sense? From what I can get from the documentation, they must be sitting in the mailstore database somewhere, and I'm wondering if there is a query I can run to at least look and see what is there, and preferable delete them. Otherwise, I guess I have to wait 5 days for the server to finally give up.
    Any ideas?
    Thanks,
    Michael

  • What to do with mail stuck in mail queue?

    I think i have my web and e-mail server running fine, all mail from the users is coming and going as should. But I have to delete the mail queue every two days or so because it is filling up with junk mail to unknown senders and users. I think everting is setup correct and I do not have an open relay, but is there some way I can have it delete the junk mail in this queue by itself?

    Most likely you have postfix configured to accept any mail. Being for known or unknown users. Thus, mail for unknown users (mostly spam) gets only bounced at a later stage (cyrus/IMAP), which in turn creates those pesky Mailer-Daemon messages in your queue.
    Being spam, there is usually no proper return address, so those messages stay in your queue, until they expire after 5 days (default value).
    See my tutorial on how to improve Postfix' configuration here: http://osx.topicdesk.com/content/view/38/62/

  • Database Mail not working with SQL Server Agent

    I'm running SQL Server 2005 Standard edition 64 bit with SP2 on a 64 bit machine. 
    Database mail does not work with SQL Server Agent.  When I configure SQL Server Agent to use database mail the test email button is greyed out and inactive therefore I cannot send emails using operators or for jub success failure etc. 
    I've read that there was supposed to be a fix for this with SP1 but I have SP2 and still receive the same problem.  Please can somebody help as I do not wish to use SQL Mail as a work around due to this becomming redundant in future versions of SQL Server.
    Kind Regards

    The problems solved
    steps:
    1)we create a mail profile at at Managment->Database Mail ,of SQL Managment
    2)we set this account as "default" at Managment->Database Mail -> Configure Database Mail -> Manage profile security
    3)At tab "Alert System" of SQL Server Agent properties , we check the "Enable mail profile" , Mail System=Database Mail, Mail profile = "the profile we already create"
    4)we create a new operator at "Operators" of sql agent, where at "notification options" -> "Email name" we put the mail where we want to sent the agent the mails at failured job
    5)We go at a specific job, at tab "Notifications" ,we check the "email" check box and then we choose the operator we just create, at the text box next to check box.
    I hope not to forget something
    Thank You all for the help

  • SQL Agent Job Notification - Database Mail problem

    Hi
    I'm a little stumped. Have setup database mail on SQL Server 2008 (SP1 x64) and its working fine except when its supposed to send out a SQL Agent job notification.
    I've enabled database mail on SQL Agent and have specified a profile, but when it tries to send an email on agent job completion it errors with "NOTE: Failed to notify '<operator>' via email."
    Can anybody help?
    Thanks

     Hi Webdawg, 
      As suggested above, try these steps.
     1. Try  test email first, this can be by done (right click on database mail under mangement folder). prior to that you should already have a profile configured to send the emails and make sure you got the right SMTP server and  do not block
    port 25.
    2.If test is succeeds, enable mail option under sql server agent properties and select 'database mail' and corresponding profile.Add the reciepents email to the operators under sql server agent(check the enabled option here). Restart the SQL sever
    here.
    3. Create your sql job and in the notifcations section you should see email option and should have the operator email you configured above.
    Try it out. let us know. Hope it helps.
    If the test succeeds and still you did not get the email from sql job, check the database mail log and check whether it is being queued. let us know. 
    Please mark as 'Answer', if the solution solves your problem.

  • Email stuck in MAIL QUEUE

    Hi, I just upgraded one of our Xserve from 10.4.11 to 10.5.6 Now I can't send or receive mail, but I can see all incoming and out going email in Mail Queue.
    Here is the log.
    ********************************************************* 451-4.5.0 LibClamAV Warning: * This version of the ClamAV engine is outdated. ...* 451-4.5.0 LibClamAV Warning: * DON'T PANIC! Read http://www.clamav.net/support/faq * 451-4.5.0 LibClamAV Warning: ********************************************************* 451-4.5.0 LibClamAV Error: cli_loadmd5: Problem parsing database at line 34333 451-4.5.0 LibClamAV Error: Can't load daily.mdb: Malformed database 451-4.5.0 LibClamAV Error: cli_tgzload: Can't load daily.mdb 451-4.5.0 LibClamAV Error: Can't load /private/var/clamav/daily.cld: Malformed database 451 4.5.0 ERROR: Malformed database" at (eval 42) line 511. (in reply to end of DATA command))
    Jan 20 22:37:59 macserver postfix/scache[371]: statistics: start interval Jan 20 22:34:17
    Jan 20 22:37:59 macserver postfix/scache[371]: statistics: domain lookup hits=5 miss=2 success=71%
    Jan 20 22:37:59 macserver postfix/scache[371]: statistics: address lookup hits=0 miss=2 success=0%
    Jan 20 22:37:59 macserver postfix/scache[371]: statistics: max simultaneous domains=1 addresses=1 connection=1
    I have try running this.
    sudo /bin/launchctl load -w /System/Library/LaunchDaemons/org.clamav.freshclam.plist
    and also try to download and update daily.cvd and main.cvd
    Ans restart the Server, but still the same problem.
    Any help or suggestion would be much appreciated.
    Jet

    Hi Pterobyte,
    Sorry been away the last few day.
    No I haven't make any change to clamAV.
    I just checked the server log again, no more error and I can send and receive email.
    Very strange.
    Jet

  • IIS 6.0 - so many mails stuck in mail queue

    Hi All,
    From past 2 days, so many mails are getting stuck in mail queue folder. Normally, when there are more than 20 mails in queue, we used to restart SMTP and the queue gets cleared immediately. But , now the situation has changed. When we restart SMTP to clear
    mails in queue, they keep on increasing, say from 20 to 100 and then after 1 hour or so, the number goes to 20-25 and again increasing. We have not changed anything, but dnt know why this is happening suddenly from past 2 days. Users also are complaining that
    they are getting notification mails very late. The mails are not getting send and just staying in queue for a long time. I checked in SMTP log and found " OutboundConnectionResponse SMTPSVC1 E-SALES - 25 - - 421-4.7.0+[203.170.190.51++++++15]+Our+system+has+detected"+an+unusual+rate+of
    0 0 77 0 17891 SMTP - - - -" 
    Kindly help and Please let me know if you need more information.
    Thank you,
    Phani.

    Hi Darin,
    Thank you for your reply. We dont have Azure.
    Actually, we have an e-payment website and when users made transactions, the notification mails go to users. We are using IIS web server v6.0 for this whole set up and SMTP is also configured in this. Basically, I am programmer and this is not my work domain.
    I am taking care of this server for time being and don't have much information/idea. Today, I observed the mails in queue are processing normally, but we did not change anything. What could be the reason for long mail queue for previous 2 days? can you throw
    some light on this? :)
    Thank you.
    hi,
    It seems like this issue may be not related to azure . I suggest you could post this issue into IIS forum or Window server General forum
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winservergen for more helps.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Mail stuck in the Mail Queue

    For reasons I have not yet understood, my 10.5.2 mailserver stopped delivering mail. After a few restarts it is now running again but;
    All the mail that arrived while it was stopped is now stuck in the Mail Queue. How can I get it to deliver thisstuck mail?

    pterobyte wrote:
    If they can't get to the content filter on the first try, maybe it's overloaded? How busy is your machine?
    It's a new installation of Leopard Server on an internal drive, the CPU navigate from 0 to 20% so it's not here. I used spamtrainer to import the database from the old drive (Tiger Server) and the mail store is on a RAID disk so I just had to change the default mail location in the right pane. I just restarted the server on the Tiger Server disk and everything is fine there.
    Requeuing does not start the content filter, so if it were off, it'd still be off. So since it is running, it look like it can't keep up.
    Sorry, I do my best to be understandable :->
    I just made tries to see if mails would be delivered once the spam and virus filter is off and saw that mails were not delivered at all.
    Is this the normal behavior ?
    This problem of the content filter is probably linked to what I said in another thread.
    I cannot uncheck "Attach subject tag" in Server Admin. If I uncheck the spam filter and virus filter then mails are not delivered too.
    I doubt it is linked (unless you "play" with Server Admin while troubleshooting the queue). As I mentioned above, amavisd, doesn't run just "a bit".
    You can always change the amavisd and postfix settings yourself.
    If I knew what to change and where I probably would do it :->
    I'm just scared about how many things don't work as expected once Leopard Server is installed.
    Lot of problems with SMB too and as we have only one machine here I must reboot the server on Tiger if I don't want everybody here to kill me :->>
    Maybe some files cannot be read/write...
    If it was a permission issue, requeued mail would still hit the same issues.
    Yes... I thought about that.
    Do you think that it could help to download the 10.5.2 combo update and to reinstall it ?
    Doubt it, but it probably won't hurt.
    Will try it as soon as I can reboot the server on Leopard. I seems that someone will not leave the office like others will do today
    Thanks for your help.

  • Mail wont stay online HELP!

    I cannot get my mail to stay connected. It either keeps going offline or keeps asking me for my password. When it wont connect it says to verify password and username (which are correct every time). When it has server issues it just says pop3 and port 995 failed. I thought my icloud mail and live mail may have been conflicting so I unchecked the use this server only box for each one and have not had the server error since. But now the password constantly being asked is the main issue. How do I fix this? I've tried several things already.

    I believe they both were not connecting but now it just keeps asking for my live email password every few minutes. I can send mail during the the few seconds I type the password and hope it goes before it asks again. I have not received any emails though for the past 2 days.

  • What mail queuing notifications are available with Exchange Online Protection (EOP)?

    Basically, if EOP detects a service failure for the on-premises Exhange Servers and mail queuing is enabled, what notifications are available from EOP when mail queuing is enabled? I am unable to find a screenshot or documentation regarding this.
    Does EOP have the ability to email and or SMS notifications to an outside email address indicating the mail queuing has been enabled for the domain?

    Unfortunately, EOP doesn't have an ability to notify you with the SMS or email if the email is queued. We need to perform a message trace on the EOP to review the list of emails which is in pending status.
    http://technet.microsoft.com/en-us/library/dn167670(v=exchg.150).aspx
    Rinesh Chandran,
    Technical Consultant, Wipro Ltd.                

  • Is there a way to control the number of concurrent SMTP connections on Database Mail?

    Las week Rackspace started controlling the number of concurrent SMTP connections and we are now getting the following message when we send as little as 15 messages at a time using Database Mail:
    Exception Message: Cannot send mails to mail server. (Service not available, closing transmission channel. The server response was: 4.7.0 smtp13.relay.dfw1a.emailsrvr.com Error: too many connections from IP xxx.xxx.xxx.xxx)
    We are using SQL Server 2005 and Windows 2003 and we have been doing this since 2006 with no problems
    Is there a way to control the number of concurrent SMTP connections used by Database Mail or the Database Mail external executable DatabaseMail90.exe?

    Hi rkohler,
    Usually, we can use the Database Mail Configuration Wizard or the Database Mail stored procedures to determine the server name and port number for the Simple Mail Transfer Protocol (SMTP) server . In the SMTP server points, we can set or increase the number
    of concurrent connections.
    There is similar issue about database email on SQL Server 2005, you can refer to the following post.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6bb7b600-f025-451b-898b-2caa29c10d4d/only-some-email-gets-sent-successfully-from-spsenddbmail-database-mail-on-sql-server-2005
    Thanks,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Trying to implement a mail queue

    I'm trying to implement a very basic mail queue using ExecutorService and a Callable split into a producer which builds the email and an email queue and a consumer to send the queued message out but I keep getting:
    java.lang.NullPointerException
         at javax.mail.Transport.send(Transport.java:97)
         at org.bedework.mail.sendMail.call(sendMail.java:45)
         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I'm not sure how to get the transport variable passed across and read by the consumer thread.
    The consumer code is:
    public class sendMail implements Callable<Object> {
         private ArrayBlockingQueue<Object>  queuedMail;
         private Transport trans;
         private MimeMessage msg;
         private Logger log = Logger.getLogger(sendMail.class);
         public sendMail (ArrayBlockingQueue<Object> queuedMail, Transport trans) {
              this.trans = trans;
              this.queuedMail = queuedMail;
         public Object call() throws Exception {
              try {
                   queuedMail.poll();
                   synchronized (queuedMail) {
                      if (queuedMail.isEmpty()) {
                         queuedMail.wait(1000);
                   try {
                        trans.send(msg);
                        Thread.sleep(1000);
                   } catch (Exception e) {
                        e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
              return null;
    }The code that calls it is:
    tr = sess.getTransport(config.getProtocol());
            pool.submit(new buildMail(sess, cal, originator, to, subject));
            pool.submit(new sendMail (mailqueue, tr));I'd be grateful for any pointers in getting this sorted out.

    First, read this FAQ item:
    [http://java.sun.com/products/javamail/FAQ.html#send|http://java.sun.com/products/javamail/FAQ.html#send]
    Then explain to me how "msg" is ever set in your sendMail class.

Maybe you are looking for

  • HT4527 how do I move my itunes on an external drive to a new laptop?

    HELP!! My Itunes has been on an external (seagate) but the laptop that I've been using to access this is on it's last legs. I purchased a new Windows 7 laptop with a faster processer & lots of memory & storage. The itunes has been backed up on the dr

  • Adobe Flash Player Will Not Work with Safari Mac OS 10.9.2

    I have tried numerous times to install Adobe Flash Player for Mac OS 10.9 and get Plug-in error when I try to run it.  Before the suggested update, Flash Player ran fine.  I would not have tried the update except the files on the web site that I am u

  • Can't download 7.2

    When I attempt to download 7.2, I am taken immediately to the "Thanks for downloading" page even though no download has occurred. I'm using WinXP Media Edition w/ Service Pack 2, Firefox 2.x (I added itunes.com to trusted site list, allowed cookies,

  • PRINTER DRIVER FOR EPSON R300

    Does anyone know wherre I can download a driver for an Epson R300 to work with an iBook with OS 10.4 please?

  • Snail, email address or phone number to complain about online chat?

    I have now been in online chat for nearly 1 hour regarding a printer issue. So far the person has not suggested one single thing - he just keeps saying "I will solve your problem" and then please wait while I consult with someone else. I find this to