Submissions per connection/session

Discussion in 'General discussions' started by VVT, Jun 15, 2016.

  1. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    @frm.mwz / @VVT - The limit in mailwizz is 1 by default, so it's exactly what happens now, one message per connection. You can now adjust this for any smtp server from backend, and change from 1 to whatever your server supports.
    Swiftmailer doesn't have a keep alive feature unfortunately, so i am not sure how we will go about it. We don't destroy the connection for swiftmailer either, so if swiftmailer doesn't close it after sending we should be good, but i think it does.
    If @VVT can run a few tests with swift as well, this would help.
     
  2. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    #1
    how do these two work together:
    and
    ?


    #2.1
    have you seen my post re the swiftmailer plugins
    which allow to
    !keep alive a connection! until a specified # of msgs is submitted?
    from
    https://forum.mailwizz.com/posts/13253
    -----
    swiftmailer has plugins to
    (limit the number of emails per connection,
    which incidentally do
    until that number of emails has been transferred)
    keep alive the connection...
    and they are mentioned in the documentation here
    \apps\common\vendors\SwiftMailer-5x\doc\plugins.rst
    though am not sure if they are used already
    what do u think @twisted1919
    -----
    are they in use
    ?

    #2.2
    specifically the 'AntiFlood Plugin'
    as this seems to be usable for exactly the purpose here
    !keeping the connection open! until a set # of msgs is transferred
    ?

    #2.3
    or is there a reason why it cannot be used
    ?


    #3
    that's great!


    thx
    :)
     
  3. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    That changed, from now on we start with one email/connection which can be modified from the smtp server settings.

    We use all of those, but none of them is meant to keep alive the connection as far as i can see.

    Not quite, the anti-flood plugin keeps an internal counter of messages sent per defined period of time. When sending the message the connection is opened , message send, connection closed.

    What exactly?
     
  4. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    The AntiPloodPlugin will
    !keep alive! any single connection until the specified # of msgs is sent.
    I thought that was what was wanted:
    maximize # msgs / min # connections.

    "per defined period of time" is not a variable of the AntiFloodPlugin
    The AntiFloodPlugin
    knows only two parameters:
    the number of emails to pause after, and optionally
    the number of seconds to pause for.

    From this you can see, that
    SwiftMailer was actually made with !keep alive connections! in mind,
    it is only that mwz was looping in a way
    that it was disconnecting after each msg.

    See here, from the plugin description:
    "
    When Swift Mailer sends messages it will count the number of messages that
    have been sent since the last re-connect. Once the number hits your specified
    threshold it will disconnect and re-connect, optionally pausing for a
    specified amount of time.
    "

    Also, having had it at default 100, perhaps it was the reason (in some
    cases) that pcntl balloned out of control?

    In any case,
    and is there a way (except) asking/reading, to test the max # msgs/connection right there in the settings with a button (and a test script behind it)?
     
  5. VVT

    VVT Active Member

    Joined:
    May 22, 2015
    Messages:
    499
    Likes Received:
    138
    S.E:
    Expired
    L.T:
    Extended
    L.C:
    2
    Just wanted to tell that it wasn't the 100 conn thing stopping me from gaining more speed. Also, guess we're messing the concepts here - recipients per message and messages per connections are different things, like gmail (unless relaying) and MTA. Obviously postfix is not my OWN solution and it supports until 1k (haven't tested after that limit) msgs/conn by default. And this limit may differ from one another. So, if stability is the idea, best is to keep 1 msg/conn as default as it does now. ;)

    @twisted1919 I'll test Swiftmailer. But I was using that in the past and haven't seen any performance boost. So don't think it keeps the conn alive (may be in our case). Good news is that PHPMailer is now an ongoing project and can see frequent commits in Github. In the case of SwiftMailer, AntiFlood plugin gives a hint that SwiftMailer will keep the conn alive by default and the so called plugin can control that behaviour. May be the server change thing is affecting Swift as well as it did for PHPMailer ?
     
  6. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    @frm.mwz - if that plugin keeps the connection alive, then we should be fine, as i said, we're using it. Anyway, it seems very dumb to work like advertised. I mean, you open a connection, send x messages then keep the connection open just to wait...? Anyway.
    @VVT - see above.
     
  7. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    if a mail server accepts only 100 recipients per message, then that is
    because it has to create then 100 messages to be sent out


    own solution does not mean you programmed it, it means someone is in
    control of the settings for that postfix instance
    (e.g. you at your own server w postfix)

    exactly what i said

    yes, of course, but the idea of the thread was...to max msgs/min conn.

    It does exactly what you see in my post above, as that is from the
    description of the plugin. Only two variables: # msgs/conn; pause time.

    that is exactly what @twisted1919 wrote some post above

    The idea of being connected for # msgs, then disconnect, and then reconnect,
    is most likely to be found in "readiness" to send further more...i.e. SPEED :)
    ...not so dumb after all?!?
     
    Last edited: Jun 22, 2016
  8. VVT

    VVT Active Member

    Joined:
    May 22, 2015
    Messages:
    499
    Likes Received:
    138
    S.E:
    Expired
    L.T:
    Extended
    L.C:
    2
    @frm.mwz Ok Sir ;). Not replying point to point to spam this thread ;), but mentioning 100 "To" emails on a message and submitting 100 emails with 1 "To" email on a single connection are different things - the first one is the problematic setting most SMTPs putting low limit on.
     
  9. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    whenever you have good points to add, that would not be viewed as spam by anyone reasonable :cool:

    not sure where a misunderstanding is...
    ...if a server accepts only 100 smtp emails per connection, then it does not matter if it is 100 unique messages during the whole connection or 1 message with 100 recipients...as it has to send out 100 messages thereafter :rolleyes:

    the server settings in general were not my point, as they are individual per ISP/ESP (yes, they are not all RFC compliant) ;)
     
  10. VVT

    VVT Active Member

    Joined:
    May 22, 2015
    Messages:
    499
    Likes Received:
    138
    S.E:
    Expired
    L.T:
    Extended
    L.C:
    2
    #1 I switched to Swift and could see individual connections per delivery.
    #2 Guess (as the doc reads) it's not the plugin that keeps the conn alive, but the plugin breaks the conn after x msgs to prevent 'flooding'. :)
    http://swiftmailer.org/docs/plugins.html#antiflood-plugin
    #3 My Settings > Common page on the admin dashboard has been broken since I replaced the 'mailer' folder. Please suggest a fix.
    upload_2016-6-22_20-41-51.png

    @frm.mwz Yeah, I thought we made our points clear :)
     
    Last edited: Jun 23, 2016
  11. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    same thing here: settings->common = broken (same screen shot as above)
    all other screens ok


    The thread is about 'submissions per connection/session'
    and the plugin helps to max that.
    Hence, one needs to look at the plugin functions' implications
    that's why you find here https://forum.mailwizz.com/posts/13253
    (keep in mind a mailer is there to make connections and transfer msgs
    ie to keep alive connections til that number of msgs is transferred,
    it can be one, but that plugin allows to specify how many, and
    for that time til done, the connection stays alive)


    in the mentioned documentation file
    apps\common\vendors\SwiftMailer-5x\doc\plugins.rst
    it says that swiftmailer (also by way of that plugin which is in the mwz code) takes care of closing connections
    "...disconnect after that number of emails has been sent. You could manage this manually within a loop, but the AntiFlood plugin provides the necessary wrapper code so that you don't need to worry about this logic."


    perhaps mwz <=1365 still loops (open/close connection) for each msg, but the new version might fix it


    after applying the mailer patch above, could not find that setting in smtp delivery server settings (existing or new smtp delivery servers)


    To clarify perhaps by way of example, last time checked, gmail said it will accept 100 messages per day max from an smtp client, whether that is 100 recipients in one or 100 individually submitted messages (or any other spread of 100 recipients). That is as stated above, because it needs to then send out 100 individual messages, no matter how submitted.
    You'll find similar logic (though different limits) e.g. at smtp.com, etc.
     
    Last edited: Jun 23, 2016
  12. VVT

    VVT Active Member

    Joined:
    May 22, 2015
    Messages:
    499
    Likes Received:
    138
    S.E:
    Expired
    L.T:
    Extended
    L.C:
    2
    Hey @twisted1919 ,

    1. Hope you saw the issue re "common settings" page above.
    2. I noticed another malfunction, but that's not related to the "mailer" directory. While using PHPMailer, return path is always set as From Email, but not the email address we specify with the associated bounce server. It should work just like Swift mailer, means, if no verified sending domains, return path must be set as the bounce server email address.
     
  13. pradeep sharma

    pradeep sharma Active Member

    Joined:
    Nov 11, 2015
    Messages:
    224
    Likes Received:
    94
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    @VVT

    i resolved above problem.
    I had fix the problem uncommenting line 300 of file:
    apps/common/components/mailer/MailerPHPMailer.php

    please give it a try!
     
    VVT likes this.
  14. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    @VVT - i think the "common settings" issue is caused by the MailerDummyMailer mailer. Please unzip attached and put in the mailer folder to override existing MailerDummyMailer.php file.
    As for the FROM Email, nothing has changed in this regard, but i will have a look over.
     

    Attached Files:

  15. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    you mean this fixes the FROM problem in phpMailer?

    @twisted1919 can u check this?
     
  16. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    can you please quote the line and a few around it, as my line 300 is...empty :D
     
  17. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    the 'common settings' issue is visually gone...but considering the file is now also smaller, hopefully no functionality was cut out?

    the "email/connection" settings does not appear in delivery server settings, what must be done?
     
  18. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    This will appear in next release, it's too many files changed to simply put it here ;)
     
  19. frm.mwz

    frm.mwz Well-Known Member

    Joined:
    Mar 8, 2016
    Messages:
    3,708
    Likes Received:
    679
    S.E:
    2019-11-27 02:17:39
    L.T:
    Regular
    L.C:
    7
    Good to know, as from the above it seemed one should be able to find this setting.
    For the time being, is it better to use the original files of the 'mailer' folder, or better use all patches?
    Any ETA?
    ;)
     
  20. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    Yeah you can do that.
    Hopefully soon :)
     

Share This Page