Re: [xmail] SMTP external authentication is not worjing

2019-03-05 Thread Bart Mortelmans via xmail
I understand that you can be sure that your checkSmtpAuth.sh is indeed 
being called, because you see that the RFILE is created, with the 
contents you expect your script to put in there?


In that case my guess is that XMail is having trouble accessing your 
RFILE. If the exit code wasn't seen as "0", then you should either get 
"451 Requested action aborted" or "503 Authentication failed".
The error "550 Relay denied" most probably is based on the fact that it 
isn't finding "R" (for relaying) in the RFILE.
In theory, it should also delete the RFILE. So the fact that they're 
still there, also seems to indicate a problem with the RFILE.


- What would happen if you don't write this RFILE and don't specify the 
@@RFILE parameter in smtpextauth.tab? In theory the default from 
server.tab would be used.
- Anything strange about permissions of the RFILE's that have not been 
removed?
- Could it be that your script has somehow not finished writing the file 
yet by the time XMail tries to read it?




Bart



Op 5/03/19 om 07:41 schreef Spon Spon via xmail:

Hello,

I have a mixed setup with DOVECAT for IMAP access, and XMAIl 1.27 for 
the rest.  The relay is cosed until authentication is made In order to 
have a centralized place for authentication I used in XMAIL external 
authentication.  However seems it is not working as I receive 550 
Relay Denied when I try to send an email using this XMAIL server.


The setup is as following:

In smtpextauth.tab I put following line:

"LOGIN""/config/scripts/checkSmtpAuth.sh""@@AUTH""@@USER""@@PASS""@@RFILE"
In server tab I have:
"DefaultSmtpPerms""MRVZ"

In checkSmtpAuth.sh I always exit with 0 for testing.  However I 
received 550 Relay denied each time I tried to send an email.  If the 
script exits with 1 then the error is different, (Authentication error).


I tried also populating RFILE with Perms=MR but without success. I 
tried also with Perms=MRVZ . No change.


Also another issue is the fact that those RFILE files were never get 
deleted.  For each email, that file is created and stays there forever 
(need external action to delete it)


Is there any other settings that need to be made or is this a bug ?

Using internal authentication (smtpauth.tab or mailuser.tab) emptying 
smtpextauth.tab  there is no such error, and everything works as expected.


Unfortunately there is no debug log in application, so only way to 
figure out is DEBUG, and currently it is installed on an embedded 
router so no way to debug.


Thanks,
Spon


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail





smime.p7s
Description: S/MIME-cryptografische ondertekening
___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] Catch All

2016-03-20 Thread Bart Mortelmans via xmail
Hi,

The easiest solution probably is putting this in aliases.tab:
“rpzdesign.com”[tab]”*”[tab]”rpzrpzrpzj...@gmail.com”

Obviously replacing [tab] with real tabs. And take into account that this is a 
file you can’t edit while XMailserver is running (so turn it off first or use 
CtrlClnt to edit it).

Sincerely,
Bart



> On 20 mrt. 2016, at 11:05, md--- via xmail  wrote:
> 
> How does one create a catch all for a given domain while still allowing 
> specific users to receive
> their messages?
> 
> For example:
> 
> My domain is rpzdesign.com
> 
> I want all messages sent specifically to m...@rpzdesign.com to come to my 
> inbox.
> 
> But I want ALL other email address like anyth...@rpzdesign.com to be sent to 
> an external email address
> at rpzrpzrpzj...@gmail.com
> 
> Mailproc.tab in domain?
> 
> I tried using aliases but it does not work like I want, to many 550 user 
> unkown errors.
> 
> Any help?
> 
> Marco
> 
> 
> ___
> xmail mailing list
> xmail@xmailserver.org
> http://xmailserver.org/mailman/listinfo/xmail

___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] BUG : XMAIL 1.27 with SSL

2015-05-26 Thread Bart Mortelmans via xmail
It might be difficult to determine if the problem is with XMail or with 
the client. And even if for example Tencent actually closes the 
connection incorrectly, it should be better if XMail would be able to 
handle such an improperly closed connection.
But I'm not sure if you'll find somebody in this forum that will be able 
to fix this problem. Maybe you could try to get K9 developers involved 
in this? That seems to be managed much more actively than XMail. With a 
bit of luck, they can at least find out what they are doing differently 
compared to for example Outlook and that could cause this problem.



Oversea Site via xmail schreef op 26/05/15 om 15:09:

Now I am using original XMAIL-1.27.tar.gz source without simultaneous POP3 
logins, no STUNNEL, use NATIVE XMAIL SSL. The problem still exists, K9-MAIL 
will report IllegalFormatConversonException when I receive more then 100-200 
emails. So It should be XMAIL SSL problem. Because When I reuse STUNNEL to do a 
POP3 tunnel again, the problem will fix.


 Original Message 
From: Bart Mortelmans 
To: t...@os.st, "XMail Users Mailing List" 
Sent: Tue, May 26, 2015, 3:13 PM
Subject: Re: [xmail] BUG : XMAIL 1.27 with SSL

Is there any way for you to test if the problem exists if you don't
allow simultaneous POP3 logins?


Oversea Site via xmail schreef op 26/05/15 om 08:14:

POP3Utils.cpp - ADD POP3 Concurrent Login. I used this function over 5 years.. 
I don't know C++ programming. Sorry :)


 }
  if (pPOPMD->ulFlags & POPF_MSG_DELETED) {
  UPopSendErrorResponse(hBSock, ERR_MSG_DELETED, 
pPOPSD->iTimeout);

  ErrSetErrorCode(ERR_MSG_DELETED);
  return ERR_MSG_DELETED;
  }

  UsrGetMailboxPath(pPOPSD->pUI, szMsgFilePath, sizeof(szMsgFilePath), 
1);
  StrNCat(szMsgFilePath, pPOPMD->szMsgName, sizeof(szMsgFilePath));
/*
   * ADDED CODE START
   */

FILE *pMsgFile = fopen(szMsgFilePath, "rb");
if (pMsgFile == NULL) {
UPopSendErrorResponse(hBSock, ERR_FILE_OPEN, pPOPSD->iTimeout);

ErrSetErrorCode(ERR_FILE_OPEN);
return ERR_FILE_OPEN;
}
fclose(pMsgFile);

/*
   * ADDED CODE END
   */

  SysSNPrintf(szResponse, sizeof(szResponse) - 1,
  "+OK " SYS_OFFT_FMT " bytes", pPOPMD->llMsgSize);
  if (BSckSendString(hBSock, szResponse, pPOPSD->iTimeout) < 0)
  return ErrGetErrorCode();

  if (pPOPMD->llMsgSize > 0 &&



 Original Message 
From: Oversea Site via xmail 
To: "XMail Users Mailing List" 
Sent: Tue, May 26, 2015, 1:56 PM
Subject: Re: [xmail] BUG : XMAIL 1.27 with SSL

FEDORA 4 X86_64 GLIBC 2.3.6-3 (I can't upgrade it to the lastest version.. 
Because I have a chiliasp 3.6.2 32-bit run ASP VBSCRIPT on APACHE 1.3 32-bit 
software, it need GLIBC 2.3.x and Kernel 2.6)

KERNEL 3.3 MOD FROM FC15 (It will display KERNEL 2.6.43 Number). Kernel is not 
a main problem. Because I have been test 2.6.32 or other. same problem was 
found.

REAL HARDWARE -> INTEL B85M i3-4150 16G RAM SATA3 RAID 1 LINUX SOFTRAID1 MDADM

Corp. Email System is not heavily use when I test it in HK TIME midnight..

Anyway I will test this issue in other linux distribution in VM, such as 
CentOS. (You can give me any linux distribution, let's build the same platform 
in VM. I use virtualbox.

[root@bravo logs]# uname -a
Linux bravo 2.6.43-gcc402 #3 SMP Sun May 17 23:10:29 HKT 2015 x86_64 x86_64 
x86_64 GNU/Linux
[root@bravo logs]#
[root@bravo logs]# ldd /var/MailRoot/bin/XMail127v3
 linux-vdso.so.1 =>  (0x77f0e000)
 libssl.so.0.9.8 => /usr/local/ssl/lib/libssl.so.0.9.8 
(0x7f43b00bc000)
 libcrypto.so.0.9.8 => /usr/local/ssl/lib/libcrypto.so.0.9.8 
(0x7f43afd35000)
 libdl.so.2 => /lib64/libdl.so.2 (0x003e1820)
 libpthread.so.0 => /lib64/libpthread.so.0 (0x003e1860)
 libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x7f43afa37000)
 libm.so.6 => /lib64/libm.so.6 (0x003e1800)
 libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x003e1940)
 libc.so.6 => /lib64/libc.so.6 (0x003e17d0)
 /lib64/ld-linux-x86-64.so.2 (0x003e17b0)

***
/var/MailRoot/bin/XMail127v3 -Md -Ms /var/MailRoot -Sl -Pl -Cl \
-SI 0.0.0.0:8025 -SI 0.0.0.0:25 \
-PI 0.0.0.0:8110 -PI 0.0.0.0:110 \
-BI 0.0.0.0:995 \
-XI 0.0.0.0:465 \
-Ql -Ln 256 -Pt 60 -St 150 -F- -SX 2048 -Mx 64 \
-Qn 64 -PX 2048 -Qr 1 -Qt 1 -QT 150 -Qg -CX 256
***


 Original Message 
From: "U.Mutlu" 
To: t...@os.st, "XMail Users Mailing List" 
Sent: Tue, May 26, 2015, 1:06 PM
Subject: Re: [xmail] BUG : XMAIL 1.27 with SSL

Oversea Site via xmail wrote on 05/26/2015 05:14 AM:

No Log Error. No Fatal Error log. No Core Dump

It's 

Re: [xmail] BUG : XMAIL 1.27 with SSL

2015-05-26 Thread Bart Mortelmans via xmail
Is there any way for you to test if the problem exists if you don't 
allow simultaneous POP3 logins?



Oversea Site via xmail schreef op 26/05/15 om 08:14:

POP3Utils.cpp - ADD POP3 Concurrent Login. I used this function over 5 years.. 
I don't know C++ programming. Sorry :)


}
 if (pPOPMD->ulFlags & POPF_MSG_DELETED) {
 UPopSendErrorResponse(hBSock, ERR_MSG_DELETED, 
pPOPSD->iTimeout);

 ErrSetErrorCode(ERR_MSG_DELETED);
 return ERR_MSG_DELETED;
 }

 UsrGetMailboxPath(pPOPSD->pUI, szMsgFilePath, sizeof(szMsgFilePath), 
1);
 StrNCat(szMsgFilePath, pPOPMD->szMsgName, sizeof(szMsgFilePath));
/*
  * ADDED CODE START
  */

FILE *pMsgFile = fopen(szMsgFilePath, "rb");
if (pMsgFile == NULL) {
UPopSendErrorResponse(hBSock, ERR_FILE_OPEN, pPOPSD->iTimeout);

ErrSetErrorCode(ERR_FILE_OPEN);
return ERR_FILE_OPEN;
}
fclose(pMsgFile);

/*
  * ADDED CODE END
  */

 SysSNPrintf(szResponse, sizeof(szResponse) - 1,
 "+OK " SYS_OFFT_FMT " bytes", pPOPMD->llMsgSize);
 if (BSckSendString(hBSock, szResponse, pPOPSD->iTimeout) < 0)
 return ErrGetErrorCode();

 if (pPOPMD->llMsgSize > 0 &&



 Original Message 
From: Oversea Site via xmail 
To: "XMail Users Mailing List" 
Sent: Tue, May 26, 2015, 1:56 PM
Subject: Re: [xmail] BUG : XMAIL 1.27 with SSL

FEDORA 4 X86_64 GLIBC 2.3.6-3 (I can't upgrade it to the lastest version. 
Because I have a chiliasp 3.6.2 32-bit run ASP VBSCRIPT on APACHE 1.3 32-bit 
software, it need GLIBC 2.3.x and Kernel 2.6)

KERNEL 3.3 MOD FROM FC15 (It will display KERNEL 2.6.43 Number). Kernel is not 
a main problem. Because I have been test 2.6.32 or other. same problem was 
found.

REAL HARDWARE -> INTEL B85M i3-4150 16G RAM SATA3 RAID 1 LINUX SOFTRAID1 MDADM

Corp. Email System is not heavily use when I test it in HK TIME midnight.

Anyway I will test this issue in other linux distribution in VM, such as 
CentOS. (You can give me any linux distribution, let's build the same platform 
in VM. I use virtualbox.

[root@bravo logs]# uname -a
Linux bravo 2.6.43-gcc402 #3 SMP Sun May 17 23:10:29 HKT 2015 x86_64 x86_64 
x86_64 GNU/Linux
[root@bravo logs]#
[root@bravo logs]# ldd /var/MailRoot/bin/XMail127v3
linux-vdso.so.1 =>  (0x77f0e000)
libssl.so.0.9.8 => /usr/local/ssl/lib/libssl.so.0.9.8 
(0x7f43b00bc000)
libcrypto.so.0.9.8 => /usr/local/ssl/lib/libcrypto.so.0.9.8 
(0x7f43afd35000)
libdl.so.2 => /lib64/libdl.so.2 (0x003e1820)
libpthread.so.0 => /lib64/libpthread.so.0 (0x003e1860)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x7f43afa37000)
libm.so.6 => /lib64/libm.so.6 (0x003e1800)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x003e1940)
libc.so.6 => /lib64/libc.so.6 (0x003e17d0)
/lib64/ld-linux-x86-64.so.2 (0x003e17b0)

***
/var/MailRoot/bin/XMail127v3 -Md -Ms /var/MailRoot -Sl -Pl -Cl \
-SI 0.0.0.0:8025 -SI 0.0.0.0:25 \
-PI 0.0.0.0:8110 -PI 0.0.0.0:110 \
-BI 0.0.0.0:995 \
-XI 0.0.0.0:465 \
-Ql -Ln 256 -Pt 60 -St 150 -F- -SX 2048 -Mx 64 \
-Qn 64 -PX 2048 -Qr 1 -Qt 1 -QT 150 -Qg -CX 256
***


 Original Message 
From: "U.Mutlu" 
To: t...@os.st, "XMail Users Mailing List" 
Sent: Tue, May 26, 2015, 1:06 PM
Subject: Re: [xmail] BUG : XMAIL 1.27 with SSL

Oversea Site via xmail wrote on 05/26/2015 05:14 AM:

No Log Error. No Fatal Error log. No Core Dump

It's not RAM or HW problem. It's XMAIL internal issue, because when I switch to 
stunnel, all problems solved. And then when I test K9-MAIL with XMAIL+STUNNEL, 
K9 Client will not have any JAVA somethings Exception Error

Two tests

1. Very Important Thing in Xmail 1.27 Native SSL

If the emailbox has many emails such as 1, Microsoft Outlook with SSL or 
NON-SSL download them, it WILL NOT have this issue.
Some Tencent Foxmail for Windows, after finish ssl session, it will take the 
server be FIN_WAIT2 (some version, not all)
But K9-MAIL for Android, Download first 1000, it will appear the error in 
K9-MAIL randomly.


2. Xmail 1.27 + Stunnel Proxy

If the emailbox has many emails such as 1, Microsoft Outlook with SSL or 
NON-SSL download them, it WILL NOT have this issue.
Some Tencent Foxmail for Windows, after finish ssl session, it WILL NOT have 
any problem. Server WILL NOT TAKE FIN_WAIT_2
K9-MAIL for Android, Download first 1000, it will NOT DISPLAY any error when it 
finished download emails.

I would need full description about the server HW and SW (OS version,
xmail start params etc., any xmail patches applied etc.).

There is of course also the possibility that the bug lies in the
said mobile clie

Re: [xmail] Tip: Speeding up xmail by pointing envvar XMAIL_TEMP to a ramdisk

2015-05-25 Thread Bart Mortelmans via xmail
Are you sure this will actually speed up XMail? Have you been able to 
compare, specifically for XMail?


As far as I understand how XMail processes e-mails, it actually only 
creates a file one time and then moves that file around between 
temp-folder, spool folder and local POP3 folders. Moving a file on the 
same filesystem means the file isn't re-rewritten. If you move a file 
between different filesystems, it does need to be re-written. That could 
actually mean that having the temp folder on a RAM-disk might slow 
things down if there would be an event in which XMail moves a file from 
spool to temp to local POP3 folder. When they are all on the same 
filesystem, this would mean the file would need to be written only once 
(and then moved around). If the temp folder is on a different 
file-system, this would cause the file to be writting to the hard drive 
twice and to the RAM-drive once.


All mails will not only pass through the temp-folder, but will also end 
up in the spool-folder. If most mails only pass through the server (and 
don't need to be stored locally) then you might be able to see a speed 
improvement by also placing the spool folder on a ramdisk. But this 
would mean that all mails pending delivery are lost at server restart 
(so this isn't really recommended).


Sincerely,
Bart Mortelmans


U.Mutlu via xmail schreef op 25/05/15 om 01:09:

Tip: Speeding up xmail by pointing envvar XMAIL_TEMP to a ramdisk
(here on Linux using a 64 MB ramdisk mounted to /mnt/ramdisk )

mkdir -p /mnt/ramdisk

in /etc/fstab:
tmpfs  /mnt/ramdisk  tmpfs  nodev,size=64M  0  0

then either reboot or use this cmd:
mount /mnt/ramdisk

in xmail start script:
export XMAIL_ROOT=/var/MailRoot
export XMAIL_TEMP=/mnt/ramdisk
export 
PATH=$XMAIL_ROOT/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

...

and restart xmail.

The ramdisk size should be bigger than "MaxMessageSize" (unit KB) in 
server.tab.


This will speed up mail processing (at least incoming mails) 
significantly.

Here's more info about speed gains:
http://www.jamescoyle.net/knowledge/951-the-difference-between-a-tmpfs-and-ramfs-ram-disk 

"The major benefit to memory based file systems is that they are very 
fast – 10s of times faster than modern SSDs. Read and write 
performance is massively increased for all workload types."


One can even copy the mostly called programs (for example filters) 
onto the ramdisk, but then one must use such a PATH line (instead of 
the above one):
export 
PATH=/mnt/ramdisk:$XMAIL_ROOT/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin




___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] thx to xmail and its author

2015-05-16 Thread Bart Mortelmans via xmail
Hi,

I have been using XMail for what must have been almost 15 years. I still prefer 
XMail for anything that does not need IMAP.

I made some small changes to the code. If anybody would be willing to pick up 
XMail and start development again, I hope that these changes can also get into 
the new version. If you need more details, let me know!

- Change the default error message for a failed pre-date or post-data filter to 
code 451 (by default this would otherwise be 554 which means there won’t be an 
other attempt). For me 451 makes much more sense. 

- Added basic support for LMTP. That way I can have XMail deliver mails to 
dovecot directly. For this, I just had to add the LHLO message next to the HELO 
and EHLO. This works for me, as with my configuration there shouldn’t be any 
event in which XMail tries to deliver one e-mail to multiple recipients via 
LTMP. I’m not sure if there might be other configurations for which more work 
would be needed for LMTP to work.

- Made XMail log a line to SMAIL log in case of delivery failure (posted 
details on this in an e-mail to this mailing list very recently).

If anybody is taking feature requests: I would be interested in a way of XMail 
talking to a “filter” via a socket. Now, for every e-mail to be filtered, a 
process has to be started. It would be much more efficient if XMail could talk 
a filter-server via a socket. That filter server could be anything, but maybe 
we could even get it to talk directly to spamd and clamd…

Sincerely,
Bart Mortelmans


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] non-delivered mails not listed in the logs - update to log permanent delivery failures

2015-05-04 Thread Bart Mortelmans via xmail

I'm also still here :)

I actually also found it annoying that the SMAIL logs show success, but 
don't show failure. I don't want to receive an e-mail about every 
message that can't be delivered, but if someone contacts me about an 
email he (assumes) to not have received, I want to be able to quickly 
find it in the logs.


You can solve this by editing QueueUtils.cpp and adding this around line 
803 (just below "int iResult = QueUtTXErrorExNotifySender ..."):

> USmlLogMessage(hFSpool, "FAIL", pszReason, pszServer);

Recompile and copy the files to the bin-folder and from then on you'll 
see "FAIL" lines appear on the smail-log every time there was a 
permanent delivery failure, with details about what went wrong.


I actually only just figured this out. I have only tested it on a 
test-server, but not in production yet. Let me know if you see any problems.


Sincerely,
Bart Mortelmans


U.Mutlu via xmail schreef op 30/04/15 om 13:56:

Hi, anybody left here? :-)

Can anybody confirm this? :

It seems xmail does not make a log entry for a non-deliverable mail.
Though it sends an error mail to the sender (Subject "Error sending 
message ...").


This is not optimal, since the mail admin should have the possibility
to inform himself about such problems from the logs.

Thx
___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail



___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail