Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

smtp outgoing mail not in sent items

Mail is working fine, receiving and sending, but there is no copy of sent items on the mail server. I am using smtp, so what am i doing wrong?

Is that normal and is there any if yes, is there any way to change that so a copy will be left on the server send mail folder?

Thanks

Comments

  • Admin panel -> Emails -> the email address you have configured -> scroll down to and configure: Fetched Emails
  • ntozier;43238 said:
    Admin panel -> Emails -> the email address you have configured -> scroll down to and configure: Fetched Emails
    Thanks for the fast reply

    Isn't 'fetched email' for the incoming emails?

    What about outgoing? How do I get them to be saved on the mail server?
  • Yes.
    When you fetch mail osTicket is usually configured to delete [default and recommended] the copy on the mail server after fetching.
  • ntozier;43243 said:
    Yes.
    When you fetch mail osTicket is usually configured to delete [default and recommended] the copy on the mail server after fetching.
    OK, but my question was about the OUTGOING mail, I don't have a problem with the fetched mail.

    How do I set an option to save the SENT mail on the server?

    Thanks
  • I'm not aware of any way to save an outgoing mail on the server by changing the osTicket configuration... That sounds like a server configuration to me. osTicket technically saves outgoing message by appending them to the ticket.

    You could setup an email list as your primary staff email on the mail server (and plug that into osTicket) and have it email several users one of which is your save user. Exchange has the ability to CC people who email individuals. I presume that postfix etc also has something similar.
  • ntozier;43298 said:
    I'm not aware of any way to save an outgoing mail on the server by changing the osTicket configuration... That sounds like a server configuration to me. osTicket technically saves outgoing message by appending them to the ticket.

    You could setup an email list as your primary staff email on the mail server (and plug that into osTicket) and have it email several users one of which is your save user. Exchange has the ability to CC people who email individuals. I presume that postfix etc also has something similar.
    Thanks for the suggestion, but there really should be a setting in osticket for this. For example, if I use thunderbird as my mail client, by default if will save sent items locally (on the PC) but there is an option to 'place a copy in' then specify a folder (similar to the fetch mail option to move emails to a specified folder). Its a fairly standard feature on any mail client, so I thought it would be included.

    Its not a deal breaker, but it would be handy to have an email copy of every sent message.

    Appreciate all the help!
  • You could always make the suggestion in the feedback / suggestions section of the forums. The devs actually read them ;)
  • ntozier;43308 said:
    You could always make the suggestion in the feedback / suggestions section of the forums. The devs actually read them ;)
    Thanks, will do :)
  • Apart from the template and signature, isn't the ticket thread itself a record of the messages? Or do you mean all the alerts and such too?
  • Grizly;43334 said:
    Apart from the template and signature, isn't the ticket thread itself a record of the messages? Or do you mean all the alerts and such too?
    Yes, the ticket itself contains everything, but limits us to view the email exchange through osticket itself, but we have a requirement to allow email conversations to be viewed through a normal email client (i.e. thunderbird, outlook, etc) without accessing the osticket backend.

    The way osticket works at the moment, email replies are only stored inside osticket, and there is no external copy of the email stored on the mail server.
  • I feel your pain..

    You would probably have to configure outbound SMTP to use a specific address for all email, or configure your server to intercept it.. most SMTP servers don't actually archive passing messages, as that isn't the standard. (If you think about it, your message passes through quite a few SMTP servers before reaching the endpoint, if each one saved each message, they would quickly fill up!).

    What server are you using? I'm sure you can add a filter or rule or something to send messages from your osTicket install into a specific folder, or, if you can't hack your email server, and frankly, that is probably the worst way, simply add a BCC header on each message:

    Inside /include/class.mailer.php
    find:
    $headers = array (
    'From' => $this->getFromAddress(),
    'To' => $to,
    'Subject' => $subject,
    'Date'=> date('D, d M Y H:i:s O'),
    'Message-ID' => $messageId,
    'X-Mailer' =>'osTicket Mailer'
    );


    Modify to:
    $headers = array (
    'From' => $this->getFromAddress(),
    'To' => $to,
    'Subject' => $subject,
    'Date'=> date('D, d M Y H:i:s O'),
    'Message-ID' => $messageId,
    'X-Mailer' =>'osTicket Mailer',
    'Bcc: youroutboundmailbox@yourdomain.com'
    );


    From: http://stackoverflow.com/questions/6325197/php-additional-bcc-email
  • Thanks Grizly for the suggestions, really appreciated :)

    I know for example when using a mail client (like thunderbird) by default outgoing emails are only stored locally (on the pc, in a thunderbird db), but there is an option in the settings which allows a copy to be saved on a specified folder on the mail server. This is handy when people share the same email, it easy to see incoming and outgoing messages. I was hoping for something like that.

    We are using mediatemple, they have dedicated mail server which we dont have any access too (other than send/receiving mail), so not going to be able to hack anything.

    I guess this BCC option might work for us, but one more question .... since we have 2 incoming mail accounts (one for sales, one for support), it is possible to have a different BCC for each account ? (depending on is being used to reply with)
  • shim;43347 said:
    possible to have a different BCC for each account ? (depending on is being used to reply with)
    Maybe like this?


    $headers = array (
    'From' => $this->getFromAddress(),
    'To' => $to,
    'Subject' => $subject,
    'Date'=> date('D, d M Y H:i:s O'),
    'Message-ID' => $messageId,
    'X-Mailer' =>'osTicket Mailer');

    /********** Custom BCC *******************/
    $bcc = array('sales@you.com' => 'salesBCC@you.com','support@you.com' => 'supportBCC@you.com');

    if($email=$this->getEmail()){ //can't use the getFromAddress function as that is a formatted string
    $f = $email->getEmail();
    // See if the senders address is in our array, if so, set the corresponding BCC address.
    if(isset($bcc[$f])) $headers['Bcc'] = $bcc[$f];
    }

    Where you set the sales/BCC & support/BCC addresses..

    That might work, haven't tested it.

    If you wanted a few more addresses, you could easily add a field to the Email class/table and Admin forms allowing you to specify in the Admin console the BCC address for each.

    The beauty of this method, is that you skip all the alerts and such.

    Not sure if you actually get the "entire thread" though, as this will only capture messages "sent" by the system, not messages sent "to" the system.. Although you say you already have received messages.. so this could be the ticket, as it were.
  • Thanks again for all the help. When I get a minute I will test the code and let you know how it goes.
  • Grizly;43346 said:
    I feel your pain..

    You would probably have to configure outbound SMTP to use a specific address for all email, or configure your server to intercept it.. most SMTP servers don't actually archive passing messages, as that isn't the standard. (If you think about it, your message passes through quite a few SMTP servers before reaching the endpoint, if each one saved each message, they would quickly fill up!).

    What server are you using? I'm sure you can add a filter or rule or something to send messages from your osTicket install into a specific folder, or, if you can't hack your email server, and frankly, that is probably the worst way, simply add a BCC header on each message:

    Inside /include/class.mailer.php
    find:
    $headers = array (
    'From' => $this->getFromAddress(),
    'To' => $to,
    'Subject' => $subject,
    'Date'=> date('D, d M Y H:i:s O'),
    'Message-ID' => $messageId,
    'X-Mailer' =>'osTicket Mailer'
    );


    Modify to:
    $headers = array (
    'From' => $this->getFromAddress(),
    'To' => $to,
    'Subject' => $subject,
    'Date'=> date('D, d M Y H:i:s O'),
    'Message-ID' => $messageId,
    'X-Mailer' =>'osTicket Mailer',
    'Bcc: youroutboundmailbox@yourdomain.com'
    );


    From: http://stackoverflow.com/questions/6325197/php-additional-bcc-email
    OK, I had a go on this mod, but its not working for me. Emails are still sending out, but the BCC is not working. Obviously I changed [email]youroutboundmailbox@yourdomain.com[/email] to the correct email address, but its not sending.

    What could be wrong?
  • Possibly the way I wrote that.
    Second version is based on the associative array form like the others.

    Ie:
     $headers['bcc'] = 'email@com.com'; 


    I'll give it a test tomorrow.
  • Grizly;43408 said:
    Possibly the way I wrote that.
    Second version is based on the associative array form like the others.

    Ie:
     $headers['bcc'] = 'email@com.com'; 


    I'll give it a test tomorrow.
    OK, I tried the array version and that is working :)
    Will do a little more testing today, but I think this workaround solves my problem.

    Thank you so much for all the help!
  • email receiving ans sending issue

    Hi All
    I have configure osticket successfully.
    Now when i am trying to request ticket from [email]user@domain1.com[/email] send successfully but not getting any mail alert in my configured mail id [email]user2@domain1.com[/email].
    And the same thing happen at the response time, here i am not getting any response mail in my requesting id i.e. [email]user1@domain.com[/email]

    Thanks in advance
  • OK, been doing some more testing on this, and the BCC is being sent out, but when you check the email header info (from the recipient email account), it is displaying the BCC info.

    So basically the BCC is not being totally hidden as it should.

    Any suggestions on how to make the BCC work correctly and totally hide it from the outgoing mail ?
  • My post above #14 was actually the multiple bcc version using the arrays.. Did you try that?

    As for the actually hidden bcc bit.. Not sure, can't say I've ever looked at one that I knew had a bcc.. you've got me interested now.
  • Grizly;43458 said:
    My post above #14 was actually the multiple bcc version using the arrays.. Did you try that?

    As for the actually hidden bcc bit.. Not sure, can't say I've ever looked at one that I knew had a bcc.. you've got me interested now.
    Yes, its the array method that I tried and it worked, but of course now there is the BCC being shown that is the problem. (see picture attached)

    Its very strange because I'm getting the BCC mail (the email account specified in the BCC receives the email), so thats working fine, but its also being shown to the main recipient, which kind of defeats the purpose of BCC :confused:
    bcc.jpg
    498 x 437 - 35K
  • Apparently the PEAR_Mail class doesn't support BCC: http://pear.php.net/bugs/bug.php?id=8047

    So it looks like the BCC has to be added before the other headers.. Might just be an ordering issue, pretty cool that it send the email anyway!
  • Grizly;43510 said:
    Apparently the PEAR_Mail class doesn't support BCC: http://pear.php.net/bugs/bug.php?id=8047

    So it looks like the BCC has to be added before the other headers.. Might just be an ordering issue, pretty cool that it send the email anyway!
    My coding skills go as far as html and css, any other suggestions on a workaround? Should I just try changing the order and see what happens ?

    Thanks!
  • Ok, if its just the order, I did a quick googly:

    http://stackoverflow.com/questions/3797239/insert-new-item-in-array-on-any-position-in-php

    $headers = array (
    'From' => $this->getFromAddress(),
    'To' => $to,
    'Subject' => $subject,
    'Date'=> date('D, d M Y H:i:s O'),
    'Message-ID' => $messageId,
    'X-Mailer' =>'osTicket Mailer');

    /********** Custom BCC *******************/
    $bcc = array('sales@you.com' => 'salesBCC@you.com','support@you.com' => 'supportBCC@you.com');

    if($email=$this->getEmail()){ //can't use the getFromAddress function as that is a formatted string
    $f = $email->getEmail();
    // See if the senders address is in our array, if so, set the corresponding BCC address.
    if(isset($bcc[$f])) array_splice( $headers, 2, 0, array('Bcc' => $bcc[$f] ); // splice in at position 2 (numbering starts at 0)
    }


    Or, if that doesn't work, you can simply:

    $headers = array ('From' => $this->getFromAddress(),'To' => $to);

    $bcc = array('sales@you.com' => 'salesBCC@you.com','support@you.com' => 'supportBCC@you.com');

    if($email=$this->getEmail()){ //can't use the getFromAddress function as that is a formatted string
    $f = $email->getEmail();
    // See if the senders address is in our array, if so, set the corresponding BCC address.
    if(isset($bcc[$f])) $headers['Bcc'] = $bcc[$f] );
    }
    // Carry on adding the other headers..
    $headers['Subject'] = $subject;
    $headers['Date']= date('D, d M Y H:i:s O');
    $headers['Message-ID'] = $messageId;
    $headers['X-Mailer'] = 'osTicket Mailer';
  • Option 2 worked for me :)

    thanks!
  • Alrighht! Happy to help mate.
  • So this MOD will put all outgoing emails to SENT folder?

    Thank you
  • No .. According to the above ... all the outgoing mails are just saving in INBOX of another EMAIL ID. 
    The other limitations we found are

    1) We can not insert multiple people in the TO section.
    2) We can not forward the mail through the ticket. (Suppose if the incoming mail needs to go to other person we can not forward it)
    3) No option to create a email from the OSticket itself, we can just send replies to the incoming emails.
  • 1) Use Collaborators.
    2) Huh?  
    3) Huh?  Every ticket updated can be configured to send an email.

    4) But wait you didn't have a 4!  Please do not highjack other peoples threads.  If you are having issue(s) please open your own thread so that it can be troubleshot for you.  This thread is from August 2013.  I would be shocked if you or dali were running version 1.7.

    Closing zombie thread with a head shot.
This discussion has been closed.