Logo Search packages:      
Sourcecode: pan version File versions  Download package

std::string GNKSA::generate_message_id ( const StringView domain ) [static]

thus spake son-of-1036: "the most popular method of generating local parts is to use the date and time, plus some way of distinguishing between simultaneous postings on the same host (e.g., a process number), and encode them in a suitably-reduced alphabet.

Definition at line 809 of file gnksa.cc.

   std::string s;

   // add unique local part to message-id 
   s += "pan.";
   const time_t now (time(NULL));
   struct tm local_now = *gmtime (&now);
   char buf[64];
   std::strftime (buf, sizeof(buf), "%Y.%m.%d.%H.%M.%S", &local_now);
   s += buf;

   // delimit
   s += '@';

   // add domain
   s += domain.empty() ? default_domain : domain.to_string();

   return s;

Generated by  Doxygen 1.6.0   Back to index