March 15th, 2008
Add a router before or instead of the dnslookup router:
gmail_route:
driver = manualroute
transport = gmail_relay
route_list = * smtp.gmail.com
Add a transport:
gmail_relay:
driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address
Add an authenticator (replacing myaccount@gmail.com and mypassword with your own account details):
gmail_login:
driver = plaintext
public_name = LOGIN
hide client_send = : myaccount@gmail.com : mypassword
$host_address is used for hosts_require_auth and hosts_require_tls instead of smtp.gmail.com to avoid occasional 530 5.5.1 Authentication Required errors. These are caused by the changing IP addresses in DNS queries for smtp.gmail.com. $host_address will expand to the particular IP address that was resolved by the gmail_route router.
Tags: Email, Exim, Gmail
Posted in Sysadmin | 3 Comments »
September 10th, 2007
SQL Server logs in a circular fashion to its transaction log files. To shrink a transaction log file it is first necessary to backup the log.
The following script backs the log up, throwing away the backup in the process and then shrinks the files in the database. Make sure you have a full backup of the database before running.
declare @db varchar(50)
set @db = DB_NAME()
backup log @db with truncate_only
dbcc shrinkdatabase (@db, truncateonly)
Tags: Microsoft SQL Server
Posted in Sysadmin | No Comments »
August 28th, 2007
To convert a date time attribute in Active Directory (e.g. as used by lastLogon) to a human readable date time, you can use the w32tm command.
For example with the following LDAP record:
dn: CN=John Smith,CN=Users,DC=DC=example,DC=com
lastLogon: 128326919184182832
Running
w32tm /ntte 128326919184182832
Will give the output
148526 12:38:38.4182832 - 27/08/2007 13:38:38 (local time)
See Microsoft Knowledge Base article 555936 for more information.
Tags: Active Directory, Windows
Posted in Sysadmin | No Comments »