Debian Codegraph @

test/functional/cases/001_merged/104_get_from.robot

raw
1 *** Settings ***
2 Library ${RSPAMD_TESTDIR}/lib/rspamd.py
3 Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
4 Variables ${RSPAMD_TESTDIR}/lib/vars.py
5
6 *** Variables ***
7 ${OPTIONS1} ,[email protected],user,example.org
8 ${OPTIONS2} First Last,[email protected],user,example.org
9 ${OPTIONS3} First M. Last,[email protected],user,example.org
10 ${SETTINGS_GETFROM} {symbols_enabled = [${SYMBOL}]}
11 ${SYMBOL} GET_FROM
12
13 *** Test Cases ***
14 task:get_from('mime') - address only
15 Scan File ${RSPAMD_TESTDIR}/messages/from/from.eml
16 ... Settings=${SETTINGS_GETFROM}
17 Expect Symbol ${SYMBOL}
18
19 task:get_from('mime') - comment
20 Scan File ${RSPAMD_TESTDIR}/messages/from/from_comment.eml
21 ... Settings=${SETTINGS_GETFROM}
22 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS1}
23
24 task:get_from('mime') - display name
25 Scan File ${RSPAMD_TESTDIR}/messages/from/from_dn.eml
26 ... Settings=${SETTINGS_GETFROM}
27 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS2}
28
29 task:get_from('mime') - display name Base64
30 Scan File ${RSPAMD_TESTDIR}/messages/from/from_dn_base64.eml
31 ... Settings=${SETTINGS_GETFROM}
32 Expect Symbol With Exact Options ${SYMBOL} Кириллица,[email protected],user,example.org
33
34 task:get_from('mime') - display name and comment
35 Scan File ${RSPAMD_TESTDIR}/messages/from/from_dn_comment.eml
36 ... Settings=${SETTINGS_GETFROM}
37 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS2}
38
39 task:get_from('mime') - quoted display name
40 Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn.eml
41 ... Settings=${SETTINGS_GETFROM}
42 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
43
44 task:get_from('mime') - quoted display name and comment
45 Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_comment.eml
46 ... Settings=${SETTINGS_GETFROM}
47 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
48
49 task:get_from('mime') - quoted in the middle of DN (outer spaces)
50 Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle.eml
51 ... Settings=${SETTINGS_GETFROM}
52 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
53
54 task:get_from('mime') - quoted in the middle of DN (inner spaces)
55 Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
56 ... Settings=${SETTINGS_GETFROM}
57 Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}