On 08/03/2010 01:21 PM, Lou Picciano wrote:
> Paul,
>
> Yes, I've already been through all the man pages - we're beyond that.
> (Are you saying the sum total of the docs are those man pages?)
Almost. The man pages *plus* INSTALL *plus* the README.* docs.
> How/where would I go about researching the current problem - that we
> cannot read the body or attachments of any emails using imap? Server is
> apparently set up OK, as we are connecting, receiving headers, etc.
Either, message insertion did not succeed and the data is incomplete, or
message retrieval fails. In both cases postgres and/or dbmail should log
errors.
Set the trace_syslog to 5 in dbmail.conf
create a testuser:
dbmail-users -a testuser -w test
insert a message for this user:
cat >> test.eml << EOF
From: nobody
Subject: test subject
To: testu...@localhost
test body
EOF
cat test.eml | dbmail-smtp -u testuser
This must not log any dbmail related errors in syslog.
Retrieve this message:
../dbmail-imapd -n
../dbmail-imapd -n
* OK dbmail imap (protocol version 4r1) server 2.2.16 ready to run
x login testuser test
x OK LOGIN completed
x select inbox
* 1 EXISTS
* 1 RECENT
* FLAGS (\Seen \Answered \Deleted \Flagged \Draft)
* OK [PERMANENTFLAGS (\Seen \Answered \Deleted \Flagged \Draft)]
* OK [UIDNEXT 22] Predicted next UID
* OK [UIDVALIDITY 5] UID value
* OK [UNSEEN 2] first unseen message
x OK [READ-WRITE] SELECT completed
x fetch * (body[])
* 2 FETCH (BODY[] {155}
From: nobody
Subject: test subject
To: testu...@localhost
Return-Path: nobody
Message-Id: <1280842773.22599.0@(none)>
MIME-Version: 1.0
test body
)
x OK FETCH completed
You can add utf8 encoded characters to the message body to validate
non-ascii message insertion and retrieval.
If these tests complete your message insertion and retrieval is clean.
More, similar testing with multipart messages is of course possible.
> For starters, specifically: If the wiki is not authoritative, where IS
> the authoritative setup information for a PostgreSQL backend? Have I
> got it all right? Are my queries correct? Where is the code to
> 'reconstruct' a complete email message, so I can test the integrity of a
> message, or of our own SQL integrations?
There is no specific setup information regarding specific RDBMS backends
other than the INSTALL documument. You do not need to setup specific
queries for dbmail proper. Only if you want to interface external tools
to the dbmail database - like postfix or amavis etc - you need to set
those up. But don't do that until basic dbmail functionality is complete
and tested.
The queries to reconstruct a message is quite simple for 2.2. You need
to know the message_idnr which is equal to the IMAP UID number for a
message:
x login testuser test
x select INBOX
x fetch * (UID)
this will give you the message_idnr for the last message inserted into
testuser's INBOX.
Use:
select messageblk from dbmail_messageblks b
JOIN dbmail_physmessage p on b.physmessage_id=p.id
JOIN dbmail_messages m on p.id = m.physmessage_id
where
m.message_idnr=XXXXX;
replacing XXXXX with the retrieved UID to give you the full raw message
as stored in the database.
--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail