Menu

#120 Instant spool processing on startup

v1.0 (example)
open
nobody
None
9
3 days ago
6 days ago
No

Hello,
I am really very sattisfied within the actual build 2.6 - its just a bit tricky in setting up 2 services in windows ;-) ).
Now the only thing that I miss is the processing of objects remaining alreday in spool - while the program does NOT send (as expected) on startup all the stuff and waits until the next regular time frame 8-) It might even help to have a trigger or separate manual start batch?

Discussion

  • Graeme Walker

    Graeme Walker - 5 days ago

    I think all you need is to add "--forward". It triggers forwarding when the server starts up, so there is no need to wait for the first poll period.

     
  • Alexander Süß

    Alexander Süß - 4 days ago

    Ok, but "how"? ;-)
    While the windows service just starts the emailrelay-service.exe directly - or do I need to manipulate the start string in the registry itself while adding the --forward?

     
  • Graeme Walker

    Graeme Walker - 3 days ago

    The short answer is just add a "forward" line to the emailrelay configuration file, which is "C:\ProgramData\emailrelay\emailrelay.cfg" by default.

     # emailrelay.cfg
    log
    verbose
    forward-to smtp.example.com:25
    forward
    poll 60
    ...
    

    (If using an old version of emailrelay you would instead add "--forward" to the command-line in the "emailrelay-start.bat" batch file.)

    Note that the emailrelay-service.exe service wrapper interfaces to the windows service subsystem, but in the end it runs "emailrelay.exe" using the command-line read from the "emailrelay-start.bat" batch file (plus "--hidden"), and this normally ends with the path of the configuration file.

    (If there is no batch file then it runs "emailrelay.exe" with only the path of the "emailrelay.cfg" configuration file on the command-line.)

    If you are running multiple services then the name of the batch file or the name of the configuration file are derived from the service name. So the service wrapper running with a service name of "emailrelay2" looks for a batch file called "emailrelay2-start.bat" or a configuration file called "emailrelay2.cfg".

    The folder containing the batch file and/or configuration file defaults to whatever folder holds the "emailrelay-service.exe" executable, but the installer program overrides this by creating a one-line "emailrelay-service.cfg" configuration file that points to "C:\ProgramData\emailrelay". The name of this configuration file is also derived from the service name, so it would be "emailrelay2-service.cfg" in the previous example.

    You shouldn't have to edit the windows registry for any of this, although to enable diagnostic logging from the emailrelay service wrapper you can set HKLM/SOFTWARE/emailrelay-service/logfile to the path of a log file.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.