mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:50:11 +01:00
support for VERP addresses
This commit is contained in:
parent
284c434612
commit
39a2e6a306
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#define VERSION "0.1.25-rc3"
|
#define VERSION "0.1.25-rc3"
|
||||||
|
|
||||||
#define BUILD 876
|
#define BUILD 877
|
||||||
|
|
||||||
#define HOSTID "mailarchiver"
|
#define HOSTID "mailarchiver"
|
||||||
|
|
||||||
|
19
src/misc.c
19
src/misc.c
@ -193,12 +193,29 @@ int trimBuffer(char *s){
|
|||||||
|
|
||||||
|
|
||||||
int extractEmail(char *rawmail, char *email){
|
int extractEmail(char *rawmail, char *email){
|
||||||
char *p;
|
char *p, *q1, *q2;
|
||||||
|
|
||||||
memset(email, 0, SMALLBUFSIZE);
|
memset(email, 0, SMALLBUFSIZE);
|
||||||
|
|
||||||
|
// extract both regular and VERP addresses, eg.
|
||||||
|
// aaa@aaa.fu and archive+user=domain.com@myarchive.local
|
||||||
|
|
||||||
p = strchr(rawmail, '<');
|
p = strchr(rawmail, '<');
|
||||||
if(p){
|
if(p){
|
||||||
|
q1 = strchr(p+1, '+');
|
||||||
|
if(q1){
|
||||||
|
q2 = strchr(q1+1, '=');
|
||||||
|
if(q2){
|
||||||
|
p = strchr(q2, '@');
|
||||||
|
if(p){
|
||||||
|
*p = '\0';
|
||||||
|
*q2 = '@';
|
||||||
|
snprintf(email, SMALLBUFSIZE-1, "%s", q1+1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(email, SMALLBUFSIZE-1, "%s", p+1);
|
snprintf(email, SMALLBUFSIZE-1, "%s", p+1);
|
||||||
p = strchr(email, '>');
|
p = strchr(email, '>');
|
||||||
if(p){
|
if(p){
|
||||||
|
Loading…
Reference in New Issue
Block a user