There shouldn't be any huge difference in speed, but the 2.5.3dev3 binary from May is not production quality so it might be better to test a 2.6 release candidate: https://sourceforge.net/projects/emailrelay/files/OldFiles/emailrelay-2.6rc1.exe/download https://sourceforge.net/projects/emailrelay/files/OldFiles/emailrelay-textmode-2.6rc1.exe/download Note that the event loop changes only take effect once you reach the 64-handle limit. When it switches over there will be a line in the log file something...
Hello, I've test it a lot in test and prod environments. App is incredibly fast and can handle large amounts of email traffic. x100 or x1000 faster than old version :) I'm not sure but there is problem with handling traffic or creating content files. The contents of simultaneously sended emails seem to be mixed up. I still haven't figured it out yet, I'm testing it.
Oh, I see. now I get it. Many thanks!
There different 'to' addresses: the envelope-to address is used in the SMTP RCPT-TO command, which you see in the log, whereas the content-to is the To: header in the message content. They can be completely different and in your case the content-to header in your test message appears to be empty.
its just a simple one mail example to see To addresses missing. In prod, I use network filter for address validation and content filter. but same result. anyway, in log file these lines show me that SMTP client send TO address and its seems ok. but in content file To is empty; emailrelay: 20240815.144022.181: info: 10.1.2.3:46230; GSmtp::ServerProtocol: rx<<: "RCPT TO:<abc@tttest123test.com>" emailrelay: 20240815.144022.181: info: 10.1.2.3:46230; GSmtp::ServerSend: tx>>: "250 recipient <abc@tttest123test.com>...
I don't think this can be a problem with emailrelay. The SMTP dialogue specifies envelope-to and envelope-from addresses but these are independent of the To: and From: headers at the start of the message content. E-MailRelay does not interpret or edit the message content in any way, other than to add a Received line -- whatever it receives over the socket is written straight to the content file. Your log file suggests that you are not doing any filtering, and your message content file does not look...
Missing To/Cc/Bcc addresses in content file
Hi Support, My understanding is that if the SMTP Server page uses port 25 and the SMTP Client page also needs to use the same port, is this correct?
It should be whatever port the server is listening on. I can't tell from your screenshots what that is. It might be 25 or 587 or something else completely. Try using telnet (eg. "telnet localhost 25" with CTRL-] and "quit" to quit) or netstat ("netstat -an -p TCP").
Hi Support, What about emailrelay "SMTP server" local port number? should i leave it blank? Thank you.
In that case you will need to configure emailrelay with 127.0.0.1 on the "SMTP client" page, and with the correct port number (probably 25 or 587). (Note that the 'mail.cns...' domain name might resolve to the correct machine but the server is only listening on 127.0.0.1)
Socket binding error
Add Support for forwarding .eml files
I'm glad it's working out for you. The next release of the emailrelay-submit tool should mean you don't have to parse out the recipient's envelope address.
Hi Support, you can end this ticket now. Thank you.
Hi Support, for your information, both software are running on the same machine, i mean the first-image-thing and the emailrelay.
The first image appears to show something configured to listen on 127.0.0.1 and some undefined port (probably 25 or 587). But you have configured emailrelay to send to mail.cns.com.my on port 587. That can only work if both emailrelay and the first-image-thing are both running on the mail.cns.com.my machine and the first-image-thing defaults to listening on port 587. The first-image-thing should probably be configured to listen on a wildcard address . Try leaving the edit box empty, or perhaps try...
Email Relay Settings
Thanks for the insight, I have a basic powershell script that could be scheduled that is working for me, the emails do not have any cc addresses detailed so I haven't looked into a way around that problem. I have attached the script in-case anyone in future has a similar issue or request. A --poll-action argument would be useful however this will work fine for me for the moment.
When you run emailrelay-submit at a command prompt it expects the email content to be on the standard input -- that means typed in from the keyboard or taken from a file using "<" redirection or from a "|" pipline. So something like this: PATH=%PATH%;c:\program files\e-mailrelay set SPOOL=c:\programdata\e-mailrelay\spool emailrelay-submit --spool-dir %SPOOL% < myemail.eml Without the "<" redirection it will wait forever for you to type in the message. (For basic usage information use "emailrelay-submit...
Using the emailrelay-submit function just seems to lock up my command prompt in an input window, when inputting under the command it does create a .content file but theres no automatic content file generation from the .eml files already in the folder, there's no documentation on the submit function as far as i can tell so I'm using the arguments "emailrelay-submit --spool-dir MySpoolDir MyRelayAddress:25", what i'm trying to do is recreate the functionality of IIS smtp server's file pickup and forward...
The normal way to do it would be to use the emailrelay-submit utility. It takes a RFC-822 content file, copies it into the emailrelay spool directory and adds an envelope file. I would expect that to work just fine with .eml files as input. Does that work for you?
Add Support for forwarding .eml files
If your devices can be configured to send to any port, not just 25, then you should probably go for the multiple-configurations approach. You can put the account details straight into the emailrelay configuration file (ie. "client-auth plain:YWxpY2U=: c2VjcmV0"), otherwise you would need one secrets file per account. No scripting required. FWIW there are some example scripts in the distribution, using perl on unix and javascript on windows.
Yes the Exchange need all accounts to match, we only uses encrypted communication and no Anonymus, no port 25. Yes basically every device has an account, but with 2 firewalls and a Service Provider it is such an hassle to allow every single one, so we group them together and relay under now 1 account per group. It would be cool if could just tell the service to listen to multiple ports on one interface. so lets say ---in- listens on 465, --iot- listens on 44444 --term- on 44446 and then --in-foward-...
The easiest thing would be to use a filter script to edit the various From headers -- but perhaps your Exchange configuration overwrites them or requires them to match the authentication account? So then you want each group of submitting devices to use their own account when authenticating with the Exchange server? You could use multiple emailrelay configuration instances, like the in/out/other example in the documentation -- but then those configuration instances cannot all use port 25 (although...
Possible to use multiple Accounts with multiple "relays"
What o/s is the emailrelay client running on? The EHLO parameter is the canonical name returned from a DNS lookup of the hostname, Could there be DNS changes between your tests? It looks like v2.4 (and therefore 2.5) unintentionally lost the capability of overriding the client EHLO parameter from the "--domain" option, but there are no obvious changes between 2.4 and 2.5.
HELO/EHLO does not include FQDN
Classic case of RTFM. However, thank you for this great product! Regards
Yes, that is intended behaviour. Version 2.5 has this in the change log: No 7-bit/8-bit check on received message content (see NEWS file). And in the 2.5 NEWS file: Previous versions of E-MailRelay test message content when a message is received and populate the "Content" field of the envelope file as either "7bit" or "8bit". However, the SMTP client code has always largely ignored this field and it would attempt to forward 8-bit messages to a remote server that did not advertise 8BITMIME, albeit...
X-MailRelay-Content: unknown
Your screenshots confirm that emailrelay is running as a service on port 25. But only one program can listen on port 25, so when you try to start emailrelay from the Start menu (for example) it will fail with the "cannot bind" error box. That is expected behaviour. If you stop the service you should find that it will work successfully from the Start menu and you will see an icon appear in the system tray (notification area).
Hi support, I have followed your steps to check the services and found that the emailrelay service is running but the emailrelay software is still giving errors and our smtp emails are not being sent using the emailrelay software. you may refer to the attached screenshot. Thank you.
It might be because you have emailrelay already running as a service or as a system tray icon (now also known as the "notifcation area"): Search for "Services" to run the service tool, then look down the list of services for "E-MailRelay" and check its status. Right click the up arrow or "^" near the right hand side of the Windows task bar to see what's running in the system tray. You can also try running "netstat -nab -p tcp" from an administrator command prompt, or try connecting to port 25 using...
Socket binding error
https://sourceforge.net/projects/emailrelay/files/OldFiles/emailrelay-2.5.3dev3.exe/download
I have gone with a multi-threaded solution to this: the event loop will switch to using multiple threads once the number of handles it is dealing with reaches ~64, allowing it to increase to more than 3000. The code is checked in to svn trunk and git master as 2.5.3dev3 and it will go into the next release.
This is checked in to svn trunk and git master as v2.5.3dev3 and it will go into the next release (2.5.3 or 2.6 TBD). I've gone with "nostrictparsing" as the smtp configuration item name.
v2.5.3dev3
2.5.3dev3 to trunk
The 64-handle limit can't be trivially increased, but I will look into alternative approaches.
im not sure about "remote clients are hanging on to idle connection", probably the address verifier and filters cause to waiting. but, I think still 30 connections are too small. how can we increase this limit? This limit will always cause problems due to multiple/parallel e-mails sent by programs other than standard user email sendings.
New patch for v2.5.2 attached, replacing the one from 2024-03-20. Activated at run-time with "--server-smtp-config=loose".
Thanks for the justification, I'll provide an opt-in using the --server-smtp-config option for the next release.
Perhaps, but apparently strict RFC compliance is not a moral held by many other products, as I'm learning this week . In my use case for home appliances and personal server, the sender cannot be fixed or replaced because it is part of an embedded device or third party product...my printer for first example. Though a major name brand, Brother, it was first to fall afoul of the strict checking, and I have no control over its programming. I was also going to use an outdated Dell iDrac server module...
There is a 'moral hazard' in pandering to wrongly implemented protocols, but I suppose a run-time option like "--smtp-server-config=allow-broken-clients" might be an acceptable compromise. It would help if you could say why the sending software cannot be fixed or replaced. With respect to the linked issue (#89), RFC-5321 is quite explicit: "Since it has been a common source of errors, it is worth noting that spaces are not permitted on either side of the colon following FROM in the MAIL command or...
Good Evening, Graeme! Sadly I too would like to go "back-to-the-90s"(for more reasons than this though sometimes :D), as I've found a few of my systems also forget these brackets. I'm not much of a code jockey but I too will be trying the patch you've included, though would like to suggest perhaps it could be added officially as a flagged feature? --no-angle-brackets or --rfc-noncompliant come to mind. Otherwise I think E-MailRelay may be exactly what I'm looking for...as I find myself in need of...
optional and good feature. thanks.
v2.5.3dev2
2.5.3dev2 to trunk
Hi Graeme, great! Thank you very much!
If you really want a back-to-the-90s downgrade I have attached a patch for emailrelay v2.5.2.
Ah sorry, and a few corrections: of course I meant angel brackets, not square brackets and I just saw that in #89 the topic was already mentioned --> "The angle brackets thing was an issue quite a few years ago, but no one complains nowadays so it's not something I am ever going to "fix" (ie. break)." Well, I'm "complaining", but I don't think that will change anything ;-) ... Anyway, still a nice tool.
Missing or invalid angle brackets in mailbox name
So I have now added a "--log-format" option that can be used to add additional fields to the log output, in addition to the existing "--log-address" option. In your case you would use "--log-format=address,port,msgid" to get the full TCP address on the server side and the current message-id on the client side. The code is checked into SF svn trunk and SF git as version 2.5.3dev1. Please give it a go and let me know what you think.
v2.5.3dev1
2.5.3dev1 to trunk
2.5.3dev1 to trunk
It looks like you are just hitting the 64 handle limit when emailrelay calls the Windows API function WaitForMultipleObjects(). https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects Each server-side connection will use one handle for the connection and (in this case) another for the network filter. Do you have anywhere near 30 connections? If the remote clients are hanging on to idle connections for no good reason then you should try reducing the idle timeout...
error when multiple mail received same time
install fail in the Windos Server 2012 R2
thanks for your response I installed it using an account in the ADMIN group. If it is installed in the AppData directory, an error will occur at an earlier step. I installed it on another windows server 2016 and everything worked fine. I'm a bit suspicious of anti-virus software interference. I think this problem should be external factors. So I can ask you to end this ticket.
second one is good solution; add m_message_state.id to log line
Thanks for the report, but I cannot reproduce the problem. From the screen-shot you can see that the installation process stalled when creating a link from "AppData/.../Start Menu/Programs" to "C:/E-MailRelay/emailrelay-start.bat". All the important installation steps had already completed successfully. I am not a Windows administrator, but could you have had a temporary network problem with "folder redirection" enabled for "C:/Users/jason/AppData/Roaming"? Can you create the link manually? The obvious...
The client side should be less of a problem to disentangle because there is usually only one client connection at a time. (There can be multiple client connections if you are forwarding via --admin or using --immediate or if you have more than one configuration.) If you want to add client-side logging using the same mechanism as on the server side then I have attached a patch. It logs the local address including the port number, which should be unique enough for disentanglement because port numbers...
install fail in the Windos Server 2012 R2
hi again Graeme, can we add same details or another one for forwarded mails? in GSmtp::ClientProtocol lines.
Okay, I'll leave this ticket open and give it some more thought before the next release. I would appreciate it if you could add a review ( https://sourceforge.net/projects/emailrelay/reviews/ ) with more information on how you are using emailrelay (inc. o/s and mail volumes).
yeap, it would be okay. I test it and it worked.
Would adding the incoming connection's port number to the "--log-address" string be sufficient? That's a one line change to src/gnet/gserverpeer.cpp : replace hostPartString() with displayString().
Tag-Identifier value for parallel logging
How to see realtime logs when using start as service
For completeness I should add that you can get asynchronous event notifications via the 'admin' interface after using the 'notify' command. These are the same events that are used internally to update the 'status' tab.
better support for powershell filter scripts
In 2.5.2
Need help with creating email filter
STARTTLS and TLS client connection does not work with 2.5 and 2.5.1
Patched in 2.5.1a, fixed in 2.5.2
v2.5.2
v2.5.2