Jump to content

EidolonHost

Members
  • Posts

    281
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by EidolonHost

  1. If you run this in a cronjob, no need to log each message since you log the whole script (email or pipe redirection). I would also make the suggestion you use https as opposed to http for the transfer (geolite supports this).

    You could get a small performance boost if you used named pipes and curl. Something like this would work:

     

    curl -L https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | gunzip > GeoLiteCity.dat
    
    That is pretty agressive. The Maxmind website says the database is updated on the first Tuesday of the month. Taking into account the various number of timezones and not knowing when on Tuesday the database is updated, lets run this on Wednesdays instead.

     

    0 9 * * 3 [ `date +\%d` -le 7 ] && curl -L https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | gunzip > /srv/uploads/system/GeoLiteCity.dat
    
     

    Runs on the first Wednesday of every month at 9AM server time.

     

    It is more then just countries, cities are accounted for. With IPv4 shortage, v4 addresses are being reallocated, reassigned more fequrently then ever before.

    Note to Blesta Devs: Should switch to the new GeoLite2 database format. The current one is legacy and will be deprecated at some point. The new GeoLite2 also includes md5 sums which can be added to the script above.

    http://dev.maxmind.com/geoip/geoip2/geolite2/

    -Adam

     

     

    Ah, thanks! I'll update the script then, with your suggestions. I'll also update to GeoLite2 when Blesta shifts to supporting GeoLite2. I suppose I could have the script download GeoLite 2 in preparation for Blesta switching to using GeoLite 2. In fact... I'll do that. Check the OP, the script will be updated shortly.

     

    Edit: This bit here: 0 9 * * 3 [ `date +\%d` -le 7 ], is that to be in the cronjob or the script itself?

     

    Edit2: Suggestions on MD5 verifying signature? Should it e-mail you on mismatch of the signature? Also, does the script look good now?

  2. but why does it need to be updated? the countries don't change nor do the IPs?

     

    Because MaxMind said themselves that they do update their GeoIP database content every so often. Says so when you go to download it, at any rate from their site.

     

    Besides, better to know you have a fresh copy. I think they update their stuff weekly or once a month? I'm not sure but WHT has threads about this.

  3. What's it supposed to do?

    It's supposed to update your GeoIP database. Put it in a shell script, set it executable with chmod +x geoip.sh or something, however you want to have the file named. Edit paths according to your billing system install.

    Add to cronjob and decide how often you want it to run. You're set, then.

  4. So. Here's a script for updating your GeoIP database.

    #!/bin/bash
    
    # cd to directory where the MaxMind database is to be downloaded.
    if ! cd /home/example/public_html/billing/system/; then
    echo "Can't find work directory" >&2
    exit 1
    fi
    
    # Remove existing files so we start off with a clean set of updated data from Maxmind.
    
    rm -f GeoLite*
    rm -f md5sum.txt
    
    # Download databases and if applicable, their md5s.
    
    curl -L https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz |gunzip |tee GeoLite2-City.mmdb|md5sum |awk '{print $1}' > GeoLite2-City.mmdb.md5-loc$
    curl -L http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5 > GeoLite2-City.mmdb.md5-remote.md5
    
    # Localized copies of our working data.
    local=`cat GeoLite2-City.mmdb.md5-local.md5`
    remote=`cat GeoLite2-City.mmdb.md5-remote.md5`
    
    echo L=$local R=$remote
    
    # DO THE THING! ie, compare the files!
    if [ "$local" != "$remote" ]; then
    mail -s "Results of GeoLite Updates" example@domain.com <<< "md5sum for GeoLite2-City failed. Please check the md5sum. File may possibly be corrupted."
    else
    fi
    
     

     

    Works for me so far.

     

    My cronjob looks like this:

    * 20 * * 6 /home/example/geoip.sh

    Runs every Saturday at 8PM.

     

    Haven't figured out how to automatically overwrite... oh wait.

  5. You shouldn't have to create the directory manually. The directory was attempted to have been created automatically once before, but may not have been writable at that time, which accounts for why it didn't exist. The task Paul added would simply attempt to create the directory before writing attachments to it if the directory does not already exist. In either case, if the directory is not writable, an error would still be encountered and the attachments would not be added.

     

    Ah.

     

    Well... sometimes things just happen, when it comes to creating new directories and stuff. Obviously, issues like this shouldn't happen but if it requires me to create the directories to help make it work... that's fine by me. Hopefully when this is updated, you'll be able to add an error message saying it wasn't able to create the directories for whatever reason. I'd dearly love to have more helpful error messages like this so I can correct the issue and let it try again in creating the directories itself.

  6. Good to hear you got it to retrieve email.

     

    As for the From address in sent mail, do you have the "Email" field for the support department set to "support@...", and the "Override the from address set..." field checked? That's all you need. And of course, the ticket must be assigned to this department. All of these conditions met, email sent (e.g. the Ticket Updated email) should come with the From email address as set on the department.

     

    Yes, and yes.

     

    See: http://imgur.com/SW6DpBQ

    Question: Would the fact that I sent an e-mail to support@.. from my e-mail and the assigned staff e-mail being the same e-mail I just sent from be an issue? I'm just spitballing here because it should work as you describe...

     

    Edit: System notified me of ticket update from system@.. rather than support@.. so, here's the content of the e-mail:

     

    Hello,

     

    Test 3

    On Sat, Jul 25, 2015 at 9:41 AM, Support <systems@..> wrote:

    To reply to this ticket, be sure to email support@.. from the address we sent this notice to. You may also update the ticket in our support area at domain.com/herp.

    Technical Resources:

    EidolonHost Knowledgebase

    Service Status

    Regards,

    EidolonHost Technical Support

    https://eidolonhost.com

  7. ... Oooh, so that's why that wasn't working... I'd been wondering why the attachments directory wasn't working, because I'd tried to give it different locations and it just wouldn't take. Now it makes sense because I was unaware I'd need to manually create the 1/support_manager_files directory.

     

    I've rectified the issue on my server.

  8. A few basic things to confirm:

     

    Does the email still exist in your inbox after the cron runs to import ticket emails?

     

    Is the support department configured to..

    1. look at the right inbox?
    2. allow non-clients to mail in tickets?
    3. fetch tickets securely? Is the appropriate port selected? Reference here.

    Is the cron task, "Download Tickets", enabled and running properly at its set interval?

     

    Does the person that sent the email receive a bounce email? (e.g. ticket could not be added)

     

    Is the IMAP extension available to PHP on the web server and in CLI mode?

     

    If all that seems to be working correctly, you might double-check your IMAP settings.

     

    E-mail still exists in the inbox. It's not marked as read.

     

    1. Yeah. It's set to look at Inbox for Google Apps... unless that's supposed to be INBOX.

     

    2. Yeah, I noticed this earlier in the thread and set it to allow non-clients and clients to e-mail the support dept.

     

    3. Should be fetching e-mail securely. Google's IMAP settings says port 993.

     

    4. IMAP/POP3 is enabled for the e-mail account in question.

     

    5. Cron task download ticket is enabled, set to run every 5 minutes.

     

    6. No, I don't get any bounce e-mails.

     

    Here's a screenshot of my support department settings:

     

    http://imgur.com/Wi87ycD

     

    Couldn't use img tags to display the image in-line. Ah well.

     

    Edit:

    Download Tickets

    Connects to the POP3/IMAP server to download emails and convert them into tickets.

    Task Last Ran: Jul 25, 2015 8:05:02 AM

     

    Edit2: Looks like I finally got tickets working properly. For some reason I had to reset the password to get it to work again... odd.

     

    Either way, it is now working properly and now I am able to see the ticket in the billing system.

     

    Now to make sure the system sends out e-mail ticket replies...

     

    Edit3: Looks like e-mails are being sent correctly... but it's showing up as systems[at]eidolonhost.com and not as support[at]eidolonhost.com ... why is the address not being re-written to show as coming from support[at]eidolonhost.com when sending via SMTP? Note: the rewrite option has been checked for support.

  9. I realized when I was checking through settings that the departments themselves have the ability to use imap.

     

    So I naturally set that up, but it seems the tickets are not being picked up. What else do I need to do to test this?

     

    Btw, I really hate dealing with e-mail issues. -_-

     

    Edit: Cron is firing as normal. E-mails work just fine. The billing system correctly sends out SMTP e-mails... I just can't tell if the system's unable to pick up IMAP e-mails and whatnot...

  10. Well you can use multiple SMTP emails, but maybe not in google apps. I always recommend never to use Google Apps.

     

    You can if you go to the Google Apps Admin dashboard, go to the users section to manage your users and add the e-mail accounts.

     

    When you create the e-mail account and check its profile, you'll notice an alias field where you can add multiple e-mails to that account. I have not tested this yet, but I will in a few minutes.

     

    Edit: Well, using the aliases works... I see that e-mailing support[at]eidolonhost.com results in it popping up in systems[at]eidolonhost.com's e-mail account. waiting to see if the billing system sees it and pulls it into the support section.

     

    Edit2: Looks like it's not pulling the e-mail in. SMTP settings look correct to me.

     

    Edit3: Whoops, set it to only clients can open tickets and reply. Fixed... now to see if it'll detect the new ticket.

     

    Edit4: Cron is running but it seems to not be picking up the new ticket.

  11. So,

     

    Since it's pretty obvious that we can't do multi-department emails with SMTP, I was screwing around in the Google Apps Admin dashboard, right? Well, while I was checking things out e-mail related, I noticed that the e-mail accounts also had the ability to do aliases.

     

    Which means if I wanted to use a system-wide SMTP e-mail address, say in the form of systems[at]eidolonhost.com, I could attach aliases to that e-mail, such as support[at]eidolonhost.com, security and so on and so forth.

     

    Now... my real question here is, does Blesta support importing e-mails from SMTP accounts with aliases and correctly recognize which department it's for and display the tickets accordingly in the respective departments?

  12. Dedicated server in US

    http://www.lucn.us

     

    That's not really appropriate in here, bro. I'll let it slide but others may not.

     

    Just so you know, this module is meant for managing assignments of dedicated servers. It does not do anything in terms of actual management... as in OS reloads, IP management, all that sorta thing.

  13. Dont forget to link all the html menu to your billing system menu :)

     

    I believe the menus are indeed linked... but I'm going to have to figure out why the drop-downs aren't working on the menu up top in the billing system... plus a few other remaining design issues, mostly related to the order form.

     

    Right now though I don't have the ability to work on the issues so I'll probably hand the job off to LicenseCart, or some other theme company that knows Blesta well to finish up for me.

  14. Sorry for the double posting but: I'm considering whether or not to implement a web-ssh client. Obviously, if I can't figure out how to implement a webssh client, I'll probably set up a tab so it allows you to connect to your own shellinabox instance if you ever want to do out-of-band SSH management. Or... something. :P

×
×
  • Create New...