EdHosting
Members-
Posts
17 -
Joined
-
Last visited
Everything posted by EdHosting
-
Need Simple Script/filter For All Incoming Email
EdHosting replied to EdHosting's topic in Scripting Talk
Aeroknight, I don't think so. Even if the spammer sends the email directly to the TCH server via it's "A" record, the Exim MTA will always insert a "Received: from" header at the top of the email that includes the domain name and/or the ip address of the sending MTA server. My only reason for including "tchmachines.com" in the filter I have applied is that I have a formmail script that runs on the server, and any emails that come from that script com in with a "Received: from serverxxx.tchmacines.com" header in them. However, what a sneaky spammer could do is look up the mx record for my domain (which points to the ip addresses of my antispam servers) do a reverse dns lookup on the first one and insert a "Received: from" header into the email and then send it to my server via it's "A" record. In that case, the Exim filter I have shown will allow the email in because the required text would indeed be somewhere in the "Received:" headers. Now if you look at the Exim filter spec I referenced previously, you'll note that it says that if there is more than one header line with the same name, their contents are concatenated. So if that concatenation works as I would expect it to, then the leftmost part of a "$header_received:" string in an Exim filter file should contain the address of the machine that the TCH server received the email from. That said, it would be great if you or someone could provide a regex expression that evaluated the text that follows the first dot in the "$header_received" string. I think that would cover everything. -
Need Simple Script/filter For All Incoming Email
EdHosting replied to EdHosting's topic in Scripting Talk
Well Bruce, it turns out you can have advanced filtering options, including "does not contain" matches and the like. But it took a lot of research and testing to figure this out. So I will pass it on to you and any others that need it. TCH is using Exim for their Mail Transfer Agent (MTA). Exim provides for a filter mechanism in a specially formatted filter file which is documented here. Anyone with a minimal understanding of programming can follow the documentation and create some rich filtering of their emails. However, the TCH servers use the standard cPanel application to their customers, which provides only a minimal subset of the Exim filter options. For example you can create a filter to discard an email if it contains something, but not if it does not contain something. The way this works is that when you create a filter in cPanel, it creates two files. The first file is in the root or your domain on the shared TCH server and it's named ".filter". You can look at this file and even modify it if you like, but it will do you no good. That's because cPanel creates a second file named "/etc/vfilters/****" and that file is actually a true Exim formatted filter file. But of course, that file is not directly accessible by TCH customers. So I opened up a support ticket requested that my vfilters file be changed to the following (between the dashed lines): ----------------------------------------------------------------------------- # Exim filter if not first_delivery and error_message then finish endif if $header_received: does not contain "myfiltercompany.net" and $header_received: does not contain "tchmachines.com" then save "/dev/null" 660 endif ------------------------------------------------------------------------------ Basically, this filter directs the Exim MTA to discard any incoming emails if they were not received from either my filtering service company or the TCH server itself. And I was pleasantly surprised that Alex on the TCH support staff accommodated my request. Of course, I have to remember not to use the cPanel filter function in the future because it will most certainly overwrite the filter that I had TCH set up for me. As a final thought, it would be great if TCH could provide a way to create and maintain our own Exim filter file that doesn't conflict with the cPanel mechanism and doesn't require us to open a ticket to have TCH staff apply the change for us. -
I have decided to outsource my anti-spam/anti-virus filtering to a service company that specializes in this. TCH has modified my MX records so that all email will normally be sent to my spam filtering service before being delivered to my domain on the shared hosting server at TCH. That's working fine right now. But spammers often bypass the MX records and deliver their spam directly to the server that hosts my domain, and bypass the spam service. I do know that the first line of the header records for all incoming mail that has been processed by my spam service will contain the following information: Received: from servername.mySpamFilterService.net [aaa.bbb.ccc.ddd] So I need a script or filter that will discard all incoming messages if the first line of the header doesn't contain "mySpamFilterService.net" or deliver it to the recipients inbox if it does. Could anyone provide a simple script example of how to do this. I've looked everywhere for such a script but have not found one. As more and more small and medium businesses turn to commercial strength spam/virus email filtering services, I think a solution to this problem would be well received by the TCH community.
-
Mx Record Changes Are Not Immediate
EdHosting replied to EdHosting's topic in CPanel and Site Maintenance
Just wanted to make sure that others who read this topic don't propagate that. -
Mx Record Changes Are Not Immediate
EdHosting replied to EdHosting's topic in CPanel and Site Maintenance
This wasn't a propagation issue. MX records don't propagate. Propagation of DNS refers to the hierarchal distribution and updating of the authoritative name servers for all the domains in the Internet. Changing the name servers for a given domain can, and often does take several days to propagate. Normally, this kind of change occurs when you change hosting providers. Changing the MX record does not change name server for the domain. But caching name servers may take several hours before re-querying those name servers for a fresh resolution of the MX record. I agree that in the end the result is the same. Any changes to DNS will require a period of time before they resolve properly everywhere. -
Mx Record Forwarding Not Working
EdHosting replied to EdHosting's topic in CPanel and Site Maintenance
I finally figured out what was causing this behavior and posted a new topic to address the issue for future reference here MX record changes are not immediate -
To be specific, if you change the MX record for a domain hosted at TCH, the change is immediate with TCH's DNS servers, but it may take several hours or more for SMTP email servers to use the new pointer. This is not a TCH problem, it's the way that the DNS system was designed to work. Whenever an SMTP mail server attempts to deliver mail to a TCH hosted domain, it (or more specifically it's own DNS server) first checks it's local DNS cache. If an MX record for the domain is found in the cache, it uses it to deliver the mail to the SMTP server that the MX record points to. Otherwise, it asks the TCH DNS server for the MX record and adds it to the local cache. Once the MX record is in the local cache, it remains active for a period of time called "Time To Live". I believe the default TTL value is 4 hours, but can be forced higher by Sys Admins. I found this out while transitioning email for a couple of TCH hosted domains to a dedicated in-house Email server. I did this by reconfiguring each Outlook client to use the new email server and then deleting the user's mailbox on the TCH server and replacing it with a manual forwarding entry. After the last client had been reconfigured, it was time to change the MX record so that all email for the domain(s) would be redirected to the new email server and the individual forwarding entries would no longer be needed. I did this using cPanel and it reported that the change had been made. But in a "Senior Moment", I went ahead and deleted all the manual forwarding entries. As a final check, I tried sending some test messages to myself from a remote Outlook client, but they didn't go through. After a lot of testing and checking, I opened up a trouble ticket. But the response I got from them was "the MX record is fine, it should be working". Now, although this was true, someone should have mentioned this TTL caching issue to me. Instead, I had to figure it out myself. Hopefully, TCH Support will pick up on this for future reference. So the bottom line is, if you change the MX record on the TCH server, you should plan on waiting a day or so before you delete the user's mailboxes or any individual forwarding entries.
-
Mx Record Forwarding Not Working
EdHosting replied to EdHosting's topic in CPanel and Site Maintenance
Rick, I had decided to turn the MX redirection off so that I could test some other features of my Email Server using specific forward records. So that's why you saw that it was not set the way I explained it above. Today I decided to test the MX redirection again and all of a sudden it's working as it should. Thumbs Up I have no idea why it wasn't working the other day. -
Mx Record Forwarding Not Working
EdHosting replied to EdHosting's topic in CPanel and Site Maintenance
No, I'm not sending from one of the TCH servers. I can open up a ticket, but I thought the cPanel MX modify was supposed to take care of that. Can you explain a little more, so I and others can understand it's use. Also, as for supplying the IP address of my email server, remember, it's dynamic and changes all the time. That's what the the TZO service takes care of. So the forwarding need to work with the TZO service somehow. -
In this topic Mail Redirection it is suggested that all email can be forwarded to a TZO hosted domain by simply modifying the MX record using cPanel. Well, I tried that and it doesn't work. Here are the specifics: I have a domain named organictreeandsoil.com hosted at TCH. I have a domain named arborjet.tzo.com at TZO. I have and Email server running in-house connected tot the Internet via an ISP with a dynamic IP address. The TZO software running on the email server updates the IP address periodically at TZO so that it is always current. I can add a forwarding address to my TCH account as follows: testuser@organictreeandsoil.com >>> testuser@arborjet.tzo.com This works just fine. Email sent to either of the above address is delivered to my Email server as it should. However, if I delete the forwarding address and instead modify the MX record as follows: organictreeandsoil.com To: arborjet.tzo.com then email to testuser@organictreeandsoil.com stops being delivered. Any ideas what the problem is?
-
Just added another client's site to TCH when the temporary freeze was lifted this morning. Order process was straightforward, except for one thing. I was prompted for a primary email address as well as a secondary. So I added my client's address in the primary and my address as secondary. I was hoping that the activation email would be sent to both, but was only sent to the primary. This required me to contact the client so that he could forward the email to me and allow me to continue setting things up. Not a big thing, but it would be nice to have the activation info sent to both addresses.
-
Richard, I had already tried using version 5 of PDF maker, but it complains about the png files that make up the graphs, so it renders these as simple rectangles. Not as impressive looking as the original, but it does work. Scott, I'm using the HyperSnap DX screen capture utility which lets me capture a rectangular region of the screen. Using that tool, I'm able to capture the whole report into seven images which I then paste into the email. This way, I get all the pretty graphs that management types like to see. So yes, where there's a will there's a way. But for those who manage many sites remotely, the ability to generate a pdf automatically will be a welcome addition to the AwStats feature.
-
For the reasons stated in my previous post, none of these cut, paste, or save as techniques will work with the AwStats because we're still dealing with html code that references graphics files (for the charts) that are stored in areas on the server that are not accessible to the recipient. When you cut and paste an html document into an Outlook email message, it may appear to you to have embedded everything, but it hasn't, it's just referencing all the links and making it appear as though it had. That said, it looks like the AwStats developers are addressing the issue of being able to email these stats to others by allowing the stats to be exported to a portable self contained document in the form of a pdf file. For those of us who manage sites for others, this will be a nice feature and I'm sure the Cpanel folks know this.
-
Thanks for the responses. It may be a little while before the cPanel folks include this. I noticed that the feature summary for AWstats 5.9 has the PDF output listed as "experimental". But it's encouraging to note that the fix list states that "pdf output appears to be working". As for the suggested workarounds, they don't work. If you do a "save as" it ends up creating a folder with sub-folders containing all the graphics to support the html document, not something you can just email. If you do a "select all" from within IE and then paste it into the body of an Outlook html email message, it looks great and you can even send it to yourself and everything's fine, but send it to someone who does not have log-in access to your site and it will prompt them endlessly for a login and they have to use Windows task manager to kill the Outlook process to get out of the cycle. Quite nasty. If you view the source of the html code within the email message you can see why, because it has links to an awstats folder that I believe is under tmp.
-
The AwStats output is great, however when I tried sending the displayed page as an email, the recipient got a blank message and was continuously prompted to log into the hosted site. The way it's currently implemented, I don't think there's a simple way to email the stats. As a temporary workaround, I used a graphics program to do a few screen scrapes and inserted the images into the email However, at the AwStats development site, I see that the new version 5.91 supports exporting the stats as a pdf document which could then be emailed as an attachment. I hope TCH will consider adding support for this sometime.
