Skip to main content

hold_outgoing_email / release_outgoing_email

Comments

14 comments

  • swbrains
    The UAPI Email::hold_outgoing docs refers to a single email account but the WHM 1 API function hold_outgoing_email refers to a "cpanel account", which seems to imply the entire domain's mail would be held. Is UAPI Email::hold_outgoing not the same function as API 1 hold_outgoing_email? I'm wanting to hold/queue outgoing email for an entire domain/cpanel account via the API until I issue a corresponding release command. Is this possible? Thanks!
    0
  • swbrains
    Thanks. I was just confused by the UAPI functions of similar names since they appear to act differently. Normally, it seems that the UAPI functions are the new versions of the functions, so I was thinking that Email::hold_outgoing was intended to be the new UAPI version of the old hold_outgoing_email function. Since I need it hold for all mail sent out for an entire domain, I should stick with the WHM API 1 functions, correct?
    0
  • cPanelNick
    I should stick with the WHM API 1 functions, correct?

    UAPI should be used for the webmail/virtual users. WHMAPI1 should be used for the entire cPanel account.
    0
  • swbrains
    OK, thanks.
    0
  • swbrains
    I have tried both WHM API1 hold_outgoing_email and suspend_outgoing_email from my Perl script running under a cpanel account with the user ID "testaccount" (example.com is the reseller account which is different than "testaccount" in the URL below if that matters): $URI = "
    0
  • cPanelMichael
    But the emails sent after calling hold or suspend are still immediately delivered. I never call the release/unsuspend functions in this script as a test to see if it will actually hold/stop the outgoing messages. My Perl script uses MIME::Lite to construct and send the message via sendmail (I also tried having MIME::Lite send via SMTP with the same results). Any ideas why it would respond that the hold/suspend operation was successful, but still deliver the messages immediately?

    Hello @swbrains, 1. Can you confirm which cPanel & WHM version you are reproducing this behavior on? 2. Do you have a copy of the Perl script you are using so we can attempt to reproduce this on a test system? 3. Can you confirm that outgoing emails are suspended/held when attempting to send a message using traditional methods (e.g. via Webmail or an email client)? 4. Can you let us know the output to /var/log/exim_mainlog when reproducing the behavior in your custom script? 5. Are you sending an email to a remote server, or are you testing by sending an email to a local user hosted on the cPanel server? Thank you.
    0
  • swbrains
    Hi, 1. Can you confirm which cPanel & WHM version you are reproducing this behavior on? WHM = 76.0.17 In cPanel for this account, it says the same cPanel version -- not sure where else to look for this. 2. Do you have a copy of the Perl script you are using so we can attempt to reproduce this on a test system? Unfortunately, it's a proprietary script for my business and can't be shared. It would also take many dependencies to set it up in another environment. :( 3. Can you confirm that outgoing emails are suspended/held when attempting to send a message using traditional methods (e.g. via Webmail or an email client)? I have not tried this yet. Should it work for email sent via script/sendmail as opposed to webmail/email client? 4. Can you let us know the output to /var/log/exim_mainlog when reproducing the behavior in your custom script? Ok, I'll have to reproduce this and pull that info the next time I test it. 5. Are you sending an email to a remote server, or are you testing by sending an email to a local user hosted on the cPanel server? The emails were sent to addresses at different domains hosted on the same server.
    0
  • cPanelMichael
    The emails were sent to addresses at different domains hosted on the same server.

    Hello @swbrains, The suspend_outgoing_email and hold_outgoing_email WHM API 1 functions apply when a user sends an email to an email address hosted on a remote mail server. Email deliveries to local addresses will continue to work. Thank you.
    0
  • swbrains
    I was able to confirm (hold/suspend) is working for outgoing email to remote servers. Is there a way to disable the email notification back to the sending address that the message wasn't delivered: "Domain example.com has an outgoing mail hold. Message will be reattempted later" Basically, I would like to be able to queue messages during a long process without actually having the server attempt delivering them. At some point after the long process ends, I would like to be able to release the hold and allow delivery to begin again. I'm just trying to delay delivery for a couple of minutes in this case to allow an intensive process to end first before delivery starts. But I'd like all of this to occur without the user being notified of the delay for every outgoing message. Is such an outcome possible? Thanks!
    0
  • cPanelMichael
    Basically, I would like to be able to queue messages during a long process without actually having the server attempt delivering them. At some point after the long process ends, I would like to be able to release the hold and allow delivery to begin again. I'm just trying to delay delivery for a couple of minutes in this case to allow an intensive process to end first before delivery starts. But I'd like all of this to occur without the user being notified of the delay for every outgoing message. Is such an outcome possible?

    Hello @swbrains, You could open a Domain example.com has an outgoing mail hold. Message will be reattempted later" notification is enabled or disabled. However, you may want to consider adjusting the queue_only_load Exim configuration setting using WHM >> Exim Configuration Manager >> Advanced Editor if your intent is to hold the Exim queue at times of higher server loads. Here's a description of this setting: [QUOTE] If the system load average is higher than this value, incoming messages from all sources are queued, and no automatic deliveries are started. If this happens during local or remote SMTP input, all subsequent messages received on the same SMTP connection are queued by default, whatever happens to the load in the meantime, but this can be changed by setting queue_only_load_latch false. Deliveries will subsequently be performed by queue runner processes. This option has no effect on ancient operating systems on which Exim cannot determine the load average. See also deliver_queue_load_max and smtp_load_reserve.
    Thank you.
    0
  • swbrains
    Thanks. I have actually adjusted that setting in Exim to queue mail only until the load drops. I was just hoping to be able to have more granular control for a particular account when I know that account will be running an intensive script that will queue a lot of messages.
    0
  • cPanelMichael
    Thanks. I have actually adjusted that setting in Exim to queue mail only until the load drops. I was just hoping to be able to have more granular control for a particular account when I know that account will be running an intensive script that will queue a lot of messages.

    A feature request is the way to go if you'd like to see support for that level of granularity. Feel free to post the link to the request here once it's opened. Thank you.
    0
  • swbrains
    I have submitted a feature request for this functionality: Add parameter to API function hold_outgoing_email to control email notifications back to sender
    0

Please sign in to leave a comment.