feat: support mailing-list and monthly mail capture paths
This commit is contained in:
1 parent
543814cbd6
commit
1a451023f0
7 files changed
+165
-5
No files matched your search
@@ -34,7 +34,7 @@ def run():
|
||||
mail=message.as_bytes()
|
||||
with patch('sys.stdin',SimpleNamespace(buffer=io.BytesIO(mail))):
|
||||
captured=task('from-mail')
|
||||
assert captured['item']['page_uuid'] and captured['page_path']=='/private/mail/mail-'+captured['item']['uuid']
|
||||
assert captured['item']['page_uuid'] and captured['page_path']=='/private/mail/hogehoge/123'
|
||||
assert captured['item']['title']=='日本語の件名と依頼'
|
||||
assert 'Private mail body' not in captured['item']['notes']
|
||||
with patch('sys.stdin',SimpleNamespace(buffer=io.BytesIO(mail))):
|
||||
@@ -43,6 +43,14 @@ def run():
|
||||
assert note['linked'] and note['path']==captured['page_path']
|
||||
raw,_=client.raw('path:'+captured['page_path'])
|
||||
assert '日本語の件名と依頼' in raw.decode() and 'Private mail body' in raw.decode()
|
||||
message.replace_header('Subject','連番なしの日本語');message.replace_header('Message-ID','<other@example.invalid>');message['Date']='Sat, 31 Jan 2026 23:30:00 -0800'
|
||||
with patch('sys.stdin',SimpleNamespace(buffer=io.BytesIO(message.as_bytes()))):dated=task('from-mail')
|
||||
assert dated['page_path']=='/private/mail/2026/01/'+dated['item']['uuid']
|
||||
del message['Message-ID']
|
||||
import hashlib
|
||||
raw_mail=message.as_bytes()
|
||||
with patch('sys.stdin',SimpleNamespace(buffer=io.BytesIO(raw_mail))):hashed=task('from-mail')
|
||||
assert hashed['page_path']=='/private/mail/2026/01/'+hashlib.sha256(raw_mail).hexdigest()
|
||||
path=Path(fixture['root'])/'person.vcf'
|
||||
path.write_text('BEGIN:VCARD\r\nVERSION:4.0\r\nUID:urn:test:cli\r\nFN:CLI Person\r\nEMAIL:cli@example.invalid\r\nEND:VCARD\r\n')
|
||||
output=io.StringIO()
|
||||
|
||||
Reference in new issue
Block a user