imapwire

This periodically attachs to, checks for and grabs new articles in a mailbox on
a remote IMAP server.

It is normally started by 'iptimer' with progs.FipSeq for the mailbox name, password
etc

The whole docuement is then left, normally, in spool/xsmtp for 'ipchkmail' to
pull apart the Header etc.

The parameter file, normally tables/wire/IMAP, is read for the the names of the
mailbox to scan.
	; comment

	mailbox: (mailbox name on the remote IMAP server)

		password:(FipSeq/in plain)
			no default
		delete:(yes/no)
			Delete files after successful get
			default is NO (not yet... )
		sendto:(newaddress)
			sendto allows you to specify another name for the DA field
			IPPOST will use this to route. By default
			the Fip Hdr field DA will hold the logon name.
		fiphdr:(progs.FipSeq)
			Add to the FIP hdr - perhaps the DU field to change the destination.
			default: none
		inbox: (inbox name)
			default INBOX

	eg
	mailbox:chris   password:zongle	fiphdr:#XX:here delete:yes

Optional
	grab-every:(seconds)
		Connect, logon and check for news every X seconds.
		The default is 600 seconds (5 mins) while the minimum 
		is 5 seconds.
		The '-t' input switch can also be used.

	defdest: (default Fip Destination (DU progs.FipHdr field)	default: "imap"
	chrset:	(Source character set ie SC header field)	default: ascii
	response-timeout: (timeout in seconds wanting for the rmote to replay)
								default: 60 secs
	extra-fiphdr: (more progs.FipHdr information to add)		default: none
	proxy-server: If using a proxy, these are the name and port to aim at.
	proxy-port:
	proxy-logon: This is the logon and password to get thru the firewall
		if required. The format is (logon) (colon) (password) and is
		converted to base 64.
		proxy-logon:Y2hyaXMuaHVnaGpvbmVzOnBhbnRoZXIK=

		To generate :
			echo -n "logon:password" | sffb64 -i
		eg	echo -n "chris:sleekpanther" | sffb64 -i
		gives   progs.Y2hyaXM6c2xlZWtwYW50aGVy
			proxy-logon:Y2hyaXM6c2xlZWtwYW50aGVy=
	proxy-is-squid:yes/no   Is the proxy a Squid ?  default: no

		Please see note below

	use-tls:yes/implicit/explicit/no
		The commends are for a ftp running over SSL/TLS on the remote server
		default is NO
		no		- normal, standard FTP on (normally) port 21 for the control
		yes or explicit - connect (normally) on port 110 in clear then use SSL for
USER, PASS and data
		implicit	- connect (normally) on port 995: use SSL for all conversations
	tls-auth: (XXX)
		AUTH type for TLS/SSL				default: TLS

	ssl-method: (1,2,3,23,999)
		Version number to use for TLS/SSL		default: 999 for current default (2 or 3)
	ssl-password: (password)
	ssl-passwd: (password)				  default: none
		Optional password if the handshake requires a shared secret
	ssl-cert: (name of a PEM certificate file)		default: none
	ssl-root-cert: (name of a root PEM certificate file)	defaunt: none
		Optional certificates - held in tables/ssl

Where sections of progs.FipHdr fields are required or changes to the output style,
use
 keywords : fixed, partial, combie, optional, repeat, newdate and/or style.
(see The progs.SysA
dmin manual for more information).

	They are normally specified :
		fixed:QZ	1234543
		partial:QT	ST,3,2,U,<,>
		combie:QY	ep|na,(0000000)a
		option:QE	ep,11,7,s
		repeat:QK	XK,-,3
	or	repeat:QP	PK,,4,#X
		style:QS	XN,%.03d
		replace:QN	NN	abc=DEF def=GHI
		newdate:QT	hours+3	"\ZD"

--- Testing

If things do NOT look like they are working, you can run imapwire manually with
the -1 and -D to run once and display the handshake.

So if the line in the SYSTEM file is

Note Imapwire saves the last item, date and time and UID in a file for each
mailbox in /fip/fix/imapwire
The three items are editable on 3 lines, so you can mess around at your peril
if you need !
::::::::::::::
imap_mail.zingle.com_fip$2011%hoho_inbox
::::::::::::::
408
14-Oct-2011
174223


--- Input switches are :
Mandatory :
	-s : Hostname where the IMAP is running.	default: none
Optional :
	-1 : one single pass and then stop		default: continuous
	-B : default balance group for skip files	default: none
		(see skip-balance-group parameter)
	-D : display the conversation with the remote server	default: no
		valid ONLY with the -1 for single shot
		used for debugging troublesome connections
	-h : extra progs.FipHdr information			default: none
		This is in progs.FipSeq and should normally be quoted
		Note this is the means that 'iptimer' sends variable information to imapwire
		eg : -h"SN:hello#TC:200401031"
	-l : log every connection with files		default: no logging
	-L : log every file through			default: no logging
	-n : name of the service			def: name of the parameter file
	-o : Next fip queue for incoming files		default: spool/2go
	-p : port number on the remote host		default: 143
	-t : sleep in seconds between connections/accesses	default: 600 secs
	-U : restart on this UID			default: use last saved in the fix file 
	-x : Proxy server host or IP address		default: none
	-X : Proxy server port				default: 80
	-y : Proxy logon				default: none
	-Y : Proxy server is Squid			default: no
	-z : parameter file				default: wire/IMAP
	-v : display version number and exit.

Version Control
;001j	31dec08 cleanups ;f note_balance_action ;g-h 16feb11 added TLS
		;i-j 31oct11 make sure date is valid and better error msgs

(copyright) 2011 and previous years progs.FingerPost Ltd.
Topic revision: r1 - 21 Jan 2005 - 14:06:49 - TWikiGuest
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback